mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-26 06:18:00 +01:00
Fix flight and skins' bimap crash
This commit is contained in:
parent
1dc6f0a99b
commit
963a5e5a73
4 changed files with 10 additions and 10 deletions
|
@ -348,6 +348,8 @@ public class Pony {
|
||||||
return pegasusFlying = false;
|
return pegasusFlying = false;
|
||||||
} else if (isJumping) {
|
} else if (isJumping) {
|
||||||
return true;
|
return true;
|
||||||
|
} else if (onGround) {
|
||||||
|
return false;
|
||||||
} else {
|
} else {
|
||||||
boolean falling = fallDistance > 0;
|
boolean falling = fallDistance > 0;
|
||||||
boolean levitating = fallDistance == this.previousFallDistance;
|
boolean levitating = fallDistance == this.previousFallDistance;
|
||||||
|
|
|
@ -64,7 +64,6 @@ public class pm_Human extends ModelPony {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderDrop(RenderManager rendermanager, ItemRenderer itemrenderer, EntityLivingBase entity) {
|
public void renderDrop(RenderManager rendermanager, ItemRenderer itemrenderer, EntityLivingBase entity) {
|
||||||
this.renderDrop(itemrenderer, entity, this.bipedRightArm, 1.0F, -0.0625F, 0.4375F, 0.0625F);
|
this.renderDrop(itemrenderer, entity, this.bipedRightArm, 1.0F, -0.0625F, 0.4375F, 0.0625F);
|
||||||
|
|
|
@ -3,7 +3,6 @@ package com.voxelmodpack.hdskins;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
@ -13,8 +12,7 @@ import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
|
|
||||||
import com.google.common.cache.Cache;
|
import com.google.common.cache.Cache;
|
||||||
import com.google.common.collect.BiMap;
|
import com.google.common.collect.Maps;
|
||||||
import com.google.common.collect.HashBiMap;
|
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
import com.mojang.authlib.minecraft.InsecureTextureException;
|
import com.mojang.authlib.minecraft.InsecureTextureException;
|
||||||
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
|
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
|
||||||
|
@ -39,8 +37,8 @@ public final class HDSkinManager {
|
||||||
private static String gatewayUrl = "skinmanager.voxelmodpack.com";
|
private static String gatewayUrl = "skinmanager.voxelmodpack.com";
|
||||||
private static String skinUrl = "skins.voxelmodpack.com";
|
private static String skinUrl = "skins.voxelmodpack.com";
|
||||||
private static Cache<GameProfile, Map<Type, MinecraftProfileTexture>> skinsCache;
|
private static Cache<GameProfile, Map<Type, MinecraftProfileTexture>> skinsCache;
|
||||||
private static final BiMap<String, String> playerHashes = HashBiMap.create();
|
private static final Map<String, String> playerHashes = Maps.newHashMap();
|
||||||
private static final Map<String, Map<Type, MinecraftProfileTexture>> cachedTextures = new HashMap<String, Map<Type, MinecraftProfileTexture>>();
|
private static final Map<String, Map<Type, MinecraftProfileTexture>> cachedTextures = Maps.newHashMap();
|
||||||
|
|
||||||
public static void onDownloadSkin(EventInfo<ThreadDownloadImageData> e) {
|
public static void onDownloadSkin(EventInfo<ThreadDownloadImageData> e) {
|
||||||
ThreadDownloadImageData imageDownload = e.getSource();
|
ThreadDownloadImageData imageDownload = e.getSource();
|
||||||
|
@ -116,15 +114,16 @@ public final class HDSkinManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String findUUID(GameProfile profile, Map<?, MinecraftProfileTexture> textures, String hash) {
|
private static String findUUID(GameProfile profile, Map<?, MinecraftProfileTexture> textures, String hash) {
|
||||||
|
String uuid = playerHashes.get(hash);
|
||||||
for (MinecraftProfileTexture texture : textures.values()) {
|
for (MinecraftProfileTexture texture : textures.values()) {
|
||||||
if (hash.equals(texture.getHash())) {
|
if (hash.equals(texture.getHash())) {
|
||||||
String uuid = trimUUID(profile.getId());
|
uuid = trimUUID(profile.getId());
|
||||||
playerHashes.put(hash, uuid);
|
playerHashes.put(hash, uuid);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
return uuid;
|
return uuid;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void storeTexturesForProfile(GameProfile profile, Map<Type, MinecraftProfileTexture> textures) {
|
private static void storeTexturesForProfile(GameProfile profile, Map<Type, MinecraftProfileTexture> textures) {
|
||||||
Map<?, ?> cached = getCachedTexturesForId(trimUUID(profile.getId()));
|
Map<?, ?> cached = getCachedTexturesForId(trimUUID(profile.getId()));
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"name": "minelp",
|
"name": "minelp",
|
||||||
"mcversion": "1.8",
|
"mcversion": "1.8",
|
||||||
"version": "1.8-UNOFFICIAL",
|
"version": "1.8-UNOFFICIAL",
|
||||||
"revision": "185.16",
|
"revision": "185.18",
|
||||||
"author": "Verdana, Rene_Z, Mumfrey, JoyJoy",
|
"author": "Verdana, Rene_Z, Mumfrey, JoyJoy",
|
||||||
"voxelCommonJarName": "voxelcommon-2.4.0.jar",
|
"voxelCommonJarName": "voxelcommon-2.4.0.jar",
|
||||||
"classTransformerClasses": "com.minelittlepony.minelp.transformers.RenderPlayerTransformer",
|
"classTransformerClasses": "com.minelittlepony.minelp.transformers.RenderPlayerTransformer",
|
||||||
|
|
Loading…
Reference in a new issue