Added 1.8 skin settings menu
This commit is contained in:
parent
13ee2375fa
commit
1b2cb34bb1
|
@ -28,6 +28,8 @@ public interface ConfigurationAdapter {
|
|||
|
||||
Collection<String> getBlacklistSimpleWhitelist();
|
||||
|
||||
Collection<String> getDisabledCommands();
|
||||
|
||||
AuthServiceInfo getAuthSettings();
|
||||
|
||||
Map<String, Object> getMap();
|
||||
|
|
|
@ -18,6 +18,8 @@ import java.util.Iterator;
|
|||
import java.util.Stack;
|
||||
import java.util.Collection;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import net.md_5.bungee.BungeeCord;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import java.util.Arrays;
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
|
@ -30,6 +32,8 @@ import java.util.Map;
|
|||
import net.md_5.bungee.event.EventBus;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.command.ConsoleCommandSender;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class PluginManager {
|
||||
|
@ -67,6 +71,9 @@ public class PluginManager {
|
|||
if (command == null) {
|
||||
return false;
|
||||
}
|
||||
if(!(sender instanceof ConsoleCommandSender) && ((BungeeCord)proxy).config.getDisabledCommands().contains(command.getName())) {
|
||||
return false;
|
||||
}
|
||||
final String permission = command.getPermission();
|
||||
if (permission != null && !permission.isEmpty() && !sender.hasPermission(permission)) {
|
||||
sender.sendMessage(this.proxy.getTranslation("no_permission"));
|
||||
|
|
|
@ -32,6 +32,7 @@ public class Configuration {
|
|||
private boolean blacklistOriginless;
|
||||
private boolean simpleWhitelistEnabled;
|
||||
private boolean acceptBukkitConsoleCommandPacket;
|
||||
private Collection<String> disabledCommands;
|
||||
|
||||
public Configuration() {
|
||||
this.timeout = 30000;
|
||||
|
@ -63,6 +64,7 @@ public class Configuration {
|
|||
this.blacklistOriginless = adapter.getBoolean("origin_blacklist_block_missing_origin_header", false);
|
||||
this.simpleWhitelistEnabled = adapter.getBoolean("origin_blacklist_use_simple_whitelist", false);
|
||||
this.acceptBukkitConsoleCommandPacket = adapter.getBoolean("accept_bukkit_console_command_packets", false);
|
||||
this.disabledCommands = adapter.getDisabledCommands();
|
||||
Preconditions.checkArgument(this.listeners != null && !this.listeners.isEmpty(), (Object) "No listeners defined.");
|
||||
final Map<String, ServerInfo> newServers = adapter.getServers();
|
||||
Preconditions.checkArgument(newServers != null && !newServers.isEmpty(), (Object) "No servers defined");
|
||||
|
@ -139,4 +141,8 @@ public class Configuration {
|
|||
return acceptBukkitConsoleCommandPacket;
|
||||
}
|
||||
|
||||
public Collection<String> getDisabledCommands() {
|
||||
return disabledCommands;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -316,5 +316,10 @@ public class YamlConfig implements ConfigurationAdapter {
|
|||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> getDisabledCommands() {
|
||||
return this.get("disabled_commands", new ArrayList());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ public class EaglercraftBungee {
|
|||
|
||||
public static final String brand = "Eagtek";
|
||||
public static final String name = "EaglercraftBungee";
|
||||
public static final String version = "0.3.0"; // wtf does this even mean at this point
|
||||
public static final String version = "0.4.0"; // wtf does this even mean at this point
|
||||
public static final boolean cracked = true;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
package net.md_5.bungee.eaglercraft;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.md_5.bungee.UserConnection;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.api.event.PlayerDisconnectEvent;
|
||||
import net.md_5.bungee.api.event.PluginMessageEvent;
|
||||
import net.md_5.bungee.api.plugin.Listener;
|
||||
|
@ -16,6 +19,7 @@ public class PluginEaglerSkins extends Plugin implements Listener {
|
|||
|
||||
private final HashMap<String,byte[]> skinCollection = new HashMap();
|
||||
private final HashMap<String,byte[]> capeCollection = new HashMap();
|
||||
private final HashMap<String,Long> lastSkinLayerUpdate = new HashMap();
|
||||
|
||||
private static final int[] SKIN_DATA_SIZE = new int[] { 64*32*4, 64*64*4, -9, -9, 1, 64*64*4, -9 }; // 128 pixel skins crash clients
|
||||
private static final int[] CAPE_DATA_SIZE = new int[] { 32*32*4, -9, 1 };
|
||||
|
@ -43,14 +47,18 @@ public class PluginEaglerSkins extends Plugin implements Listener {
|
|||
byte[] msg = event.getData();
|
||||
try {
|
||||
if("EAG|MySkin".equals(event.getTag())) {
|
||||
int t = (int)msg[0] & 0xFF;
|
||||
if(t >= 0 && t < SKIN_DATA_SIZE.length && msg.length == (SKIN_DATA_SIZE[t] + 1)) {
|
||||
skinCollection.put(user, msg);
|
||||
if(!skinCollection.containsKey(user)) {
|
||||
int t = (int)msg[0] & 0xFF;
|
||||
if(t >= 0 && t < SKIN_DATA_SIZE.length && msg.length == (SKIN_DATA_SIZE[t] + 1)) {
|
||||
skinCollection.put(user, msg);
|
||||
}
|
||||
}
|
||||
}else if("EAG|MyCape".equals(event.getTag())) {
|
||||
int t = (int)msg[0] & 0xFF;
|
||||
if(t >= 0 && t < CAPE_DATA_SIZE.length && msg.length == (CAPE_DATA_SIZE[t] + 1)) {
|
||||
capeCollection.put(user, msg);
|
||||
if(!capeCollection.containsKey(user)) {
|
||||
int t = (int)msg[0] & 0xFF;
|
||||
if(t >= 0 && t < CAPE_DATA_SIZE.length && msg.length == (CAPE_DATA_SIZE[t] + 2)) {
|
||||
capeCollection.put(user, msg);
|
||||
}
|
||||
}
|
||||
}else if("EAG|FetchSkin".equals(event.getTag())) {
|
||||
if(msg.length > 2) {
|
||||
|
@ -69,6 +77,30 @@ public class PluginEaglerSkins extends Plugin implements Listener {
|
|||
((UserConnection)event.getSender()).sendData("EAG|UserSkin", conc);
|
||||
}
|
||||
}
|
||||
}else if("EAG|SkinLayers".equals(event.getTag())) {
|
||||
long millis = System.currentTimeMillis();
|
||||
Long lsu = lastSkinLayerUpdate.get(user);
|
||||
if(lsu != null && millis - lsu.longValue() < 700l) { // DoS protection
|
||||
return;
|
||||
}
|
||||
lastSkinLayerUpdate.put(user, millis);
|
||||
byte[] data;
|
||||
if((data = capeCollection.get(user)) != null) {
|
||||
data[1] = msg[0];
|
||||
}else {
|
||||
data = new byte[] { (byte)2, msg[0], (byte)0 };
|
||||
capeCollection.put(user, data);
|
||||
}
|
||||
ByteArrayOutputStream bao = new ByteArrayOutputStream();
|
||||
DataOutputStream dd = new DataOutputStream(bao);
|
||||
dd.write(msg[0]);
|
||||
dd.writeUTF(user);
|
||||
byte[] bpacket = bao.toByteArray();
|
||||
for(ProxiedPlayer pl : getProxy().getPlayers()) {
|
||||
if(!pl.equals(user)) {
|
||||
pl.sendData("EAG|SkinLayers", bpacket);
|
||||
}
|
||||
}
|
||||
}
|
||||
}catch(Throwable t) {
|
||||
// hacker
|
||||
|
@ -78,8 +110,10 @@ public class PluginEaglerSkins extends Plugin implements Listener {
|
|||
|
||||
@EventHandler
|
||||
public void onPlayerDisconnect(PlayerDisconnectEvent event) {
|
||||
skinCollection.remove(event.getPlayer().getName());
|
||||
capeCollection.remove(event.getPlayer().getName());
|
||||
String nm = event.getPlayer().getName();
|
||||
skinCollection.remove(nm);
|
||||
capeCollection.remove(nm);
|
||||
lastSkinLayerUpdate.remove(nm);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -31,7 +31,8 @@ menu.convertingLevel=Converting world
|
|||
menu.simulating=Simulating the world for a bit
|
||||
menu.respawning=Respawning
|
||||
menu.shareToLan=Open to LAN
|
||||
menu.skinCapeSettings=Skins/Capes Settings...
|
||||
|
||||
menu.skinCapeSettings=Skins/Capes Settings
|
||||
menu.skinCapeSettingsNote0=I put the button up here so
|
||||
menu.skinCapeSettingsNote1=lazy people can find it
|
||||
menu.skinCapeSettings.skinCustomization=Skin Customization
|
||||
|
@ -42,12 +43,11 @@ menu.skinCapeSettings.skinCustomization.leftArm=Left Sleeve
|
|||
menu.skinCapeSettings.skinCustomization.rightArm=Right Sleeve
|
||||
menu.skinCapeSettings.skinCustomization.leftPants=Left Pants Leg
|
||||
menu.skinCapeSettings.skinCustomization.rightPants=Right Pants Leg
|
||||
menu.skinCapeSettings.skinCustomization.allOff=All Off
|
||||
menu.skinCapeSettings.skinCustomization.allOn=All On
|
||||
menu.skinCapeSettings.skinCustomization.otherPlayers=Other Players
|
||||
menu.skinCapeSettings.skinCustomization.otherPlayers=Other Player Skins
|
||||
menu.skinCapeSettings.skinCustomization.showErasersOn=Eraser Skins: Enable
|
||||
menu.skinCapeSettings.skinCustomization.showErasersOff=Eraser Skins: Disable
|
||||
menu.skinCapeSettings.skinCustomization.showOtherCapes=Show Capes
|
||||
menu.skinCapeSettings.skinCustomization.apply=Save Options and Return to Game
|
||||
|
||||
profile.title=Edit Profile
|
||||
profile.capeTitle=Select Cape
|
||||
|
@ -345,6 +345,7 @@ options.framebufferAntialias.fxaa=FXAA
|
|||
options.framebufferAntialias.msaa4=MSAA4
|
||||
options.framebufferAntialias.msaa8=MSAA8
|
||||
options.patchAnisotropic=Fix ANGLE bug #4994
|
||||
options.chunkUpdates=Chunk Update per FPS
|
||||
|
||||
performance.max=Max FPS
|
||||
performance.balanced=Balanced
|
||||
|
|
BIN
lwjgl-rundir/resources/mesh/charles.fallback.png
Normal file
BIN
lwjgl-rundir/resources/mesh/charles.fallback.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 37 KiB |
BIN
lwjgl-rundir/resources/mesh/laxativedude.fallback.png
Normal file
BIN
lwjgl-rundir/resources/mesh/laxativedude.fallback.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
BIN
lwjgl-rundir/resources/mesh/longarms.fallback.png
Normal file
BIN
lwjgl-rundir/resources/mesh/longarms.fallback.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
BIN
lwjgl-rundir/resources/mesh/weirdclimber.fallback.png
Normal file
BIN
lwjgl-rundir/resources/mesh/weirdclimber.fallback.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
lwjgl-rundir/resources/mesh/winston.fallback.png
Normal file
BIN
lwjgl-rundir/resources/mesh/winston.fallback.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
|
@ -4,7 +4,7 @@ public class ConfigConstants {
|
|||
|
||||
public static boolean profanity = false;
|
||||
|
||||
public static final String version = "22w23c";
|
||||
public static final String version = "22w26b";
|
||||
public static final String mainMenuString = "eaglercraft " + version;
|
||||
|
||||
public static final String forkMe = "https://github.com/LAX1DUDE/eaglercraft";
|
||||
|
|
|
@ -175,8 +175,19 @@ public class DefaultSkinRenderer {
|
|||
defaultVanillaSkins[0].bindTexture();
|
||||
}
|
||||
}else {
|
||||
if(((int)pp.skinPacket[1] & 0xFF) < defaultVanillaSkins.length) {
|
||||
defaultVanillaSkins[(int)pp.skinPacket[1] & 0xFF].bindTexture();
|
||||
int type2 = (int)pp.skinPacket[1] & 0xFF;
|
||||
if(type2 < defaultVanillaSkins.length) {
|
||||
TextureLocation loc = defaultVanillaSkins[type2];
|
||||
if(loc != null) {
|
||||
loc.bindTexture();
|
||||
}else {
|
||||
if(defaultHighPoly[type2] != null) {
|
||||
defaultHighPoly[type2].fallbackTexture.bindTexture();
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -224,15 +235,15 @@ public class DefaultSkinRenderer {
|
|||
int tp = ((int)pp.skinPacket[0] & 0xFF);
|
||||
if(tp >= 0 && tp < EaglerProfile.SKIN_DATA_SIZE.length) {
|
||||
int offset = 1 + EaglerProfile.SKIN_DATA_SIZE[tp];
|
||||
if(pp.skinPacket.length > offset) {
|
||||
if(pp.skinPacket.length > offset + 1) {
|
||||
int capeType = (int)pp.skinPacket[offset] & 0xFF;
|
||||
if(capeType >= 0 && capeType < EaglerProfile.CAPE_DATA_SIZE.length) {
|
||||
int len = EaglerProfile.CAPE_DATA_SIZE[capeType];
|
||||
if(pp.skinPacket.length > offset + len) {
|
||||
if(pp.skinPacket.length > offset + len + 1) {
|
||||
if(capeType != 2) {
|
||||
if(!capeGLUnits.containsKey(pp)) {
|
||||
byte[] dataToLoad = new byte[len];
|
||||
System.arraycopy(pp.skinPacket, offset + 1, dataToLoad, 0, len);
|
||||
System.arraycopy(pp.skinPacket, offset + 2, dataToLoad, 0, len);
|
||||
int w, h;
|
||||
switch(capeType) {
|
||||
case 0:
|
||||
|
@ -258,7 +269,7 @@ public class DefaultSkinRenderer {
|
|||
return false;
|
||||
}
|
||||
}else {
|
||||
int preset = (int)pp.skinPacket[offset + 1] & 0xFF;
|
||||
int preset = (int)pp.skinPacket[offset + 2] & 0xFF;
|
||||
if(preset < defaultVanillaCapes.length) {
|
||||
TextureLocation loc = defaultVanillaCapes[preset];
|
||||
if(loc == null) {
|
||||
|
@ -284,6 +295,36 @@ public class DefaultSkinRenderer {
|
|||
return false;
|
||||
}
|
||||
|
||||
public static int getSkinLayerByte(EntityPlayer p) {
|
||||
if(p instanceof EntityClientPlayerMP) {
|
||||
return Minecraft.getMinecraft().gameSettings.getSkinLayers();
|
||||
}else if(p instanceof EntityOtherPlayerMP) {
|
||||
EntityOtherPlayerMP pp = (EntityOtherPlayerMP) p;
|
||||
if(pp.skinPacket != null) {
|
||||
int tp = ((int)pp.skinPacket[0] & 0xFF);
|
||||
if(tp >= 0 && tp < EaglerProfile.SKIN_DATA_SIZE.length) {
|
||||
int offset = 1 + EaglerProfile.SKIN_DATA_SIZE[tp];
|
||||
if(pp.skinPacket.length > offset + 1) {
|
||||
return (int)pp.skinPacket[offset + 1] & 0xFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0xFF;
|
||||
}
|
||||
|
||||
public static void updateSkinLayerByte(int skinFlags, byte[] pkt) {
|
||||
if(pkt.length > 0) {
|
||||
int tp = ((int)pkt[0] & 0xFF);
|
||||
if(tp >= 0 && tp < EaglerProfile.SKIN_DATA_SIZE.length) {
|
||||
int offset = 1 + EaglerProfile.SKIN_DATA_SIZE[tp];
|
||||
if(pkt.length > offset + 1) {
|
||||
pkt[offset + 1] = (byte)skinFlags;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void requestSkin(EntityOtherPlayerMP pp) {
|
||||
if(!skinCookies.containsValue(pp)) {
|
||||
int cookie = (int)(System.nanoTime() % 65536);
|
||||
|
@ -529,6 +570,7 @@ public class DefaultSkinRenderer {
|
|||
defaultVanillaSkins[id].bindTexture();
|
||||
}
|
||||
|
||||
boolean gonnaShowCape = false;
|
||||
if(isStandardModel(id) || id < 0) {
|
||||
if(oldSkinRenderer == null) oldSkinRenderer = new ModelBiped(0.0F, 0.0F, 64, 32);
|
||||
if(newSkinRenderer == null) newSkinRenderer = new ModelBipedNewSkins(0.0F, false);
|
||||
|
@ -556,37 +598,12 @@ public class DefaultSkinRenderer {
|
|||
oldSkinRenderer.render(null, 0.0f, 0.0f, (float)(System.currentTimeMillis() % 100000) / 50f, ((x - mx) * 0.06f), ((y - my) * -0.1f), 0.0625F);
|
||||
oldSkinRenderer.blockTransparentSkin = false;
|
||||
}
|
||||
|
||||
if(capeMode && !(EaglerProfile.presetCapeId >= 0 && defaultVanillaCapes[EaglerProfile.presetCapeId] == null)) {
|
||||
EaglerAdapter.glPushMatrix();
|
||||
EaglerAdapter.glTranslatef(0.0F, 0.0F, 0.150F);
|
||||
EaglerAdapter.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
|
||||
EaglerAdapter.glRotatef(-6.0F, 1.0F, 0.0F, 0.0F);
|
||||
|
||||
if(EaglerProfile.presetCapeId < 0) {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(EaglerProfile.capes.get(EaglerProfile.customCapeId).glTex);
|
||||
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_TEXTURE);
|
||||
EaglerAdapter.glPushMatrix();
|
||||
EaglerAdapter.glScalef(2.0f, 1.0f, 1.0f);
|
||||
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_MODELVIEW);
|
||||
}else {
|
||||
defaultVanillaCapes[EaglerProfile.presetCapeId].bindTexture();
|
||||
}
|
||||
|
||||
oldSkinRenderer.bipedCloak.render(0.0625F);
|
||||
|
||||
if(EaglerProfile.presetCapeId < 0) {
|
||||
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_TEXTURE);
|
||||
EaglerAdapter.glPopMatrix();
|
||||
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_MODELVIEW);
|
||||
}
|
||||
|
||||
EaglerAdapter.glPopMatrix();
|
||||
}
|
||||
gonnaShowCape = capeMode;
|
||||
}else if(isZombieModel(id)) {
|
||||
if(zombieRenderer == null) zombieRenderer = new ModelZombie(0.0F, true);
|
||||
zombieRenderer.isChild = false;
|
||||
zombieRenderer.render(null, 0.0f, 0.0f, (float)(System.currentTimeMillis() % 100000) / 50f, ((x - mx) * 0.06f), ((y - my) * -0.1f), 0.0625F);
|
||||
gonnaShowCape = capeMode;
|
||||
}else if(id == 32) {
|
||||
if(villagerRenderer == null) villagerRenderer = new ModelVillager(0.0F);
|
||||
villagerRenderer.isChild = false;
|
||||
|
@ -619,6 +636,33 @@ public class DefaultSkinRenderer {
|
|||
EaglerAdapter.glColor4f(1.5f, 1.5f, 1.5f, 1.0f);
|
||||
blazeRenderer.render(null, 0.0f, 0.0f, (float)(System.currentTimeMillis() % 100000) / 50f, ((x - mx) * 0.06f), ((y - my) * -0.1f), 0.0625F);
|
||||
}
|
||||
if(gonnaShowCape && !(EaglerProfile.presetCapeId >= 0 && defaultVanillaCapes[EaglerProfile.presetCapeId] == null)) {
|
||||
EaglerAdapter.glPushMatrix();
|
||||
EaglerAdapter.glTranslatef(0.0F, 0.0F, 0.150F);
|
||||
EaglerAdapter.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
|
||||
EaglerAdapter.glRotatef(-6.0F, 1.0F, 0.0F, 0.0F);
|
||||
|
||||
if(EaglerProfile.presetCapeId < 0) {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(EaglerProfile.capes.get(EaglerProfile.customCapeId).glTex);
|
||||
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_TEXTURE);
|
||||
EaglerAdapter.glPushMatrix();
|
||||
EaglerAdapter.glScalef(2.0f, 1.0f, 1.0f);
|
||||
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_MODELVIEW);
|
||||
}else {
|
||||
defaultVanillaCapes[EaglerProfile.presetCapeId].bindTexture();
|
||||
}
|
||||
|
||||
if(oldSkinRenderer == null) oldSkinRenderer = new ModelBiped(0.0F, 0.0F, 64, 32);
|
||||
oldSkinRenderer.bipedCloak.render(0.0625F);
|
||||
|
||||
if(EaglerProfile.presetCapeId < 0) {
|
||||
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_TEXTURE);
|
||||
EaglerAdapter.glPopMatrix();
|
||||
EaglerAdapter.glMatrixMode(EaglerAdapter.GL_MODELVIEW);
|
||||
}
|
||||
|
||||
EaglerAdapter.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
EaglerAdapter.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
|
|
|
@ -95,21 +95,23 @@ public class EaglerProfile {
|
|||
}
|
||||
|
||||
public static byte[] getCapePacket() {
|
||||
int sf = Minecraft.getMinecraft().gameSettings.getSkinLayers();
|
||||
if(presetCapeId == -1) {
|
||||
byte[] d = capes.get(customCapeId).data;
|
||||
if(d == null) {
|
||||
return new byte[] { (byte)2, (byte)0 };
|
||||
return new byte[] { (byte)2, (byte)sf, (byte)0 };
|
||||
}
|
||||
byte[] d2 = new byte[1 + d.length];
|
||||
byte[] d2 = new byte[2 + d.length];
|
||||
int sz = getCapeSize(d.length);
|
||||
if(sz < 0) {
|
||||
return new byte[] { (byte)2, (byte)0 };
|
||||
return new byte[] { (byte)2, (byte)sf, (byte)0 };
|
||||
}
|
||||
d2[0] = (byte) sz;
|
||||
System.arraycopy(d, 0, d2, 1, d.length);
|
||||
d2[1] = (byte) sf;
|
||||
System.arraycopy(d, 0, d2, 2, d.length);
|
||||
return d2;
|
||||
}else {
|
||||
return new byte[] { (byte)2, (byte)presetCapeId };
|
||||
return new byte[] { (byte)2, (byte)sf, (byte)presetCapeId };
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -204,13 +204,11 @@ public class GuiScreenEditCape extends GuiScreen {
|
|||
if((b = EaglerAdapter.getFileChooserResult()) != null && b.length > 0) {
|
||||
EaglerImage img = EaglerImage.loadImage(b);
|
||||
|
||||
if(!((img.w == 32 && img.h == 32) || (img.w == 64 && img.h == 64) || (img.w == 64 && img.h == 32) || (img.w == 64 && img.h == 128))) return;
|
||||
if(!((img.w == 32 && img.h == 32) || (img.w == 64 && img.h == 32))) return;
|
||||
|
||||
int[] loadSkin = img.data;
|
||||
if(img.w == 64 && img.h == 32) {
|
||||
loadSkin = grabPiece(loadSkin, 32, 32, 64);
|
||||
}else if(img.w == 128 && img.h == 64) {
|
||||
loadSkin = grabPiece(loadSkin, 64, 64, 128);
|
||||
}
|
||||
|
||||
byte[] rawSkin = new byte[loadSkin.length * 4];
|
||||
|
@ -250,6 +248,9 @@ public class GuiScreenEditCape extends GuiScreen {
|
|||
}
|
||||
if(var1 > 0) {
|
||||
scrollPos -= 3;
|
||||
if(scrollPos < 0) {
|
||||
scrollPos = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,6 +112,7 @@ public class GuiScreenEditProfile extends GuiScreen {
|
|||
this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 15, 16777215);
|
||||
this.drawString(this.fontRenderer, var1.translateKey("profile.screenname"), this.width / 2 - 20, this.height / 6 + 8, 10526880);
|
||||
|
||||
newSkinNotificationIndexCurrent = 23948923;
|
||||
int cnt = defaultOptions.length - newSkinNotificationIndexCurrent;
|
||||
if(cnt <= 0) {
|
||||
this.drawString(this.fontRenderer, var1.translateKey("profile.playerSkin"), this.width / 2 - 20, this.height / 6 + 66, 10526880);
|
||||
|
@ -304,6 +305,9 @@ public class GuiScreenEditProfile extends GuiScreen {
|
|||
}
|
||||
if(var1 > 0) {
|
||||
scrollPos -= 3;
|
||||
if(scrollPos < 0) {
|
||||
scrollPos = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -389,7 +393,7 @@ public class GuiScreenEditProfile extends GuiScreen {
|
|||
byte[] b;
|
||||
if((b = EaglerAdapter.getFileChooserResult()) != null && b.length > 0) {
|
||||
EaglerImage img = EaglerImage.loadImage(b);
|
||||
if(!((img.w == 64 && img.h == 32) || (img.w == 64 && img.h == 64) || (img.w == 128 && img.h == 64) || (img.w == 128 && img.h == 128))) return;
|
||||
if(!((img.w == 64 && img.h == 32) || (img.w == 64 && img.h == 64))) return;
|
||||
byte[] rawSkin = new byte[img.data.length * 4];
|
||||
for(int i = 0; i < img.data.length; i++) {
|
||||
int i2 = i * 4; int i3 = img.data[i];
|
||||
|
@ -402,7 +406,7 @@ public class GuiScreenEditProfile extends GuiScreen {
|
|||
if(name.length() > 32) {
|
||||
name = name.substring(0, 32);
|
||||
}
|
||||
if((img.w == 64 && img.h == 64) || (img.w == 128 && img.h == 128)) {
|
||||
if(img.w == 64 && img.h == 64) {
|
||||
newSkinWaitSteveOrAlex = true;
|
||||
}
|
||||
int k;
|
||||
|
@ -485,7 +489,7 @@ public class GuiScreenEditProfile extends GuiScreen {
|
|||
if(par1 >= skinX && par1 < (skinX + 20) && par2 >= skinY && par2 < (skinY + 22)) {
|
||||
dropDownOpen = !dropDownOpen;
|
||||
if(!dropDownOpen) {
|
||||
newSkinNotificationIndexCurrent = EaglerProfile.newSkinNotificationIndex;
|
||||
//newSkinNotificationIndexCurrent = EaglerProfile.newSkinNotificationIndex;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -498,7 +502,7 @@ public class GuiScreenEditProfile extends GuiScreen {
|
|||
dropDownOpen = false;
|
||||
dragging = false;
|
||||
if(!dropDownOpen) {
|
||||
newSkinNotificationIndexCurrent = EaglerProfile.newSkinNotificationIndex;
|
||||
//newSkinNotificationIndexCurrent = EaglerProfile.newSkinNotificationIndex;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -513,7 +517,7 @@ public class GuiScreenEditProfile extends GuiScreen {
|
|||
dropDownOpen = false;
|
||||
dragging = false;
|
||||
if(!dropDownOpen) {
|
||||
newSkinNotificationIndexCurrent = EaglerProfile.newSkinNotificationIndex;
|
||||
//newSkinNotificationIndexCurrent = EaglerProfile.newSkinNotificationIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,127 @@
|
|||
package net.lax1dude.eaglercraft;
|
||||
|
||||
import net.minecraft.src.GuiButton;
|
||||
import net.minecraft.src.GuiScreen;
|
||||
import net.minecraft.src.MathHelper;
|
||||
import net.minecraft.src.StringTranslate;
|
||||
|
||||
public class GuiScreenSkinCapeSettings extends GuiScreen {
|
||||
|
||||
private final GuiScreen parent;
|
||||
|
||||
private String skinCustomizationTitle = "yee";
|
||||
private String skinCustomizationOtherPlayers = "yee";
|
||||
|
||||
private GuiButton toggleCape;
|
||||
private GuiButton toggleJacket;
|
||||
private GuiButton toggleHat;
|
||||
private GuiButton toggleLeftArm;
|
||||
private GuiButton toggleRightArm;
|
||||
private GuiButton toggleLeftLeg;
|
||||
private GuiButton toggleRightLeg;
|
||||
private GuiButton toggleShowErasers;
|
||||
private GuiButton toggleShowOtherCapes;
|
||||
|
||||
public GuiScreenSkinCapeSettings(GuiScreen parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public void initGui() {
|
||||
StringTranslate var1 = StringTranslate.getInstance();
|
||||
skinCustomizationTitle = var1.translateKey("menu.skinCapeSettings.skinCustomization");
|
||||
skinCustomizationOtherPlayers = var1.translateKey("menu.skinCapeSettings.skinCustomization.otherPlayers");
|
||||
|
||||
int offset = MathHelper.clamp_int((height - 300) / 3, -100, 0);
|
||||
|
||||
buttonList.add(new GuiButton(0, ((width - 230) / 2), 225 + offset, 230, 20, var1.translateKey("menu.skinCapeSettings.skinCustomization.apply")));
|
||||
|
||||
buttonList.add(toggleJacket = new GuiButton(1, width / 2 - 152, 60 + offset, 150, 20, var1.translateKey("menu.skinCapeSettings.skinCustomization.jacket") + ": " +
|
||||
(mc.gameSettings.showSkinJacket ? var1.translateKey("options.on") : var1.translateKey("options.off"))));
|
||||
buttonList.add(toggleHat = new GuiButton(2, width / 2 + 2, 60 + offset, 150, 20, var1.translateKey("menu.skinCapeSettings.skinCustomization.hat") + ": " +
|
||||
(mc.gameSettings.showSkinHat ? var1.translateKey("options.on") : var1.translateKey("options.off"))));
|
||||
buttonList.add(toggleLeftArm = new GuiButton(3, width / 2 - 152, 82 + offset, 150, 20, var1.translateKey("menu.skinCapeSettings.skinCustomization.leftArm") + ": " +
|
||||
(mc.gameSettings.showSkinLeftArm ? var1.translateKey("options.on") : var1.translateKey("options.off"))));
|
||||
buttonList.add(toggleRightArm = new GuiButton(4, width / 2 + 2, 82 + offset, 150, 20, var1.translateKey("menu.skinCapeSettings.skinCustomization.rightArm") + ": " +
|
||||
(mc.gameSettings.showSkinRightArm ? var1.translateKey("options.on") : var1.translateKey("options.off"))));
|
||||
buttonList.add(toggleLeftLeg = new GuiButton(5, width / 2 - 152, 104 + offset, 150, 20, var1.translateKey("menu.skinCapeSettings.skinCustomization.leftPants") + ": " +
|
||||
(mc.gameSettings.showSkinLeftLeg ? var1.translateKey("options.on") : var1.translateKey("options.off"))));
|
||||
buttonList.add(toggleRightLeg = new GuiButton(6, width / 2 + 2, 104 + offset, 150, 20, var1.translateKey("menu.skinCapeSettings.skinCustomization.rightPants") + ": " +
|
||||
(mc.gameSettings.showSkinRightLeg ? var1.translateKey("options.on") : var1.translateKey("options.off"))));
|
||||
buttonList.add(toggleCape = new GuiButton(7, width / 2 - 85, 130 + offset, 165, 20, var1.translateKey("menu.skinCapeSettings.skinCustomization.cape") + ": " +
|
||||
(mc.gameSettings.showCape ? var1.translateKey("options.on") : var1.translateKey("options.off"))));
|
||||
buttonList.add(toggleShowErasers = new GuiButton(8, width / 2 - 152, 190 + offset, 150, 20, (mc.gameSettings.allowFNAWSkins ?
|
||||
var1.translateKey("menu.skinCapeSettings.skinCustomization.showErasersOn") : var1.translateKey("menu.skinCapeSettings.skinCustomization.showErasersOff"))));
|
||||
buttonList.add(toggleShowOtherCapes = new GuiButton(9, width / 2 + 2, 190 + offset, 150, 20, var1.translateKey("menu.skinCapeSettings.skinCustomization.showOtherCapes") + ": " +
|
||||
(mc.gameSettings.showOtherCapes ? var1.translateKey("options.on") : var1.translateKey("options.off"))));
|
||||
}
|
||||
|
||||
protected void actionPerformed(GuiButton par1GuiButton) {
|
||||
StringTranslate var1 = StringTranslate.getInstance();
|
||||
switch(par1GuiButton.id) {
|
||||
case 0:
|
||||
mc.displayGuiScreen(parent);
|
||||
mc.gameSettings.saveOptions();
|
||||
break;
|
||||
case 1:
|
||||
mc.gameSettings.showSkinJacket = !mc.gameSettings.showSkinJacket;
|
||||
toggleJacket.displayString = var1.translateKey("menu.skinCapeSettings.skinCustomization.jacket") + ": " +
|
||||
(mc.gameSettings.showSkinJacket ? var1.translateKey("options.on") : var1.translateKey("options.off"));
|
||||
break;
|
||||
case 2:
|
||||
mc.gameSettings.showSkinHat = !mc.gameSettings.showSkinHat;
|
||||
toggleHat.displayString = var1.translateKey("menu.skinCapeSettings.skinCustomization.hat") + ": " +
|
||||
(mc.gameSettings.showSkinHat ? var1.translateKey("options.on") : var1.translateKey("options.off"));
|
||||
break;
|
||||
case 3:
|
||||
mc.gameSettings.showSkinLeftArm = !mc.gameSettings.showSkinLeftArm;
|
||||
toggleLeftArm.displayString = var1.translateKey("menu.skinCapeSettings.skinCustomization.leftArm") + ": " +
|
||||
(mc.gameSettings.showSkinLeftArm ? var1.translateKey("options.on") : var1.translateKey("options.off"));
|
||||
break;
|
||||
case 4:
|
||||
mc.gameSettings.showSkinRightArm = !mc.gameSettings.showSkinRightArm;
|
||||
toggleRightArm.displayString = var1.translateKey("menu.skinCapeSettings.skinCustomization.rightArm") + ": " +
|
||||
(mc.gameSettings.showSkinRightArm ? var1.translateKey("options.on") : var1.translateKey("options.off"));
|
||||
break;
|
||||
case 5:
|
||||
mc.gameSettings.showSkinLeftLeg = !mc.gameSettings.showSkinLeftLeg;
|
||||
toggleLeftLeg.displayString = var1.translateKey("menu.skinCapeSettings.skinCustomization.leftPants") + ": " +
|
||||
(mc.gameSettings.showSkinLeftLeg ? var1.translateKey("options.on") : var1.translateKey("options.off"));
|
||||
break;
|
||||
case 6:
|
||||
mc.gameSettings.showSkinRightLeg = !mc.gameSettings.showSkinRightLeg;
|
||||
toggleRightLeg.displayString = var1.translateKey("menu.skinCapeSettings.skinCustomization.rightPants") + ": " +
|
||||
(mc.gameSettings.showSkinRightLeg ? var1.translateKey("options.on") : var1.translateKey("options.off"));
|
||||
break;
|
||||
case 7:
|
||||
mc.gameSettings.showCape = !mc.gameSettings.showCape;
|
||||
toggleCape.displayString = var1.translateKey("menu.skinCapeSettings.skinCustomization.cape") + ": " +
|
||||
(mc.gameSettings.showCape ? var1.translateKey("options.on") : var1.translateKey("options.off"));
|
||||
break;
|
||||
case 8:
|
||||
mc.gameSettings.allowFNAWSkins = !mc.gameSettings.allowFNAWSkins;
|
||||
toggleShowErasers.displayString = mc.gameSettings.allowFNAWSkins ? var1.translateKey("menu.skinCapeSettings.skinCustomization.showErasersOn") :
|
||||
var1.translateKey("menu.skinCapeSettings.skinCustomization.showErasersOff");
|
||||
break;
|
||||
case 9:
|
||||
mc.gameSettings.showOtherCapes = !mc.gameSettings.showOtherCapes;
|
||||
toggleShowOtherCapes.displayString = var1.translateKey("menu.skinCapeSettings.skinCustomization.showOtherCapes") + ": " +
|
||||
(mc.gameSettings.showOtherCapes ? var1.translateKey("options.on") : var1.translateKey("options.off"));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void drawScreen(int mx, int my, float partialTicks) {
|
||||
drawDefaultBackground();
|
||||
|
||||
int offset = MathHelper.clamp_int((height - 300) / 3, -100, 0);
|
||||
|
||||
this.drawCenteredString(this.fontRenderer, skinCustomizationTitle, this.width / 2, 40 + offset, 16777215);
|
||||
this.drawCenteredString(this.fontRenderer, skinCustomizationOtherPlayers, this.width / 2, 170 + offset, 16777215);
|
||||
|
||||
super.drawScreen(mx, my, partialTicks);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -13,7 +13,8 @@ public enum HighPolySkin {
|
|||
new float[] {
|
||||
1.325f
|
||||
},
|
||||
0.0f
|
||||
0.0f,
|
||||
new TextureLocation("/mesh/longarms.fallback.png")
|
||||
),
|
||||
|
||||
WEIRD_CLIMBER_DUDE(
|
||||
|
@ -27,7 +28,8 @@ public enum HighPolySkin {
|
|||
new float[] {
|
||||
2.62f
|
||||
},
|
||||
-90.0f
|
||||
-90.0f,
|
||||
new TextureLocation("/mesh/weirdclimber.fallback.png")
|
||||
),
|
||||
|
||||
LAXATIVE_DUDE(
|
||||
|
@ -42,7 +44,8 @@ public enum HighPolySkin {
|
|||
new float[] {
|
||||
2.04f
|
||||
},
|
||||
0.0f
|
||||
0.0f,
|
||||
new TextureLocation("/mesh/laxativedude.fallback.png")
|
||||
),
|
||||
|
||||
BABY_CHARLES(
|
||||
|
@ -52,7 +55,8 @@ public enum HighPolySkin {
|
|||
new ModelLocation("/mesh/charles2.mdl"),
|
||||
new ModelLocation[] {},
|
||||
new float[] {},
|
||||
0.0f
|
||||
0.0f,
|
||||
new TextureLocation("/mesh/charles.fallback.png")
|
||||
),
|
||||
|
||||
BABY_WINSTON(
|
||||
|
@ -62,7 +66,8 @@ public enum HighPolySkin {
|
|||
new ModelLocation("/mesh/winston1.mdl"),
|
||||
new ModelLocation[] {},
|
||||
new float[] {},
|
||||
0.0f
|
||||
0.0f,
|
||||
new TextureLocation("/mesh/winston.fallback.png")
|
||||
);
|
||||
|
||||
public static float highPolyScale = 0.5f;
|
||||
|
@ -74,9 +79,10 @@ public enum HighPolySkin {
|
|||
public final ModelLocation[] limbsModel;
|
||||
public final float[] limbsOffset;
|
||||
public final float limbsInitialRotation;
|
||||
public final TextureLocation fallbackTexture;
|
||||
|
||||
HighPolySkin(TextureLocation texture, ModelLocation bodyModel, ModelLocation headModel,
|
||||
ModelLocation eyesModel, ModelLocation[] limbsModel, float[] limbsOffset, float limbsInitialRotation) {
|
||||
HighPolySkin(TextureLocation texture, ModelLocation bodyModel, ModelLocation headModel, ModelLocation eyesModel,
|
||||
ModelLocation[] limbsModel, float[] limbsOffset, float limbsInitialRotation, TextureLocation fallbackTexture) {
|
||||
this.texture = texture;
|
||||
this.bodyModel = bodyModel;
|
||||
this.headModel = headModel;
|
||||
|
@ -84,8 +90,7 @@ public enum HighPolySkin {
|
|||
this.limbsModel = limbsModel;
|
||||
this.limbsOffset = limbsOffset;
|
||||
this.limbsInitialRotation = limbsInitialRotation;
|
||||
this.fallbackTexture = fallbackTexture;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -5,10 +5,25 @@ import net.minecraft.src.ModelBiped;
|
|||
import net.minecraft.src.ModelRenderer;
|
||||
|
||||
public class ModelBipedNewSkins extends ModelBiped {
|
||||
/**
|
||||
* left arm
|
||||
*/
|
||||
public ModelRenderer field_178734_a;
|
||||
/**
|
||||
* right arm
|
||||
*/
|
||||
public ModelRenderer field_178732_b;
|
||||
/**
|
||||
* left leg
|
||||
*/
|
||||
public ModelRenderer field_178733_c;
|
||||
/**
|
||||
* right leg
|
||||
*/
|
||||
public ModelRenderer field_178731_d;
|
||||
/**
|
||||
* jacket
|
||||
*/
|
||||
public ModelRenderer field_178730_v;
|
||||
private ModelRenderer field_178729_w;
|
||||
private ModelRenderer field_178736_x;
|
||||
|
|
|
@ -8,6 +8,7 @@ import java.util.List;
|
|||
import net.lax1dude.eaglercraft.DefaultSkinRenderer;
|
||||
import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
import net.lax1dude.eaglercraft.HighPolySkin;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
|
||||
|
||||
|
@ -2170,7 +2171,8 @@ public abstract class EntityLiving extends Entity {
|
|||
private int getArmSwingAnimationEnd() {
|
||||
int ret = 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);
|
||||
if(this instanceof EntityPlayer && DefaultSkinRenderer.isPlayerHighPoly((EntityPlayer)this)) {
|
||||
if(this instanceof EntityPlayer && !((this instanceof EntityClientPlayerMP) && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0)
|
||||
&& DefaultSkinRenderer.isPlayerHighPoly((EntityPlayer)this)) {
|
||||
HighPolySkin msh = DefaultSkinRenderer.defaultHighPoly[DefaultSkinRenderer.getPlayerRenderer((EntityPlayer)this)];
|
||||
if(msh == HighPolySkin.WEIRD_CLIMBER_DUDE) {
|
||||
ret *= 2;
|
||||
|
|
|
@ -172,4 +172,8 @@ public class EntityOtherPlayerMP extends EntityPlayer {
|
|||
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 boolean getHideCape() {
|
||||
return !Minecraft.getMinecraft().gameSettings.showOtherCapes || super.getHideCape();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -125,6 +125,17 @@ public class GameSettings {
|
|||
/** Game settings language */
|
||||
public String language;
|
||||
|
||||
public boolean showSkinJacket = true;
|
||||
public boolean showSkinHat = true;
|
||||
public boolean showSkinLeftArm = true;
|
||||
public boolean showSkinRightArm = true;
|
||||
public boolean showSkinLeftLeg = true;
|
||||
public boolean showSkinRightLeg = true;
|
||||
|
||||
public boolean allowFNAWSkins = true;
|
||||
public boolean showOtherCapes = true;
|
||||
|
||||
|
||||
public GameSettings(Minecraft par1Minecraft) {
|
||||
this.keyBindings = 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.keyBindSprint, this.keyBindZoom, this.keyBindFunction };
|
||||
|
@ -500,6 +511,14 @@ public class GameSettings {
|
|||
if(yee.hasKey("chatWidth")) this.chatWidth = yee.getFloat("chatWidth");
|
||||
if(yee.hasKey("patchAnisotropic")) this.patchAnisotropic = yee.getBoolean("patchAnisotropic");
|
||||
if(yee.hasKey("showCoordinates")) this.showCoordinates = yee.getBoolean("showCoordinates");
|
||||
if(yee.hasKey("showSkinJacket")) showSkinJacket = yee.getBoolean("showSkinJacket");
|
||||
if(yee.hasKey("showSkinHat")) showSkinHat = yee.getBoolean("showSkinHat");
|
||||
if(yee.hasKey("showSkinLeftArm")) showSkinLeftArm = yee.getBoolean("showSkinLeftArm");
|
||||
if(yee.hasKey("showSkinRightArm")) showSkinRightArm = yee.getBoolean("showSkinRightArm");
|
||||
if(yee.hasKey("showSkinLeftLeg")) showSkinLeftLeg = yee.getBoolean("showSkinLeftLeg");
|
||||
if(yee.hasKey("showSkinRightLeg")) showSkinRightLeg = yee.getBoolean("showSkinRightLeg");
|
||||
if(yee.hasKey("allowFNAWSkins")) allowFNAWSkins = yee.getBoolean("allowFNAWSkins");
|
||||
if(yee.hasKey("showOtherCapes")) showOtherCapes = yee.getBoolean("showOtherCapes");
|
||||
|
||||
for (int var4 = 0; var4 < this.keyBindings.length; ++var4) {
|
||||
if(yee.hasKey(keyBindings[var4].keyDescription)) this.keyBindings[var4].keyCode = yee.getInteger(keyBindings[var4].keyDescription);
|
||||
|
@ -554,6 +573,14 @@ public class GameSettings {
|
|||
yee.setFloat("chatWidth", this.chatWidth);
|
||||
yee.setBoolean("patchAnisotropic", this.patchAnisotropic);
|
||||
yee.setBoolean("showCoordinates", this.showCoordinates);
|
||||
yee.setBoolean("showSkinJacket", showSkinJacket);
|
||||
yee.setBoolean("showSkinHat", showSkinHat);
|
||||
yee.setBoolean("showSkinLeftArm", showSkinLeftArm);
|
||||
yee.setBoolean("showSkinRightArm", showSkinRightArm);
|
||||
yee.setBoolean("showSkinLeftLeg", showSkinLeftLeg);
|
||||
yee.setBoolean("showSkinRightLeg", showSkinRightLeg);
|
||||
yee.setBoolean("allowFNAWSkins", allowFNAWSkins);
|
||||
yee.setBoolean("showOtherCapes", showOtherCapes);
|
||||
|
||||
for (int var4 = 0; var4 < this.keyBindings.length; ++var4) {
|
||||
yee.setInteger(keyBindings[var4].keyDescription, keyBindings[var4].keyCode);
|
||||
|
@ -570,8 +597,20 @@ public class GameSettings {
|
|||
public void sendSettingsToServer() {
|
||||
if (this.mc.thePlayer != null) {
|
||||
this.mc.thePlayer.sendQueue.addToSendQueue(new Packet204ClientInfo(this.language, this.renderDistance, this.chatVisibility, this.chatColours, this.difficulty, this.showCape));
|
||||
this.mc.thePlayer.sendQueue.addToSendQueue(new Packet250CustomPayload("EAG|SkinLayers", new byte[] { (byte)getSkinLayers() }));
|
||||
}
|
||||
}
|
||||
|
||||
public int getSkinLayers() {
|
||||
int skinLayersByte = 0;
|
||||
if(showSkinJacket) skinLayersByte |= 1;
|
||||
if(showSkinHat) skinLayersByte |= 2;
|
||||
if(showSkinLeftArm) skinLayersByte |= 4;
|
||||
if(showSkinRightArm) skinLayersByte |= 8;
|
||||
if(showSkinLeftLeg) skinLayersByte |= 16;
|
||||
if(showSkinRightLeg) skinLayersByte |= 32;
|
||||
return skinLayersByte;
|
||||
}
|
||||
|
||||
/**
|
||||
* Should render clouds
|
||||
|
|
|
@ -1,19 +1,15 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import net.lax1dude.eaglercraft.EaglerAdapter;
|
||||
import net.lax1dude.eaglercraft.GuiScreenSkinCapeSettings;
|
||||
import net.lax1dude.eaglercraft.GuiScreenVoiceChannel;
|
||||
|
||||
public class GuiIngameMenu extends GuiScreen {
|
||||
/** Also counts the number of updates, not certain as to why yet. */
|
||||
private int updateCounter2 = 0;
|
||||
|
||||
/** Counts the number of screen updates. */
|
||||
private int updateCounter = 0;
|
||||
|
||||
/**
|
||||
* Adds the buttons (and other controls) to the screen in question.
|
||||
*/
|
||||
public void initGui() {
|
||||
this.updateCounter2 = 0;
|
||||
this.buttonList.clear();
|
||||
byte var1 = -16;
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + var1, StatCollector.translateToLocal("menu.returnToMenu")));
|
||||
|
@ -28,6 +24,7 @@ public class GuiIngameMenu extends GuiScreen {
|
|||
GuiButton var3;
|
||||
this.buttonList.add(var3 = new GuiButton(7, this.width / 2 + 2, this.height / 4 + 96 + var1, 98, 20, StatCollector.translateToLocal("menu.shareToLan")));
|
||||
var3.enabled = false;
|
||||
this.buttonList.add(new GuiButton(8, 3, 3, 120, 20, StatCollector.translateToLocal("menu.skinCapeSettings")));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -60,6 +57,10 @@ public class GuiIngameMenu extends GuiScreen {
|
|||
case 5:
|
||||
this.mc.displayGuiScreen(new GuiScreenVoiceChannel(this));
|
||||
break;
|
||||
|
||||
case 8:
|
||||
this.mc.displayGuiScreen(new GuiScreenSkinCapeSettings(this));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,7 +69,6 @@ public class GuiIngameMenu extends GuiScreen {
|
|||
*/
|
||||
public void updateScreen() {
|
||||
super.updateScreen();
|
||||
++this.updateCounter;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -78,5 +78,15 @@ public class GuiIngameMenu extends GuiScreen {
|
|||
this.drawDefaultBackground();
|
||||
this.drawCenteredString(this.fontRenderer, "Game menu", this.width / 2, 40, 16777215);
|
||||
super.drawScreen(par1, par2, par3);
|
||||
if(par1 >= 3 && par1 < 123 && par2 >= 3 && par2 < 23) {
|
||||
int c = 0xCCCC66;
|
||||
StringTranslate var1 = StringTranslate.getInstance();
|
||||
EaglerAdapter.glPushMatrix();
|
||||
EaglerAdapter.glTranslatef(126.0f, 6.0f, 0.0f);
|
||||
EaglerAdapter.glScalef(0.8f, 0.8f, 0.8f);
|
||||
this.drawString(fontRenderer, var1.translateKey("menu.skinCapeSettingsNote0"), 0, 0, c);
|
||||
this.drawString(fontRenderer, var1.translateKey("menu.skinCapeSettingsNote1"), 0, 9, c);
|
||||
EaglerAdapter.glPopMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1151,6 +1151,21 @@ public class NetClientHandler extends NetHandler {
|
|||
}
|
||||
}else if("EAG|UserSkin".equals(par1Packet250CustomPayload.channel)) {
|
||||
DefaultSkinRenderer.skinResponse(par1Packet250CustomPayload.data);
|
||||
}else if("EAG|SkinLayers".equals(par1Packet250CustomPayload.channel)) {
|
||||
DataInputStream var8 = new DataInputStream(new ByteArrayInputStream(par1Packet250CustomPayload.data));
|
||||
try {
|
||||
int var9 = var8.read();
|
||||
String user = var8.readUTF();
|
||||
EntityPlayer pp = mc.theWorld.getPlayerEntityByName(user);
|
||||
if(pp != null && (pp instanceof EntityOtherPlayerMP)) {
|
||||
byte[] pkt = ((EntityOtherPlayerMP)pp).skinPacket;
|
||||
if(pkt != null) {
|
||||
DefaultSkinRenderer.updateSkinLayerByte(var9, pkt);
|
||||
}
|
||||
}
|
||||
} catch (IOException var7) {
|
||||
var7.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -378,7 +378,21 @@ public abstract class RenderLiving extends Render {
|
|||
EaglerAdapter.glRotatef(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
|
||||
EaglerAdapter.glScalef(-var9, -var9, var9);
|
||||
EaglerAdapter.glDisable(EaglerAdapter.GL_LIGHTING);
|
||||
EaglerAdapter.glTranslatef(0.0F, 0.25F / var9, 0.0F);
|
||||
|
||||
if(par1EntityLiving instanceof EntityOtherPlayerMP) {
|
||||
int renderType = DefaultSkinRenderer.getPlayerRenderer((EntityOtherPlayerMP)par1EntityLiving);
|
||||
if(renderType == 19) {
|
||||
EaglerAdapter.glTranslatef(0.0F, -32.0f, 0.0F);
|
||||
}else if(DefaultSkinRenderer.isHighPoly(renderType) && Minecraft.getMinecraft().gameSettings.allowFNAWSkins) {
|
||||
EaglerAdapter.glTranslatef(0.0F, 7.0f, 0.0F);
|
||||
if(renderType == 37) {
|
||||
EaglerAdapter.glTranslatef(0.0F, 28.0f, 0.0F);
|
||||
}
|
||||
}
|
||||
}else {
|
||||
EaglerAdapter.glTranslatef(0.0F, 0.25F / var9, 0.0F);
|
||||
}
|
||||
|
||||
EaglerAdapter.glDepthMask(false);
|
||||
EaglerAdapter.glEnable(EaglerAdapter.GL_BLEND);
|
||||
EaglerAdapter.glBlendFunc(EaglerAdapter.GL_SRC_ALPHA, EaglerAdapter.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
@ -442,16 +456,23 @@ public abstract class RenderLiving extends Render {
|
|||
Tessellator var15 = Tessellator.instance;
|
||||
byte var16 = 0;
|
||||
|
||||
if (par2Str.equals("deadmau5")) {
|
||||
var16 = -10;
|
||||
}
|
||||
|
||||
//if (par2Str.equals("deadmau5")) {
|
||||
// var16 = -10;
|
||||
//}
|
||||
|
||||
if(par1EntityLiving instanceof EntityOtherPlayerMP) {
|
||||
if(DefaultSkinRenderer.getPlayerRenderer((EntityOtherPlayerMP)par1EntityLiving) == 19) {
|
||||
var16 = -32;
|
||||
if(((EntityOtherPlayerMP)par1EntityLiving).isPlayerSleeping()) {
|
||||
var16 = -60;
|
||||
}else {
|
||||
int renderType = DefaultSkinRenderer.getPlayerRenderer((EntityOtherPlayerMP)par1EntityLiving);
|
||||
if(renderType == 19) {
|
||||
var16 = -32;
|
||||
}else if(renderType == 37 && Minecraft.getMinecraft().gameSettings.allowFNAWSkins) {
|
||||
var16 = 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
EaglerAdapter.glDisable(EaglerAdapter.GL_TEXTURE_2D);
|
||||
EaglerAdapter.glDisable(EaglerAdapter.GL_ALPHA_TEST);
|
||||
var15.startDrawingQuads();
|
||||
|
|
|
@ -112,7 +112,9 @@ public class RenderPlayer extends RenderLiving {
|
|||
private final Matrix4f tmpMatrix = new Matrix4f();
|
||||
|
||||
public void renderPlayer(EntityPlayer par1EntityPlayer, double par2, double par4, double par6, float par8, float par9) {
|
||||
if(DefaultSkinRenderer.isPlayerHighPoly(par1EntityPlayer)) {
|
||||
boolean isHiPoly = DefaultSkinRenderer.isPlayerHighPoly(par1EntityPlayer);
|
||||
boolean fnawEnabled = Minecraft.getMinecraft().gameSettings.allowFNAWSkins;
|
||||
if(isHiPoly && fnawEnabled) {
|
||||
HighPolySkin msh = DefaultSkinRenderer.defaultHighPoly[DefaultSkinRenderer.getPlayerRenderer(par1EntityPlayer)];
|
||||
EaglerAdapter.flipLightMatrix();
|
||||
EaglerAdapter.glPushMatrix();
|
||||
|
@ -296,6 +298,7 @@ public class RenderPlayer extends RenderLiving {
|
|||
// shear matrix
|
||||
tmpMatrix.setIdentity();
|
||||
tmpMatrix.m21 = swing2;
|
||||
tmpMatrix.m23 = swing2 * -0.2f;
|
||||
EaglerAdapter.glMultMatrixf(tmpMatrix);
|
||||
}
|
||||
|
||||
|
@ -310,13 +313,15 @@ public class RenderPlayer extends RenderLiving {
|
|||
if(i == 0) {
|
||||
EaglerAdapter.glPushMatrix();
|
||||
EaglerAdapter.flipLightMatrix();
|
||||
|
||||
EaglerAdapter.glTranslatef(-0.287f, 0.05f, 0.0f);
|
||||
|
||||
if(msh == HighPolySkin.LONG_ARMS) {
|
||||
EaglerAdapter.glTranslatef(1.72f, 2.05f, -0.24f);
|
||||
ItemStack stk = par1EntityPlayer.getHeldItem();
|
||||
if(stk != null) {
|
||||
if(stk.itemID == Item.bow.itemID) {
|
||||
EaglerAdapter.glTranslatef(-0.22f, 0.9f, 0.7f);
|
||||
EaglerAdapter.glTranslatef(-0.22f, 0.8f, 0.6f);
|
||||
EaglerAdapter.glRotatef(-90.0f, 1.0f, 0.0f, 0.0f);
|
||||
}else if(stk.itemID < 256 && !(Item.itemsList[stk.itemID] != null && Item.itemsList[stk.itemID] instanceof ItemBlock &&
|
||||
!Block.blocksList[((ItemBlock)Item.itemsList[stk.itemID]).getBlockID()].renderAsNormalBlock())) {
|
||||
|
@ -419,7 +424,7 @@ public class RenderPlayer extends RenderLiving {
|
|||
EaglerAdapter.glPopMatrix();
|
||||
EaglerAdapter.flipLightMatrix();
|
||||
passSpecialRender(par1EntityPlayer, par2, par4, par6);
|
||||
}else if(DefaultSkinRenderer.isPlayerStandard(par1EntityPlayer)) {
|
||||
}else if(DefaultSkinRenderer.isPlayerStandard(par1EntityPlayer) || (isHiPoly && !fnawEnabled)) {
|
||||
float var10 = 1.0F;
|
||||
EaglerAdapter.glColor3f(var10, var10, var10);
|
||||
ItemStack var11 = par1EntityPlayer.inventory.getCurrentItem();
|
||||
|
@ -442,7 +447,17 @@ public class RenderPlayer extends RenderLiving {
|
|||
var14 -= 0.125D;
|
||||
}
|
||||
|
||||
this.mainModel = (DefaultSkinRenderer.isPlayerNewSkin(par1EntityPlayer) ? (DefaultSkinRenderer.isPlayerNewSkinSlim(par1EntityPlayer) ? this.modelBipedMainNewSkinSlim : this.modelBipedMainNewSkin) : this.modelBipedMain);
|
||||
this.mainModel = ((!isHiPoly && DefaultSkinRenderer.isPlayerNewSkin(par1EntityPlayer)) ? (DefaultSkinRenderer.isPlayerNewSkinSlim(par1EntityPlayer) ? this.modelBipedMainNewSkinSlim : this.modelBipedMainNewSkin) : this.modelBipedMain);
|
||||
int skinLayersByte = DefaultSkinRenderer.getSkinLayerByte(par1EntityPlayer);
|
||||
if(this.mainModel instanceof ModelBipedNewSkins) {
|
||||
ModelBipedNewSkins md = (ModelBipedNewSkins)this.mainModel;
|
||||
md.field_178730_v.isHidden = (skinLayersByte & 1) != 1;
|
||||
md.field_178734_a.isHidden = (skinLayersByte & 4) != 4;
|
||||
md.field_178732_b.isHidden = (skinLayersByte & 8) != 8;
|
||||
md.field_178733_c.isHidden = (skinLayersByte & 16) != 16;
|
||||
md.field_178731_d.isHidden = (skinLayersByte & 32) != 32;
|
||||
}
|
||||
((ModelBiped)this.mainModel).bipedHeadwear.isHidden = isHiPoly || (skinLayersByte & 2) != 2;
|
||||
this.mainModel.isChild = false;
|
||||
((ModelBiped)this.mainModel).blockTransparentSkin = true;
|
||||
super.doRenderLiving(par1EntityPlayer, par2, var14, par6, par8, par9);
|
||||
|
@ -548,8 +563,9 @@ public class RenderPlayer extends RenderLiving {
|
|||
boolean isNew = DefaultSkinRenderer.isPlayerNewSkin(par1EntityPlayer);
|
||||
boolean isSlim = DefaultSkinRenderer.isPlayerNewSkinSlim(par1EntityPlayer);
|
||||
int renderType = DefaultSkinRenderer.getPlayerRenderer(par1EntityPlayer);
|
||||
boolean allowFNAW = Minecraft.getMinecraft().gameSettings.allowFNAWSkins;
|
||||
|
||||
if(!DefaultSkinRenderer.isPlayerHighPoly(par1EntityPlayer)) {
|
||||
if(!allowFNAW || !DefaultSkinRenderer.isHighPoly(renderType)) {
|
||||
if (var4 != null) {
|
||||
EaglerAdapter.glPushMatrix();
|
||||
(isNew ? (isSlim ? this.modelBipedMainNewSkinSlim : this.modelBipedMainNewSkin) : this.modelBipedMain).bipedHead.postRender(0.0625F);
|
||||
|
@ -605,7 +621,7 @@ public class RenderPlayer extends RenderLiving {
|
|||
|
||||
float var11;
|
||||
|
||||
if(DefaultSkinRenderer.isStandardModel(renderType) || DefaultSkinRenderer.isZombieModel(renderType)) {
|
||||
if(DefaultSkinRenderer.isStandardModel(renderType) || DefaultSkinRenderer.isZombieModel(renderType) || (!allowFNAW && DefaultSkinRenderer.isHighPoly(renderType))) {
|
||||
if(!par1EntityPlayer.isInvisible() && !par1EntityPlayer.getHideCape()) {
|
||||
if(DefaultSkinRenderer.bindSyncedCape(par1EntityPlayer)) {
|
||||
EaglerAdapter.glPushMatrix();
|
||||
|
@ -662,10 +678,12 @@ public class RenderPlayer extends RenderLiving {
|
|||
if (var22 != null) {
|
||||
EaglerAdapter.glPushMatrix();
|
||||
|
||||
if(DefaultSkinRenderer.isZombieModel(renderType) || renderType == 20) {
|
||||
((ModelBiped)this.mainModel).bipedRightArm.postRender(0.0625F);
|
||||
}else {
|
||||
(isNew ? (isSlim ? this.modelBipedMainNewSkinSlim : this.modelBipedMainNewSkin) : this.modelBipedMain).bipedRightArm.postRender(0.0625F);
|
||||
if(!allowFNAW || !DefaultSkinRenderer.isHighPoly(renderType)) {
|
||||
if(DefaultSkinRenderer.isZombieModel(renderType) || renderType == 20) {
|
||||
((ModelBiped)this.mainModel).bipedRightArm.postRender(0.0625F);
|
||||
}else {
|
||||
(isNew ? (isSlim ? this.modelBipedMainNewSkinSlim : this.modelBipedMainNewSkin) : this.modelBipedMain).bipedRightArm.postRender(0.0625F);
|
||||
}
|
||||
}
|
||||
|
||||
EaglerAdapter.glTranslatef(-0.0625F, 0.4375F, 0.0625F);
|
||||
|
@ -787,6 +805,13 @@ public class RenderPlayer extends RenderLiving {
|
|||
(isNew ? (isSlim ? this.modelBipedMainNewSkinSlim : this.modelBipedMainNewSkin) : this.modelBipedMain).onGround = 0.0F;
|
||||
(isNew ? (isSlim ? this.modelBipedMainNewSkinSlim : this.modelBipedMainNewSkin) : this.modelBipedMain).setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, par1EntityPlayer);
|
||||
(isNew ? (isSlim ? this.modelBipedMainNewSkinSlim : this.modelBipedMainNewSkin) : this.modelBipedMain).bipedRightArm.render(0.0625F);
|
||||
if(isNew) {
|
||||
ModelBipedNewSkins mdl = (ModelBipedNewSkins)(isSlim ? this.modelBipedMainNewSkinSlim : this.modelBipedMainNewSkin);
|
||||
mdl.field_178732_b.isHidden = !Minecraft.getMinecraft().gameSettings.showSkinRightArm;
|
||||
if(!mdl.field_178732_b.isHidden) {
|
||||
mdl.field_178732_b.render(0.0625F);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -844,7 +869,8 @@ public class RenderPlayer extends RenderLiving {
|
|||
if(!renderPass2) {
|
||||
EntityPlayer p = (EntityPlayer) par1EntityLiving;
|
||||
int renderType = DefaultSkinRenderer.getPlayerRenderer(p);
|
||||
if(DefaultSkinRenderer.isPlayerStandard(p) || DefaultSkinRenderer.isZombieModel(renderType) || renderType == 20) {
|
||||
if(DefaultSkinRenderer.isPlayerStandard(p) || DefaultSkinRenderer.isZombieModel(renderType) || renderType == 20 ||
|
||||
(DefaultSkinRenderer.isHighPoly(renderType) && !Minecraft.getMinecraft().gameSettings.allowFNAWSkins)) {
|
||||
this.renderSpecials(p, par2);
|
||||
}else {
|
||||
if(renderType == 19) {
|
||||
|
@ -915,7 +941,11 @@ public class RenderPlayer extends RenderLiving {
|
|||
if(DefaultSkinRenderer.defaultHighPoly[EaglerProfile.presetSkinId] == null) {
|
||||
tx = entityTexture;
|
||||
}else {
|
||||
tx = DefaultSkinRenderer.defaultHighPoly[EaglerProfile.presetSkinId].texture;
|
||||
if(Minecraft.getMinecraft().gameSettings.allowFNAWSkins) {
|
||||
tx = DefaultSkinRenderer.defaultHighPoly[EaglerProfile.presetSkinId].texture;
|
||||
}else {
|
||||
tx = DefaultSkinRenderer.defaultHighPoly[EaglerProfile.presetSkinId].fallbackTexture;
|
||||
}
|
||||
}
|
||||
}else {
|
||||
tx = DefaultSkinRenderer.defaultVanillaSkins[EaglerProfile.presetSkinId];
|
||||
|
|
|
@ -3043,7 +3043,7 @@ public abstract class World implements IBlockAccess {
|
|||
*/
|
||||
public EntityPlayer getPlayerEntityByName(String par1Str) {
|
||||
for (int var2 = 0; var2 < this.playerEntities.size(); ++var2) {
|
||||
if (par1Str.equals(((EntityPlayer) this.playerEntities.get(var2)).username)) {
|
||||
if (par1Str.equalsIgnoreCase(((EntityPlayer) this.playerEntities.get(var2)).username)) {
|
||||
return (EntityPlayer) this.playerEntities.get(var2);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user