mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-12-02 00:37:59 +01:00
The problem childs
This commit is contained in:
parent
e6f5d3caa6
commit
bf83ff68ae
19 changed files with 389 additions and 353 deletions
|
@ -123,7 +123,7 @@ public final class HDSkinManager implements IResourceManagerReloadListener {
|
|||
return Optional.empty();
|
||||
}
|
||||
|
||||
ResourceLocation skin = this.resources.getPlayerTexture(profile1, type);
|
||||
ResourceLocation skin = resources.getPlayerTexture(profile1, type);
|
||||
if (skin != null) {
|
||||
return Optional.of(skin);
|
||||
}
|
||||
|
@ -156,11 +156,11 @@ public final class HDSkinManager implements IResourceManagerReloadListener {
|
|||
return Optional.empty();
|
||||
}
|
||||
|
||||
if (!this.skinCache.containsKey(profile.getId())) {
|
||||
this.skinCache.put(profile.getId(), Maps.newHashMap());
|
||||
if (!skinCache.containsKey(profile.getId())) {
|
||||
skinCache.put(profile.getId(), Maps.newHashMap());
|
||||
}
|
||||
|
||||
skin = this.skinCache.get(profile.getId()).get(type);
|
||||
skin = skinCache.get(profile.getId()).get(type);
|
||||
if (skin == null) {
|
||||
if (loadIfAbsent && getProfileData(profile).containsKey(type)) {
|
||||
skinCache.get(profile.getId()).put(type, LOADING);
|
||||
|
@ -189,24 +189,24 @@ public final class HDSkinManager implements IResourceManagerReloadListener {
|
|||
ITextureObject texObject = new ThreadDownloadImageETag(file2, bustCache(texture.getUrl()),
|
||||
DefaultPlayerSkin.getDefaultSkinLegacy(),
|
||||
new IImageBuffer() {
|
||||
@Nonnull
|
||||
@Override
|
||||
public BufferedImage parseUserSkin(@Nonnull BufferedImage image) {
|
||||
BufferedImage image1 = image;
|
||||
if (imagebufferdownload != null) {
|
||||
image1 = imagebufferdownload.parseUserSkin(image);
|
||||
}
|
||||
return image1 == null ? image : image1;
|
||||
}
|
||||
@Nonnull
|
||||
@Override
|
||||
public BufferedImage parseUserSkin(@Nonnull BufferedImage image) {
|
||||
BufferedImage image1 = image;
|
||||
if (imagebufferdownload != null) {
|
||||
image1 = imagebufferdownload.parseUserSkin(image);
|
||||
}
|
||||
return image1 == null ? image : image1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void skinAvailable() {
|
||||
if (imagebufferdownload != null) {
|
||||
imagebufferdownload.skinAvailable();
|
||||
}
|
||||
callback.skinAvailable(type, skin, texture);
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void skinAvailable() {
|
||||
if (imagebufferdownload != null) {
|
||||
imagebufferdownload.skinAvailable();
|
||||
}
|
||||
callback.skinAvailable(type, skin, texture);
|
||||
}
|
||||
});
|
||||
|
||||
// schedule texture loading on the main thread.
|
||||
TextureLoader.loadTexture(skin, texObject);
|
||||
|
@ -243,20 +243,20 @@ public final class HDSkinManager implements IResourceManagerReloadListener {
|
|||
if (st == null) {
|
||||
throw new IllegalArgumentException("class is not annotated with @ServerType");
|
||||
}
|
||||
this.skinServerTypes.put(st.value(), type);
|
||||
skinServerTypes.put(st.value(), type);
|
||||
}
|
||||
|
||||
public Class<? extends SkinServer> getSkinServerClass(String type) {
|
||||
return this.skinServerTypes.get(type);
|
||||
return skinServerTypes.get(type);
|
||||
}
|
||||
|
||||
public void addSkinServer(SkinServer skinServer) {
|
||||
this.skinServers.add(skinServer);
|
||||
skinServers.add(skinServer);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public SkinServer getGatewayServer() {
|
||||
return this.skinServers.get(0);
|
||||
return skinServers.get(0);
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
|
@ -279,8 +279,8 @@ public final class HDSkinManager implements IResourceManagerReloadListener {
|
|||
FileUtils.deleteDirectory(new File(LiteLoader.getAssetsDirectory(), "hd"));
|
||||
TextureManager textures = Minecraft.getMinecraft().getTextureManager();
|
||||
INSTANCE.skinCache.values().stream()
|
||||
.flatMap(m -> m.values().stream())
|
||||
.forEach(textures::deleteTexture);
|
||||
.flatMap(m -> m.values().stream())
|
||||
.forEach(textures::deleteTexture);
|
||||
INSTANCE.skinCache.clear();
|
||||
INSTANCE.skins.invalidateAll();
|
||||
} catch (IOException var1) {
|
||||
|
@ -319,6 +319,6 @@ public final class HDSkinManager implements IResourceManagerReloadListener {
|
|||
|
||||
@Override
|
||||
public void onResourceManagerReload(IResourceManager resourceManager) {
|
||||
this.resources.onResourceManagerReload(resourceManager);
|
||||
resources.onResourceManagerReload(resourceManager);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,14 +96,14 @@ public class GuiSkins extends GuiScreen {
|
|||
// this.screenTitle = manager;
|
||||
GameProfile profile = minecraft.getSession().getProfile();
|
||||
|
||||
this.localPlayer = getModel(profile);
|
||||
this.remotePlayer = getModel(profile);
|
||||
localPlayer = getModel(profile);
|
||||
remotePlayer = getModel(profile);
|
||||
RenderManager rm = Minecraft.getMinecraft().getRenderManager();
|
||||
rm.renderEngine = minecraft.getTextureManager();
|
||||
rm.options = minecraft.gameSettings;
|
||||
rm.renderViewEntity = this.localPlayer;
|
||||
this.reloadRemoteSkin();
|
||||
this.fetchingSkin = true;
|
||||
rm.renderViewEntity = localPlayer;
|
||||
reloadRemoteSkin();
|
||||
fetchingSkin = true;
|
||||
|
||||
instance = this;
|
||||
|
||||
|
@ -127,40 +127,40 @@ public class GuiSkins extends GuiScreen {
|
|||
}
|
||||
panorama.update();
|
||||
|
||||
this.localPlayer.updateModel();
|
||||
this.remotePlayer.updateModel();
|
||||
if (this.fetchingSkin && this.remotePlayer.isTextureSetupComplete()) {
|
||||
this.fetchingSkin = false;
|
||||
this.btnClear.enabled = true;
|
||||
localPlayer.updateModel();
|
||||
remotePlayer.updateModel();
|
||||
if (fetchingSkin && remotePlayer.isTextureSetupComplete()) {
|
||||
fetchingSkin = false;
|
||||
btnClear.enabled = true;
|
||||
}
|
||||
|
||||
synchronized (this.skinLock) {
|
||||
if (this.pendingSkinFile != null) {
|
||||
System.out.println("Set " + textureType + " " + this.pendingSkinFile);
|
||||
this.localPlayer.setLocalTexture(this.pendingSkinFile, textureType);
|
||||
this.selectedSkin = this.pendingSkinFile;
|
||||
this.pendingSkinFile = null;
|
||||
this.onSetLocalSkin(textureType);
|
||||
this.btnUpload.enabled = true;
|
||||
synchronized (skinLock) {
|
||||
if (pendingSkinFile != null) {
|
||||
System.out.println("Set " + textureType + " " + pendingSkinFile);
|
||||
localPlayer.setLocalTexture(pendingSkinFile, textureType);
|
||||
selectedSkin = pendingSkinFile;
|
||||
pendingSkinFile = null;
|
||||
onSetLocalSkin(textureType);
|
||||
btnUpload.enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.pendingRemoteSkinRefresh) {
|
||||
this.pendingRemoteSkinRefresh = false;
|
||||
this.fetchingSkin = true;
|
||||
this.btnClear.enabled = false;
|
||||
this.reloadRemoteSkin();
|
||||
if (pendingRemoteSkinRefresh) {
|
||||
pendingRemoteSkinRefresh = false;
|
||||
fetchingSkin = true;
|
||||
btnClear.enabled = false;
|
||||
reloadRemoteSkin();
|
||||
}
|
||||
|
||||
if (this.throttledByMojang) {
|
||||
if (this.refreshCounter == -1) {
|
||||
this.refreshCounter = 200;
|
||||
} else if (this.refreshCounter > 0) {
|
||||
--this.refreshCounter;
|
||||
if (throttledByMojang) {
|
||||
if (refreshCounter == -1) {
|
||||
refreshCounter = 200;
|
||||
} else if (refreshCounter > 0) {
|
||||
--refreshCounter;
|
||||
} else {
|
||||
this.refreshCounter = -1;
|
||||
this.throttledByMojang = false;
|
||||
this.reloadRemoteSkin();
|
||||
refreshCounter = -1;
|
||||
throttledByMojang = false;
|
||||
reloadRemoteSkin();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -174,10 +174,10 @@ public class GuiSkins extends GuiScreen {
|
|||
|
||||
private void reloadRemoteSkin() {
|
||||
try {
|
||||
this.remotePlayer.reloadRemoteSkin(this::onSetRemoteSkin);
|
||||
remotePlayer.reloadRemoteSkin(this::onSetRemoteSkin);
|
||||
} catch (Exception var2) {
|
||||
var2.printStackTrace();
|
||||
this.throttledByMojang = true;
|
||||
throttledByMojang = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -188,28 +188,28 @@ public class GuiSkins extends GuiScreen {
|
|||
|
||||
panorama.init();
|
||||
|
||||
this.buttonList.clear();
|
||||
this.buttonList.add(this.btnBrowse = new GuiButton(0, 30, this.height - 36, 60, 20, "Browse..."));
|
||||
this.buttonList.add(this.btnUpload = new GuiButton(1, this.width / 2 - 24, this.height / 2 - 10, 48, 20, ">>"));
|
||||
this.buttonList.add(this.btnClear = new GuiButton(2, this.width - 90, this.height - 36, 60, 20, "Clear"));
|
||||
this.buttonList.add(this.btnBack = new GuiButton(3, this.width / 2 - 50, this.height - 36, 100, 20, "Close"));
|
||||
buttonList.clear();
|
||||
buttonList.add(btnBrowse = new GuiButton(0, 30, height - 36, 60, 20, "Browse..."));
|
||||
buttonList.add(btnUpload = new GuiButton(1, width / 2 - 24, height / 2 - 10, 48, 20, ">>"));
|
||||
buttonList.add(btnClear = new GuiButton(2, width - 90, height - 36, 60, 20, "Clear"));
|
||||
buttonList.add(btnBack = new GuiButton(3, width / 2 - 50, height - 36, 100, 20, "Close"));
|
||||
|
||||
ItemStack skin = new ItemStack(Items.LEATHER_LEGGINGS);
|
||||
Items.LEATHER_LEGGINGS.setColor(skin, 0x3c5dcb);
|
||||
this.buttonList.add(this.btnModeSkin = new GuiItemStackButton(4, 2, 2, skin));
|
||||
buttonList.add(btnModeSkin = new GuiItemStackButton(4, 2, 2, skin));
|
||||
skin = new ItemStack(Items.LEATHER_LEGGINGS);
|
||||
Items.LEATHER_LEGGINGS.setColor(skin, 0xfff500);
|
||||
this.buttonList.add(this.btnModeElytra = new GuiItemStackButton(5, 2, 52, new ItemStack(Items.ELYTRA)));
|
||||
this.buttonList.add(this.btnModeSkinnySkin = new GuiItemStackButton(6, 2, 21, skin));
|
||||
buttonList.add(btnModeElytra = new GuiItemStackButton(5, 2, 52, new ItemStack(Items.ELYTRA)));
|
||||
buttonList.add(btnModeSkinnySkin = new GuiItemStackButton(6, 2, 21, skin));
|
||||
|
||||
this.buttonList.add(this.btnAbout = new GuiButton(-1, this.width - 25, this.height - 25, 20, 20, "?"));
|
||||
buttonList.add(btnAbout = new GuiButton(-1, width - 25, height - 25, 20, 20, "?"));
|
||||
|
||||
this.btnUpload.enabled = false;
|
||||
this.btnBrowse.enabled = !this.mc.isFullScreen();
|
||||
btnUpload.enabled = false;
|
||||
btnBrowse.enabled = !mc.isFullScreen();
|
||||
|
||||
this.btnModeSkin.enabled = this.thinArmType;
|
||||
this.btnModeSkinnySkin.enabled = !this.thinArmType;
|
||||
this.btnModeElytra.enabled = this.textureType == SKIN;
|
||||
btnModeSkin.enabled = thinArmType;
|
||||
btnModeSkinnySkin.enabled = !thinArmType;
|
||||
btnModeElytra.enabled = textureType == SKIN;
|
||||
|
||||
}
|
||||
|
||||
|
@ -230,107 +230,107 @@ public class GuiSkins extends GuiScreen {
|
|||
}
|
||||
|
||||
private void onFileOpenDialogClosed(JFileChooser fileDialog, int dialogResult) {
|
||||
this.openFileThread = null;
|
||||
this.btnBrowse.enabled = true;
|
||||
openFileThread = null;
|
||||
btnBrowse.enabled = true;
|
||||
if (dialogResult == 0) {
|
||||
this.loadLocalFile(fileDialog.getSelectedFile());
|
||||
loadLocalFile(fileDialog.getSelectedFile());
|
||||
}
|
||||
}
|
||||
|
||||
private void loadLocalFile(File skinFile) {
|
||||
Minecraft.getMinecraft().addScheduledTask(localPlayer::releaseTextures);
|
||||
if (!skinFile.exists()) {
|
||||
this.skinMessage = I18n.format("hdskins.error.unreadable");
|
||||
skinMessage = I18n.format("hdskins.error.unreadable");
|
||||
} else if (!FilenameUtils.isExtension(skinFile.getName(), new String[]{"png", "PNG"})) {
|
||||
this.skinMessage = I18n.format("hdskins.error.ext");
|
||||
skinMessage = I18n.format("hdskins.error.ext");
|
||||
} else {
|
||||
BufferedImage chosenImage;
|
||||
try {
|
||||
chosenImage = ImageIO.read(skinFile);
|
||||
} catch (IOException var6) {
|
||||
this.skinMessage = I18n.format("hdskins.error.open");
|
||||
skinMessage = I18n.format("hdskins.error.open");
|
||||
var6.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
if (chosenImage == null) {
|
||||
this.skinMessage = I18n.format("hdskins.error.open");
|
||||
skinMessage = I18n.format("hdskins.error.open");
|
||||
} else if (isPowerOfTwo(chosenImage.getWidth())
|
||||
&& (chosenImage.getWidth() == chosenImage.getHeight() * 2
|
||||
|| chosenImage.getWidth() == chosenImage.getHeight())
|
||||
&& chosenImage.getWidth() <= MAX_SKIN_DIMENSION
|
||||
&& chosenImage.getHeight() <= MAX_SKIN_DIMENSION) {
|
||||
synchronized (this.skinLock) {
|
||||
this.pendingSkinFile = skinFile;
|
||||
synchronized (skinLock) {
|
||||
pendingSkinFile = skinFile;
|
||||
}
|
||||
} else {
|
||||
this.skinMessage = I18n.format("hdskins.error.invalid");
|
||||
skinMessage = I18n.format("hdskins.error.invalid");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton guiButton) {
|
||||
if (this.openFileThread == null && !this.uploadingSkin) {
|
||||
if (this.uploadError != null) {
|
||||
this.uploadError = null;
|
||||
if (openFileThread == null && !uploadingSkin) {
|
||||
if (uploadError != null) {
|
||||
uploadError = null;
|
||||
} else {
|
||||
if (guiButton.id == this.btnBrowse.id) {
|
||||
this.selectedSkin = null;
|
||||
this.localPlayer.releaseTextures();
|
||||
this.openFileThread = new ThreadOpenFilePNG(this.mc, I18n.format("hdskins.open.title"), this::onFileOpenDialogClosed);
|
||||
this.openFileThread.start();
|
||||
if (guiButton.id == btnBrowse.id) {
|
||||
selectedSkin = null;
|
||||
localPlayer.releaseTextures();
|
||||
openFileThread = new ThreadOpenFilePNG(mc, I18n.format("hdskins.open.title"), this::onFileOpenDialogClosed);
|
||||
openFileThread.start();
|
||||
guiButton.enabled = false;
|
||||
}
|
||||
|
||||
if (guiButton.id == this.btnUpload.id) {
|
||||
if (this.selectedSkin != null) {
|
||||
this.uploadSkin(this.mc.getSession(), this.selectedSkin);
|
||||
this.btnUpload.enabled = false;
|
||||
if (guiButton.id == btnUpload.id) {
|
||||
if (selectedSkin != null) {
|
||||
uploadSkin(mc.getSession(), selectedSkin);
|
||||
btnUpload.enabled = false;
|
||||
} else {
|
||||
this.setUploadError(I18n.format("hdskins.error.select"));
|
||||
setUploadError(I18n.format("hdskins.error.select"));
|
||||
}
|
||||
}
|
||||
|
||||
if (guiButton.id == this.btnClear.id && this.remotePlayer.isTextureSetupComplete()) {
|
||||
this.clearUploadedSkin(this.mc.getSession());
|
||||
this.btnUpload.enabled = this.selectedSkin != null;
|
||||
if (guiButton.id == btnClear.id && remotePlayer.isTextureSetupComplete()) {
|
||||
clearUploadedSkin(mc.getSession());
|
||||
btnUpload.enabled = selectedSkin != null;
|
||||
}
|
||||
|
||||
if (guiButton.id == this.btnBack.id) {
|
||||
this.mc.displayGuiScreen(new GuiMainMenu());
|
||||
if (guiButton.id == btnBack.id) {
|
||||
mc.displayGuiScreen(new GuiMainMenu());
|
||||
}
|
||||
|
||||
if (guiButton.id == this.btnModeSkin.id || guiButton.id == this.btnModeElytra.id || guiButton.id == this.btnModeSkinnySkin.id) {
|
||||
if (guiButton.id == btnModeSkin.id || guiButton.id == btnModeElytra.id || guiButton.id == btnModeSkinnySkin.id) {
|
||||
ItemStack stack;
|
||||
if (guiButton.id == this.btnModeSkin.id) {
|
||||
this.thinArmType = false;
|
||||
this.textureType = SKIN;
|
||||
if (guiButton.id == btnModeSkin.id) {
|
||||
thinArmType = false;
|
||||
textureType = SKIN;
|
||||
stack = ItemStack.EMPTY;
|
||||
} else if (guiButton.id == this.btnModeSkinnySkin.id) {
|
||||
this.thinArmType = true;
|
||||
this.textureType = SKIN;
|
||||
} else if (guiButton.id == btnModeSkinnySkin.id) {
|
||||
thinArmType = true;
|
||||
textureType = SKIN;
|
||||
stack = ItemStack.EMPTY;
|
||||
} else {
|
||||
this.textureType = ELYTRA;
|
||||
textureType = ELYTRA;
|
||||
stack = new ItemStack(Items.ELYTRA);
|
||||
}
|
||||
|
||||
this.btnModeSkin.enabled = thinArmType;
|
||||
this.btnModeSkinnySkin.enabled = !thinArmType;
|
||||
this.btnModeElytra.enabled = this.textureType == SKIN;
|
||||
btnModeSkin.enabled = thinArmType;
|
||||
btnModeSkinnySkin.enabled = !thinArmType;
|
||||
btnModeElytra.enabled = textureType == SKIN;
|
||||
|
||||
guiButton.enabled = false;
|
||||
// clear currently selected skin
|
||||
this.selectedSkin = null;
|
||||
this.localPlayer.releaseTextures();
|
||||
selectedSkin = null;
|
||||
localPlayer.releaseTextures();
|
||||
|
||||
// put on or take off the elytra
|
||||
this.localPlayer.setItemStackToSlot(EntityEquipmentSlot.CHEST, stack);
|
||||
this.remotePlayer.setItemStackToSlot(EntityEquipmentSlot.CHEST, stack);
|
||||
localPlayer.setItemStackToSlot(EntityEquipmentSlot.CHEST, stack);
|
||||
remotePlayer.setItemStackToSlot(EntityEquipmentSlot.CHEST, stack);
|
||||
|
||||
this.localPlayer.setPreviewThinArms(thinArmType);
|
||||
this.remotePlayer.setPreviewThinArms(thinArmType);
|
||||
localPlayer.setPreviewThinArms(thinArmType);
|
||||
remotePlayer.setPreviewThinArms(thinArmType);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -339,16 +339,16 @@ public class GuiSkins extends GuiScreen {
|
|||
|
||||
@Override
|
||||
protected void mouseClicked(int mouseX, int mouseY, int button) throws IOException {
|
||||
if (this.uploadError != null) {
|
||||
this.uploadError = null;
|
||||
if (uploadError != null) {
|
||||
uploadError = null;
|
||||
} else {
|
||||
super.mouseClicked(mouseX, mouseY, button);
|
||||
byte top = 30;
|
||||
int bottom = this.height - 40;
|
||||
int mid = this.width / 2;
|
||||
if ((mouseX > 30 && mouseX < mid - 30 || mouseX > mid + 30 && mouseX < this.width - 30) && mouseY > top && mouseY < bottom) {
|
||||
this.localPlayer.swingArm(EnumHand.MAIN_HAND);
|
||||
this.remotePlayer.swingArm(EnumHand.MAIN_HAND);
|
||||
int bottom = height - 40;
|
||||
int mid = width / 2;
|
||||
if ((mouseX > 30 && mouseX < mid - 30 || mouseX > mid + 30 && mouseX < width - 30) && mouseY > top && mouseY < bottom) {
|
||||
localPlayer.swingArm(EnumHand.MAIN_HAND);
|
||||
remotePlayer.swingArm(EnumHand.MAIN_HAND);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -358,14 +358,14 @@ public class GuiSkins extends GuiScreen {
|
|||
@Override
|
||||
protected void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick) {
|
||||
|
||||
updateCounter -= (lastMouseX - mouseX);
|
||||
updateCounter -= lastMouseX - mouseX;
|
||||
|
||||
lastMouseX = mouseX;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void keyTyped(char keyChar, int keyCode) throws IOException {
|
||||
if (this.openFileThread == null && !this.uploadingSkin) {
|
||||
if (openFileThread == null && !uploadingSkin) {
|
||||
|
||||
if (keyCode == Keyboard.KEY_LEFT) {
|
||||
updateCounter -= 5;
|
||||
|
@ -394,7 +394,7 @@ public class GuiSkins extends GuiScreen {
|
|||
Gui.drawRect(mid + 30, top, width - 30, bottom, Integer.MIN_VALUE);
|
||||
|
||||
drawGradientRect(30, horizon, mid - 30, bottom, 0x80FFFFFF, 0xffffff);
|
||||
drawGradientRect(mid + 30, horizon, this.width - 30, bottom, 0x80FFFFFF, 0xffffff);
|
||||
drawGradientRect(mid + 30, horizon, width - 30, bottom, 0x80FFFFFF, 0xffffff);
|
||||
|
||||
super.drawScreen(mouseX, mouseY, partialTick);
|
||||
|
||||
|
@ -417,7 +417,7 @@ public class GuiSkins extends GuiScreen {
|
|||
|
||||
disableClipping();
|
||||
|
||||
drawCenteredString(this.fontRenderer, I18n.format("hdskins.manager"), width / 2, 10, 0xffffff);
|
||||
drawCenteredString(fontRenderer, I18n.format("hdskins.manager"), width / 2, 10, 0xffffff);
|
||||
|
||||
fontRenderer.drawStringWithShadow(I18n.format("hdskins.local"), 34, 34, 0xffffff);
|
||||
fontRenderer.drawStringWithShadow(I18n.format("hdskins.server"), width / 2 + 34, 34, 0xffffff);
|
||||
|
@ -431,73 +431,73 @@ public class GuiSkins extends GuiScreen {
|
|||
//this.drawGradientRect(30, this.height - 60, mid - 30, bottom, 1, 0xe0ffffff);
|
||||
//this.drawGradientRect(mid + 30, this.height - 60, this.width - 30, bottom, 0, 0xE0FFFFFF);
|
||||
|
||||
int labelwidth = (this.width / 2 - 80) / 2;
|
||||
if (!this.localPlayer.isUsingLocalTexture()) {
|
||||
int opacity = this.fontRenderer.getStringWidth(this.skinMessage) / 2;
|
||||
Gui.drawRect(40, this.height / 2 - 12, this.width / 2 - 40, this.height / 2 + 12, 0xB0000000);
|
||||
this.fontRenderer.drawStringWithShadow(this.skinMessage, (int) (xPos1 - opacity), this.height / 2 - 4, 0xffffff);
|
||||
int labelwidth = (width / 2 - 80) / 2;
|
||||
if (!localPlayer.isUsingLocalTexture()) {
|
||||
int opacity = fontRenderer.getStringWidth(skinMessage) / 2;
|
||||
Gui.drawRect(40, height / 2 - 12, width / 2 - 40, height / 2 + 12, 0xB0000000);
|
||||
fontRenderer.drawStringWithShadow(skinMessage, (int) (xPos1 - opacity), height / 2 - 4, 0xffffff);
|
||||
}
|
||||
if (this.btnModeSkin.isMouseOver() || this.btnModeElytra.isMouseOver() || this.btnModeSkinnySkin.isMouseOver()) {
|
||||
if (btnModeSkin.isMouseOver() || btnModeElytra.isMouseOver() || btnModeSkinnySkin.isMouseOver()) {
|
||||
int y = Math.max(mouseY, 16);
|
||||
String text;
|
||||
if (this.btnModeSkin.isMouseOver()) {
|
||||
if (btnModeSkin.isMouseOver()) {
|
||||
text = "hdskins.mode.skin";
|
||||
} else if (this.btnModeSkinnySkin.isMouseOver()) {
|
||||
} else if (btnModeSkinnySkin.isMouseOver()) {
|
||||
text = "hdskins.mode.skinny";
|
||||
} else {
|
||||
text = "hdskins.mode.elytra";
|
||||
}
|
||||
this.drawHoveringText(I18n.format(text), mouseX, y);
|
||||
}
|
||||
if (this.btnAbout.isMouseOver()) {
|
||||
if (btnAbout.isMouseOver()) {
|
||||
SkinServer gateway = HDSkinManager.INSTANCE.getGatewayServer();
|
||||
this.drawHoveringText(Splitter.on("\r\n").splitToList(gateway.toString()), mouseX, mouseY);
|
||||
}
|
||||
|
||||
if (this.fetchingSkin) {
|
||||
if (fetchingSkin) {
|
||||
String opacity1;
|
||||
if (this.throttledByMojang) {
|
||||
if (throttledByMojang) {
|
||||
opacity1 = TextFormatting.RED + I18n.format("hdskins.error.mojang");
|
||||
String stringWidth = I18n.format("hdskins.error.mojang.wait");
|
||||
int stringWidth1 = this.fontRenderer.getStringWidth(opacity1) / 2;
|
||||
int stringWidth2 = this.fontRenderer.getStringWidth(stringWidth) / 2;
|
||||
int stringWidth1 = fontRenderer.getStringWidth(opacity1) / 2;
|
||||
int stringWidth2 = fontRenderer.getStringWidth(stringWidth) / 2;
|
||||
|
||||
Gui.drawRect((int) (xPos2 - labelwidth), this.height / 2 - 16, this.width - 40, this.height / 2 + 16, 0xB0000000);
|
||||
Gui.drawRect((int) (xPos2 - labelwidth), height / 2 - 16, width - 40, height / 2 + 16, 0xB0000000);
|
||||
|
||||
this.fontRenderer.drawStringWithShadow(opacity1, (int) (xPos2 - stringWidth1), this.height / 2 - 10, 0xffffff);
|
||||
this.fontRenderer.drawStringWithShadow(stringWidth, (int) (xPos2 - stringWidth2), this.height / 2 + 2, 0xffffff);
|
||||
fontRenderer.drawStringWithShadow(opacity1, (int) (xPos2 - stringWidth1), height / 2 - 10, 0xffffff);
|
||||
fontRenderer.drawStringWithShadow(stringWidth, (int) (xPos2 - stringWidth2), height / 2 + 2, 0xffffff);
|
||||
} else {
|
||||
opacity1 = I18n.format("hdskins.fetch");
|
||||
int stringWidth1 = this.fontRenderer.getStringWidth(opacity1) / 2;
|
||||
Gui.drawRect((int) (xPos2 - labelwidth), this.height / 2 - 12, this.width - 40, this.height / 2 + 12, 0xB0000000);
|
||||
this.fontRenderer.drawStringWithShadow(opacity1, (int) (xPos2 - stringWidth1), this.height / 2 - 4, 0xffffff);
|
||||
int stringWidth1 = fontRenderer.getStringWidth(opacity1) / 2;
|
||||
Gui.drawRect((int) (xPos2 - labelwidth), height / 2 - 12, width - 40, height / 2 + 12, 0xB0000000);
|
||||
fontRenderer.drawStringWithShadow(opacity1, (int) (xPos2 - stringWidth1), height / 2 - 4, 0xffffff);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.uploadingSkin || this.uploadOpacity > 0.0F) {
|
||||
if (!this.uploadingSkin) {
|
||||
this.uploadOpacity -= deltaTime * 0.05F;
|
||||
} else if (this.uploadOpacity < 1.0F) {
|
||||
this.uploadOpacity += deltaTime * 0.1F;
|
||||
if (uploadingSkin || uploadOpacity > 0.0F) {
|
||||
if (!uploadingSkin) {
|
||||
uploadOpacity -= deltaTime * 0.05F;
|
||||
} else if (uploadOpacity < 1.0F) {
|
||||
uploadOpacity += deltaTime * 0.1F;
|
||||
}
|
||||
|
||||
if (this.uploadOpacity > 1.0F) {
|
||||
this.uploadOpacity = 1.0F;
|
||||
if (uploadOpacity > 1.0F) {
|
||||
uploadOpacity = 1.0F;
|
||||
}
|
||||
|
||||
int opacity = Math.min(180, (int) (this.uploadOpacity * 180.0F)) & 255;
|
||||
if (this.uploadOpacity > 0.0F) {
|
||||
Gui.drawRect(0, 0, this.width, this.height, opacity << 24);
|
||||
if (this.uploadingSkin) {
|
||||
this.drawCenteredString(this.fontRenderer, this.skinUploadMessage, this.width / 2, this.height / 2, opacity << 24 | 0xffffff);
|
||||
int opacity = Math.min(180, (int) (uploadOpacity * 180.0F)) & 255;
|
||||
if (uploadOpacity > 0.0F) {
|
||||
Gui.drawRect(0, 0, width, height, opacity << 24);
|
||||
if (uploadingSkin) {
|
||||
drawCenteredString(fontRenderer, skinUploadMessage, width / 2, height / 2, opacity << 24 | 0xffffff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.uploadError != null) {
|
||||
Gui.drawRect(0, 0, this.width, this.height, 0xB0000000);
|
||||
this.drawCenteredString(this.fontRenderer, I18n.format("hdskins.failed"), this.width / 2, this.height / 2 - 10, 0xFFFFFF55);
|
||||
this.drawCenteredString(this.fontRenderer, this.uploadError, this.width / 2, this.height / 2 + 2, 0xFFFF5555);
|
||||
if (uploadError != null) {
|
||||
Gui.drawRect(0, 0, width, height, 0xB0000000);
|
||||
drawCenteredString(fontRenderer, I18n.format("hdskins.failed"), width / 2, height / 2 - 10, 0xFFFFFF55);
|
||||
drawCenteredString(fontRenderer, uploadError, width / 2, height / 2 + 2, 0xFFFF5555);
|
||||
}
|
||||
|
||||
depthMask(true);
|
||||
|
@ -519,11 +519,11 @@ public class GuiSkins extends GuiScreen {
|
|||
rotate(-135.0F, 0.0F, 1.0F, 0.0F);
|
||||
rotate(15.0F, 1.0F, 0.0F, 0.0F);
|
||||
|
||||
float rot = ((updateCounter + partialTick) * 2.5F) % 360;
|
||||
float rot = (updateCounter + partialTick) * 2.5F % 360;
|
||||
|
||||
rotate(rot, 0, 1, 0);
|
||||
|
||||
thePlayer.rotationYawHead = ((float) Math.atan(mouseX / 20)) * 30;
|
||||
thePlayer.rotationYawHead = (float) Math.atan(mouseX / 20) * 30;
|
||||
|
||||
thePlayer.rotationPitch = -((float) Math.atan(mouseY / 40)) * 20;
|
||||
translate(0.0D, thePlayer.getYOffset(), 0.0D);
|
||||
|
@ -538,18 +538,18 @@ public class GuiSkins extends GuiScreen {
|
|||
}
|
||||
|
||||
private void enableClipping(int yBottom) {
|
||||
if (this.doubleBuffer == null) {
|
||||
this.doubleBuffer = BufferUtils.createByteBuffer(32).asDoubleBuffer();
|
||||
if (doubleBuffer == null) {
|
||||
doubleBuffer = BufferUtils.createByteBuffer(32).asDoubleBuffer();
|
||||
}
|
||||
|
||||
this.doubleBuffer.clear();
|
||||
this.doubleBuffer.put(0.0D).put(1.0D).put(0.0D).put((-30)).flip();
|
||||
doubleBuffer.clear();
|
||||
doubleBuffer.put(0.0D).put(1.0D).put(0.0D).put(-30).flip();
|
||||
|
||||
GL11.glClipPlane(GL11.GL_CLIP_PLANE0, this.doubleBuffer);
|
||||
this.doubleBuffer.clear();
|
||||
this.doubleBuffer.put(0.0D).put(-1.0D).put(0.0D).put(yBottom).flip();
|
||||
GL11.glClipPlane(GL11.GL_CLIP_PLANE0, doubleBuffer);
|
||||
doubleBuffer.clear();
|
||||
doubleBuffer.put(0.0D).put(-1.0D).put(0.0D).put(yBottom).flip();
|
||||
|
||||
GL11.glClipPlane(GL11.GL_CLIP_PLANE1, this.doubleBuffer);
|
||||
GL11.glClipPlane(GL11.GL_CLIP_PLANE1, doubleBuffer);
|
||||
GL11.glEnable(GL11.GL_CLIP_PLANE0);
|
||||
GL11.glEnable(GL11.GL_CLIP_PLANE1);
|
||||
}
|
||||
|
@ -564,47 +564,47 @@ public class GuiSkins extends GuiScreen {
|
|||
}
|
||||
|
||||
private void clearUploadedSkin(Session session) {
|
||||
this.uploadingSkin = true;
|
||||
this.skinUploadMessage = I18n.format("hdskins.request");
|
||||
uploadingSkin = true;
|
||||
skinUploadMessage = I18n.format("hdskins.request");
|
||||
HDSkinManager.INSTANCE.getGatewayServer()
|
||||
.uploadSkin(session, null, this.textureType, getMetadata())
|
||||
.thenAccept(this::onUploadComplete)
|
||||
.exceptionally(this::onFailure);
|
||||
.uploadSkin(session, null, textureType, getMetadata())
|
||||
.thenAccept(this::onUploadComplete)
|
||||
.exceptionally(this::onFailure);
|
||||
}
|
||||
|
||||
private void uploadSkin(Session session, @Nullable File skinFile) {
|
||||
this.uploadingSkin = true;
|
||||
this.skinUploadMessage = I18n.format("hdskins.upload");
|
||||
uploadingSkin = true;
|
||||
skinUploadMessage = I18n.format("hdskins.upload");
|
||||
URI path = skinFile == null ? null : skinFile.toURI();
|
||||
HDSkinManager.INSTANCE.getGatewayServer()
|
||||
.uploadSkin(session, path, this.textureType, getMetadata())
|
||||
.thenAccept(this::onUploadComplete)
|
||||
.exceptionally(this::onFailure);
|
||||
.uploadSkin(session, path, textureType, getMetadata())
|
||||
.thenAccept(this::onUploadComplete)
|
||||
.exceptionally(this::onFailure);
|
||||
}
|
||||
|
||||
private Map<String, String> getMetadata() {
|
||||
return ImmutableMap.of("model", this.thinArmType ? "slim" : "default");
|
||||
return ImmutableMap.of("model", thinArmType ? "slim" : "default");
|
||||
}
|
||||
|
||||
private void setUploadError(@Nullable String error) {
|
||||
this.uploadError = error;
|
||||
this.btnUpload.enabled = true;
|
||||
uploadError = error;
|
||||
btnUpload.enabled = true;
|
||||
}
|
||||
|
||||
|
||||
private Void onFailure(Throwable t) {
|
||||
t = Throwables.getRootCause(t);
|
||||
LogManager.getLogger().warn("Upload failed", t);
|
||||
this.setUploadError(t.toString());
|
||||
this.uploadingSkin = false;
|
||||
setUploadError(t.toString());
|
||||
uploadingSkin = false;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void onUploadComplete(SkinUploadResponse response) {
|
||||
LiteLoaderLogger.info("Upload completed with: %s", response);
|
||||
this.uploadingSkin = false;
|
||||
this.pendingRemoteSkinRefresh = true;
|
||||
uploadingSkin = false;
|
||||
pendingRemoteSkinRefresh = true;
|
||||
}
|
||||
|
||||
static {
|
||||
|
|
|
@ -71,10 +71,10 @@ public class MineLittlePony {
|
|||
void postInit(Minecraft minecraft) {
|
||||
|
||||
HDSkinManager manager = HDSkinManager.INSTANCE;
|
||||
// manager.setSkinUrl(SKIN_SERVER_URL);
|
||||
// manager.setGatewayURL(GATEWAY_URL);
|
||||
// manager.setSkinUrl(SKIN_SERVER_URL);
|
||||
// manager.setGatewayURL(GATEWAY_URL);
|
||||
manager.addSkinModifier(new PonySkinModifier());
|
||||
// logger.info("Set MineLP skin server URL.");
|
||||
// logger.info("Set MineLP skin server URL.");
|
||||
manager.addClearListener(ponyManager);
|
||||
|
||||
manager.setPrefferedSkinsGuiClass(GuiSkinsMineLP.class);
|
||||
|
|
|
@ -147,7 +147,9 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
|||
setHead(0, 0, 0);
|
||||
}
|
||||
|
||||
if (isSleeping) ponySleep();
|
||||
if (isSleeping) {
|
||||
ponySleep();
|
||||
}
|
||||
|
||||
animateWears();
|
||||
|
||||
|
@ -218,12 +220,12 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Used to set the legs rotation based on walking/crouching animations.
|
||||
*
|
||||
* Takes the same parameters as {@link AbstractPonyModel.setRotationAndAngles}
|
||||
*
|
||||
*/
|
||||
*
|
||||
* Used to set the legs rotation based on walking/crouching animations.
|
||||
*
|
||||
* Takes the same parameters as {@link AbstractPonyModel.setRotationAndAngles}
|
||||
*
|
||||
*/
|
||||
protected void rotateLegs(float move, float swing, float ticks, Entity entity) {
|
||||
if (isSwimming()) {
|
||||
rotateLegsSwimming(move, swing, ticks, entity);
|
||||
|
@ -275,8 +277,8 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
|||
float forward = ROTATE_270 - ROTATE_90/3;
|
||||
float down = ROTATE_90;
|
||||
|
||||
float leftX = down + MathHelper.sin((move / 3) + 2*PI/3) / 2;
|
||||
float leftY = -forward - MathHelper.sin((move / 3) + 2*PI/3);
|
||||
float leftX = down + MathHelper.sin(move / 3 + 2*PI/3) / 2;
|
||||
float leftY = -forward - MathHelper.sin(move / 3 + 2*PI/3);
|
||||
|
||||
float rightX = down + MathHelper.sin(move / 3) / 2;
|
||||
|
||||
|
@ -338,7 +340,7 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
|||
bipedLeftArm.rotateAngleX = MathHelper.cos(baseRotation + angle) * scale;
|
||||
bipedRightArm.rotateAngleX = MathHelper.cos(baseRotation + PI + angle / 2) * scale;
|
||||
|
||||
bipedLeftLeg.rotateAngleX = MathHelper.cos(baseRotation + PI - (angle * 0.4f)) * scale;
|
||||
bipedLeftLeg.rotateAngleX = MathHelper.cos(baseRotation + PI - angle * 0.4f) * scale;
|
||||
bipedRightLeg.rotateAngleX = MathHelper.cos(baseRotation + angle / 5) * scale;
|
||||
|
||||
bipedLeftArm.rotateAngleY = 0;
|
||||
|
@ -349,8 +351,12 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
|||
}
|
||||
|
||||
protected float getLegOutset() {
|
||||
if (isSleeping) return 3.6f;
|
||||
if (isCrouching()) return 1;
|
||||
if (isSleeping) {
|
||||
return 3.6f;
|
||||
}
|
||||
if (isCrouching()) {
|
||||
return 1;
|
||||
}
|
||||
return 5;
|
||||
}
|
||||
|
||||
|
@ -386,7 +392,7 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
|||
swag -= (float)Math.pow(swing, 2);
|
||||
}
|
||||
float mult = 1 - swag/2;
|
||||
arm.rotateAngleX = arm.rotateAngleX * mult - (PI / 10) * swag;
|
||||
arm.rotateAngleX = arm.rotateAngleX * mult - PI / 10 * swag;
|
||||
arm.rotateAngleZ = -reflect * (PI / 15);
|
||||
if (isSneak) {
|
||||
arm.rotationPointX -= reflect * 2;
|
||||
|
@ -395,7 +401,7 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
|||
arm.rotateAngleY = 0;
|
||||
break;
|
||||
case BLOCK:
|
||||
arm.rotateAngleX = (arm.rotateAngleX / 2 - 0.9424779F) - 0.3F;
|
||||
arm.rotateAngleX = arm.rotateAngleX / 2 - 0.9424779F - 0.3F;
|
||||
arm.rotateAngleY = reflect * PI / 9;
|
||||
arm.rotationPointX += reflect;
|
||||
arm.rotationPointZ += 3;
|
||||
|
@ -411,7 +417,7 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
|||
}
|
||||
|
||||
protected void aimBow(ModelRenderer arm, float ticks) {
|
||||
arm.rotateAngleX = ROTATE_270 + bipedHead.rotateAngleX + (MathHelper.sin(ticks * 0.067F) * 0.05F);
|
||||
arm.rotateAngleX = ROTATE_270 + bipedHead.rotateAngleX + MathHelper.sin(ticks * 0.067F) * 0.05F;
|
||||
arm.rotateAngleY = bipedHead.rotateAngleY - 0.06F;
|
||||
arm.rotateAngleZ = MathHelper.cos(ticks * 0.09F) * 0.05F + 0.05F;
|
||||
if (isSneak) {
|
||||
|
@ -457,7 +463,9 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
|||
* @param ticks Total whole and partial ticks since the entity's existance. Used in animations together with {@code swing} and {@code move}.
|
||||
*/
|
||||
protected void swingArms(float ticks) {
|
||||
if (isSleeping) return;
|
||||
if (isSleeping) {
|
||||
return;
|
||||
}
|
||||
|
||||
float cos = MathHelper.cos(ticks * 0.09F) * 0.05F + 0.05F;
|
||||
float sin = MathHelper.sin(ticks * 0.067F) * 0.05F;
|
||||
|
@ -516,6 +524,7 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
|||
AbstractPonyRenderer.shiftRotationPoint(bipedLeftLeg, 0, 2, -8);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(float yOffset, float stretch) {
|
||||
boxList.clear();
|
||||
|
||||
|
@ -529,16 +538,16 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
|||
|
||||
|
||||
bipedHead = new PonyRenderer(this, 0, 0)
|
||||
.offset(HEAD_CENTRE_X, HEAD_CENTRE_Y, HEAD_CENTRE_Z)
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z - 2)
|
||||
.box(-4, -4, -4, 8, 8, 8, stretch)
|
||||
.tex(12, 16).box(-4, -6, 1, 2, 2, 2, stretch)
|
||||
.flip().box( 2, -6, 1, 2, 2, 2, stretch);
|
||||
.offset(HEAD_CENTRE_X, HEAD_CENTRE_Y, HEAD_CENTRE_Z)
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z - 2)
|
||||
.box(-4, -4, -4, 8, 8, 8, stretch)
|
||||
.tex(12, 16).box(-4, -6, 1, 2, 2, 2, stretch)
|
||||
.flip().box( 2, -6, 1, 2, 2, 2, stretch);
|
||||
|
||||
bipedHeadwear = new PonyRenderer(this, 32, 0)
|
||||
.offset(HEAD_CENTRE_X, HEAD_CENTRE_Y, HEAD_CENTRE_Z)
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z - 2)
|
||||
.box(-4, -4, -4, 8, 8, 8, stretch + 0.5F);
|
||||
.offset(HEAD_CENTRE_X, HEAD_CENTRE_Y, HEAD_CENTRE_Z)
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z - 2)
|
||||
.box(-4, -4, -4, 8, 8, 8, stretch + 0.5F);
|
||||
|
||||
snout = new PonySnout(this);
|
||||
snout.init(yOffset, stretch);
|
||||
|
@ -559,40 +568,40 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
|||
}
|
||||
|
||||
bipedBody = new PonyRenderer(this, 16, 16)
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.box(-4, 4, -2, 8, 8, 4, stretch);
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.box(-4, 4, -2, 8, 8, 4, stretch);
|
||||
|
||||
bipedBodyWear.addBox(-4, 4, -2, 8, 8, 4, stretch + 0.25F);
|
||||
bipedBodyWear.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
|
||||
|
||||
upperTorso = new PlaneRenderer(this, 24, 0);
|
||||
upperTorso.offset(BODY_CENTRE_X, BODY_CENTRE_Y, BODY_CENTRE_Z)
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.tex(24, 0) .addEastPlane( 4, -4, -4, 8, 8, stretch)
|
||||
.tex(4, 0) .addEastPlane( 4, -4, 4, 8, 4, stretch)
|
||||
.tex(56, 0) .addBottomPlane(-4, 4, -4, 8, 8, stretch)
|
||||
.tex(36, 16) .addBackPlane(-4, -4, 8, 8, 4, stretch)
|
||||
.addBackPlane(-4, 0, 8, 8, 4, stretch)
|
||||
.addBottomPlane(-4, 4, 4, 8, 4, stretch)
|
||||
.flipZ().tex(32, 20).addTopPlane(-4, -4, -4, 8, 12, stretch)
|
||||
.tex(24, 0).addWestPlane(-4, -4, -4, 8, 8, stretch)
|
||||
.tex(4, 0) .addWestPlane(-4, -4, 4, 8, 4, stretch)
|
||||
// Tail stub
|
||||
.child(0)
|
||||
.tex(32, 0).addTopPlane(-1, 2, 2, 2, 6, stretch)
|
||||
.addBottomPlane(-1, 4, 2, 2, 6, stretch)
|
||||
.addEastPlane( 1, 2, 2, 2, 6, stretch)
|
||||
.addBackPlane(-1, 2, 8, 2, 2, stretch)
|
||||
.flipZ().addWestPlane(-1, 2, 2, 2, 6, stretch)
|
||||
.rotate(0.5F, 0, 0);
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.tex(24, 0) .addEastPlane( 4, -4, -4, 8, 8, stretch)
|
||||
.tex(4, 0) .addEastPlane( 4, -4, 4, 8, 4, stretch)
|
||||
.tex(56, 0) .addBottomPlane(-4, 4, -4, 8, 8, stretch)
|
||||
.tex(36, 16) .addBackPlane(-4, -4, 8, 8, 4, stretch)
|
||||
.addBackPlane(-4, 0, 8, 8, 4, stretch)
|
||||
.addBottomPlane(-4, 4, 4, 8, 4, stretch)
|
||||
.flipZ().tex(32, 20).addTopPlane(-4, -4, -4, 8, 12, stretch)
|
||||
.tex(24, 0).addWestPlane(-4, -4, -4, 8, 8, stretch)
|
||||
.tex(4, 0) .addWestPlane(-4, -4, 4, 8, 4, stretch)
|
||||
// Tail stub
|
||||
.child(0)
|
||||
.tex(32, 0).addTopPlane(-1, 2, 2, 2, 6, stretch)
|
||||
.addBottomPlane(-1, 4, 2, 2, 6, stretch)
|
||||
.addEastPlane( 1, 2, 2, 2, 6, stretch)
|
||||
.addBackPlane(-1, 2, 8, 2, 2, stretch)
|
||||
.flipZ().addWestPlane(-1, 2, 2, 2, 6, stretch)
|
||||
.rotate(0.5F, 0, 0);
|
||||
|
||||
neck = new PlaneRenderer(this, 0, 16)
|
||||
.at(NECK_CENTRE_X, NECK_CENTRE_Y, NECK_CENTRE_Z)
|
||||
.rotate(NECK_ROT_X, 0, 0).around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.addFrontPlane(0, 0, 0, 4, 4, stretch)
|
||||
.addBackPlane(0, 0, 4, 4, 4, stretch)
|
||||
.addEastPlane(4, 0, 0, 4, 4, stretch)
|
||||
.addWestPlane(0, 0, 0, 4, 4, stretch);
|
||||
.at(NECK_CENTRE_X, NECK_CENTRE_Y, NECK_CENTRE_Z)
|
||||
.rotate(NECK_ROT_X, 0, 0).around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.addFrontPlane(0, 0, 0, 4, 4, stretch)
|
||||
.addBackPlane(0, 0, 4, 4, 4, stretch)
|
||||
.addEastPlane(4, 0, 0, 4, 4, stretch)
|
||||
.addWestPlane(0, 0, 0, 4, 4, stretch);
|
||||
}
|
||||
|
||||
protected void preInitLegs() {
|
||||
|
@ -800,12 +809,12 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Called to render the head.
|
||||
*
|
||||
* Takes the same parameters as {@link AbstractPonyModel.setRotationAndAngles}
|
||||
*
|
||||
*/
|
||||
*
|
||||
* Called to render the head.
|
||||
*
|
||||
* Takes the same parameters as {@link AbstractPonyModel.setRotationAndAngles}
|
||||
*
|
||||
*/
|
||||
protected void renderBody(Entity entity, float move, float swing, float ticks, float headYaw, float headPitch, float scale) {
|
||||
bipedBody.render(scale);
|
||||
if (textureHeight == 64) {
|
||||
|
@ -817,7 +826,9 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
|||
}
|
||||
|
||||
protected void renderLegs(float scale) {
|
||||
if (!isSneak) bipedBody.postRender(scale);
|
||||
if (!isSneak) {
|
||||
bipedBody.postRender(scale);
|
||||
}
|
||||
|
||||
bipedLeftArm.render(scale);
|
||||
bipedRightArm.render(scale);
|
||||
|
@ -834,7 +845,9 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
|||
|
||||
@Override
|
||||
public void transform(BodyPart part) {
|
||||
if (isRiding) translate(0, -0.4F, -0.2F);
|
||||
if (isRiding) {
|
||||
translate(0, -0.4F, -0.2F);
|
||||
}
|
||||
|
||||
if (isSleeping) {
|
||||
rotate(90, 1, 0, 0);
|
||||
|
@ -876,7 +889,9 @@ public abstract class AbstractPonyModel extends ModelPlayer implements IModel {
|
|||
ModelRenderer result;
|
||||
do {
|
||||
result = boxList.get(randomI);
|
||||
if (!result.cubeList.isEmpty()) return result;
|
||||
if (!result.cubeList.isEmpty()) {
|
||||
return result;
|
||||
}
|
||||
|
||||
index = (index + 1) % boxList.size();
|
||||
} while (index != randomI);
|
||||
|
|
|
@ -52,6 +52,7 @@ public class ModelPonyArmor extends AbstractPonyModel implements IModelArmor {
|
|||
super.renderLegs(scale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends ModelBiped & IModel> void synchroniseLegs(T mainModel) {
|
||||
copyModelAngles(mainModel.bipedRightArm, bipedRightArm);
|
||||
copyModelAngles(mainModel.bipedLeftArm, bipedLeftArm);
|
||||
|
@ -63,8 +64,8 @@ public class ModelPonyArmor extends AbstractPonyModel implements IModelArmor {
|
|||
protected void initHead(float yOffset, float stretch) {
|
||||
super.initHead(yOffset, stretch * 1.1F);
|
||||
((PonyRenderer)bipedHead).child()
|
||||
.tex(0, 4).box(2, -6, 1, 2, 2, 2, stretch * 0.5F)
|
||||
.box(-4, -6, 1, 2, 2, 2, stretch * 0.5F);
|
||||
.tex(0, 4).box(2, -6, 1, 2, 2, 2, stretch * 0.5F)
|
||||
.box(-4, -6, 1, 2, 2, 2, stretch * 0.5F);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -73,10 +74,10 @@ public class ModelPonyArmor extends AbstractPonyModel implements IModelArmor {
|
|||
|
||||
flankGuard = new PonyRenderer(this, 0, 0)
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.box(-4, 4, 6, 8, 8, 8, stretch);
|
||||
.box(-4, 4, 6, 8, 8, 8, stretch);
|
||||
saddle = new PonyRenderer(this, 16, 8)
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.box(-4, 4, -2, 8, 8, 16, stretch);
|
||||
.box(-4, 4, -2, 8, 8, 16, stretch);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -100,6 +101,7 @@ public class ModelPonyArmor extends AbstractPonyModel implements IModelArmor {
|
|||
snout.isHidden = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showFeet(boolean show) {
|
||||
bipedRightArm.showModel = show;
|
||||
bipedLeftArm.showModel = show;
|
||||
|
@ -107,15 +109,18 @@ public class ModelPonyArmor extends AbstractPonyModel implements IModelArmor {
|
|||
bipedLeftLeg.showModel = show;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showLegs(boolean isPony) {
|
||||
bipedBody.showModel = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showSaddle(boolean isPony) {
|
||||
flankGuard.showModel = !isPony;
|
||||
saddle.showModel = isPony;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showHead(boolean show) {
|
||||
bipedHead.showModel = show;
|
||||
}
|
||||
|
|
|
@ -28,8 +28,8 @@ public class ModelPonyHead extends ModelHumanoidHead implements ICapitated {
|
|||
snout.init(0, 0);
|
||||
|
||||
ears = new PonyRenderer(this, 0, 0).offset(0, -3, 2).around(0, 0, -2)
|
||||
.tex(12, 16).box(-4, -6, 1, 2, 2, 2, 0)
|
||||
.flip().box( 2, -6, 1, 2, 2, 2, 0);
|
||||
.tex(12, 16).box(-4, -6, 1, 2, 2, 2, 0)
|
||||
.flip().box( 2, -6, 1, 2, 2, 2, 0);
|
||||
|
||||
skeletonHead.addChild(ears);
|
||||
}
|
||||
|
|
|
@ -29,17 +29,17 @@ public class ModelWing {
|
|||
float x = right ? -6 : 4;
|
||||
|
||||
folded.around(HEAD_RP_X, WING_FOLDED_RP_Y + y, WING_FOLDED_RP_Z)
|
||||
.box(x, 5, 2, 2, 6, 2, scale)
|
||||
.box(x, 5, 4, 2, 8, 2, scale)
|
||||
.box(x, 5, 6, 2, 6, 2, scale)
|
||||
.rotateAngleX = ROTATE_90;
|
||||
.box(x, 5, 2, 2, 6, 2, scale)
|
||||
.box(x, 5, 4, 2, 8, 2, scale)
|
||||
.box(x, 5, 6, 2, 6, 2, scale)
|
||||
.rotateAngleX = ROTATE_90;
|
||||
}
|
||||
|
||||
private void addFeathers(boolean right, boolean l, float rotationPointY, float scale) {
|
||||
float r = right ? -1 : 1;
|
||||
|
||||
extended.around(r * LEFT_WING_EXT_RP_X, LEFT_WING_EXT_RP_Y + rotationPointY, LEFT_WING_EXT_RP_Z)
|
||||
.rotateAngleY = r * 3;
|
||||
.rotateAngleY = r * 3;
|
||||
addFeather(0, l, 6, 0, 8, scale + 0.1F);
|
||||
addFeather(1, l, -1, -0.3F, 8, scale + 0.1F) .rotateAngleX = -0.85F;
|
||||
addFeather(2, l, 1.8F, 1.3F, 8, scale - 0.1F) .rotateAngleX = -0.75F;
|
||||
|
|
|
@ -55,7 +55,7 @@ public class PonyElytra extends ModelBase {
|
|||
float velY = 1;
|
||||
|
||||
if (entity.motionY < 0) {
|
||||
Vec3d motion = (new Vec3d(entity.motionX, entity.motionY, entity.motionZ)).normalize();
|
||||
Vec3d motion = new Vec3d(entity.motionX, entity.motionY, entity.motionZ).normalize();
|
||||
velY = 1 - (float) Math.pow(-motion.y, 1.5);
|
||||
}
|
||||
|
||||
|
|
|
@ -40,22 +40,22 @@ public class PonySnout {
|
|||
|
||||
public void init(float yOffset, float stretch) {
|
||||
mare.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.tex(10, 14) .addBackPlane(-2, 2, -5, 4, 2, stretch)
|
||||
.tex(11, 13) .addBackPlane(-1, 1, -5, 2, 1, stretch)
|
||||
.tex(9, 14) .addTopPlane(-2, 2, -5, 1, 1, stretch)
|
||||
.tex(14, 14) .addTopPlane( 1, 2, -5, 1, 1, stretch)
|
||||
.tex(11, 12) .addTopPlane(-1, 1, -5, 2, 1, stretch)
|
||||
.tex(18, 7).addBottomPlane(-2, 4, -5, 4, 1, stretch)
|
||||
.tex(9, 14) .addWestPlane(-2, 2, -5, 2, 1, stretch)
|
||||
.tex(14, 14) .addEastPlane( 2, 2, -5, 2, 1, stretch)
|
||||
.tex(11, 12) .addWestPlane(-1, 1, -5, 1, 1, stretch)
|
||||
.tex(12, 12) .addEastPlane( 1, 1, -5, 1, 1, stretch);
|
||||
.tex(10, 14) .addBackPlane(-2, 2, -5, 4, 2, stretch)
|
||||
.tex(11, 13) .addBackPlane(-1, 1, -5, 2, 1, stretch)
|
||||
.tex(9, 14) .addTopPlane(-2, 2, -5, 1, 1, stretch)
|
||||
.tex(14, 14) .addTopPlane( 1, 2, -5, 1, 1, stretch)
|
||||
.tex(11, 12) .addTopPlane(-1, 1, -5, 2, 1, stretch)
|
||||
.tex(18, 7).addBottomPlane(-2, 4, -5, 4, 1, stretch)
|
||||
.tex(9, 14) .addWestPlane(-2, 2, -5, 2, 1, stretch)
|
||||
.tex(14, 14) .addEastPlane( 2, 2, -5, 2, 1, stretch)
|
||||
.tex(11, 12) .addWestPlane(-1, 1, -5, 1, 1, stretch)
|
||||
.tex(12, 12) .addEastPlane( 1, 1, -5, 1, 1, stretch);
|
||||
stallion.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.tex(10, 13) .addBackPlane(-2, 1, -5, 4, 3, stretch)
|
||||
.tex(10, 13) .addTopPlane(-2, 1, -5, 4, 1, stretch)
|
||||
.tex(18, 7).addBottomPlane(-2, 4, -5, 4, 1, stretch)
|
||||
.tex(10, 13) .addWestPlane(-2, 1, -5, 3, 1, stretch)
|
||||
.tex(13, 13) .addEastPlane( 2, 1, -5, 3, 1, stretch);
|
||||
.tex(10, 13) .addBackPlane(-2, 1, -5, 4, 3, stretch)
|
||||
.tex(10, 13) .addTopPlane(-2, 1, -5, 4, 1, stretch)
|
||||
.tex(18, 7).addBottomPlane(-2, 4, -5, 4, 1, stretch)
|
||||
.tex(10, 13) .addWestPlane(-2, 1, -5, 3, 1, stretch)
|
||||
.tex(13, 13) .addEastPlane( 2, 1, -5, 3, 1, stretch);
|
||||
}
|
||||
|
||||
public void setGender(PonyGender gender) {
|
||||
|
|
|
@ -92,13 +92,13 @@ public class PonyTail extends PlaneRenderer implements IModelPart {
|
|||
super(model);
|
||||
this.index = index;
|
||||
|
||||
offsetY = ((float)index)/4 + 0.063f;
|
||||
offsetY = (float)index/4 + 0.063f;
|
||||
|
||||
init(yOffset, stretch);
|
||||
}
|
||||
|
||||
public void init(float yOffset, float stretch) {
|
||||
int texX = (index % 2) * 4;
|
||||
int texX = index % 2 * 4;
|
||||
|
||||
around(TAIL_RP_X, TAIL_RP_Y + yOffset, TAIL_RP_Z);
|
||||
|
||||
|
@ -107,10 +107,10 @@ public class PonyTail extends PlaneRenderer implements IModelPart {
|
|||
}
|
||||
|
||||
tex(36, texX).addEastPlane( 2, 0, 2, 4, 4, stretch)
|
||||
.addWestPlane(-2, 0, 2, 4, 4, stretch);
|
||||
.addWestPlane(-2, 0, 2, 4, 4, stretch);
|
||||
tex(32, texX).addBackPlane(-2, 0, 2, 4, 4, stretch)
|
||||
.addFrontPlane(-2, 0, 6, 4, 4, stretch);
|
||||
tex(32, 0).addBottomPlane(-2, 4, 2, 4, 4, stretch);
|
||||
.addFrontPlane(-2, 0, 6, 4, 4, stretch);
|
||||
tex(32, 0).addBottomPlane(-2, 4, 2, 4, 4, stretch);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -39,37 +39,37 @@ public class SaddleBags implements IModelPart {
|
|||
|
||||
strap.offset(-x, y + 0.2F, z + 3).around(0, 4, 4)
|
||||
.tex(56, 31).addTopPlane(0, 0, 0, 8, 1, stretch)
|
||||
.addTopPlane(0, 0, 1, 8, 1, stretch)
|
||||
.addBackPlane(0, 0, 2, 8, 1, stretch)
|
||||
.addFrontPlane(0, 0, 0, 8, 1, stretch)
|
||||
.child(0).offset(0, -3, -0.305F).tex(56, 31)
|
||||
.addWestPlane(4.0002F, 0, 0, 1, 3, stretch) // 0.0001 is there
|
||||
.addWestPlane(4.0002F, -1, 0, 1, 3, stretch) // otherwise straps
|
||||
.addWestPlane(-4.0002F, 0, 0, 1, 3, stretch) // clip into the body
|
||||
.addWestPlane(-4.0002F, -1, 0, 1, 3, stretch)
|
||||
.rotateAngleX = ROTATE_270;
|
||||
.addTopPlane(0, 0, 1, 8, 1, stretch)
|
||||
.addBackPlane(0, 0, 2, 8, 1, stretch)
|
||||
.addFrontPlane(0, 0, 0, 8, 1, stretch)
|
||||
.child(0).offset(0, -3, -0.305F).tex(56, 31)
|
||||
.addWestPlane(4.0002F, 0, 0, 1, 3, stretch) // 0.0001 is there
|
||||
.addWestPlane(4.0002F, -1, 0, 1, 3, stretch) // otherwise straps
|
||||
.addWestPlane(-4.0002F, 0, 0, 1, 3, stretch) // clip into the body
|
||||
.addWestPlane(-4.0002F, -1, 0, 1, 3, stretch)
|
||||
.rotateAngleX = ROTATE_270;
|
||||
|
||||
leftBag.offset(x, y, z).around(0, 4, 4)
|
||||
.tex(56, 25).addBackPlane(0, 0, 0, 3, 6, stretch)
|
||||
.tex(59, 25).addBackPlane(0, 0, 8, 3, 6, stretch)
|
||||
.tex(56, 19).addWestPlane(3, 0, 0, 6, 8, stretch)
|
||||
.addWestPlane(0, 0, 0, 6, 8, stretch)
|
||||
.child(0).offset(z, y, -x).tex(56, 16)
|
||||
.addTopPlane(0, 0, -3, 8, 3, stretch)
|
||||
.tex(56, 22).flipZ().addBottomPlane(0, 6, -3, 8, 3, stretch)
|
||||
.rotateAngleY = ROTATE_270;
|
||||
.tex(56, 25).addBackPlane(0, 0, 0, 3, 6, stretch)
|
||||
.tex(59, 25).addBackPlane(0, 0, 8, 3, 6, stretch)
|
||||
.tex(56, 19).addWestPlane(3, 0, 0, 6, 8, stretch)
|
||||
.addWestPlane(0, 0, 0, 6, 8, stretch)
|
||||
.child(0).offset(z, y, -x).tex(56, 16)
|
||||
.addTopPlane(0, 0, -3, 8, 3, stretch)
|
||||
.tex(56, 22).flipZ().addBottomPlane(0, 6, -3, 8, 3, stretch)
|
||||
.rotateAngleY = ROTATE_270;
|
||||
|
||||
x += 3;
|
||||
|
||||
rightBag.offset(-x, y, z).around(0, 4, 4)
|
||||
.tex(56, 25).addBackPlane(0, 0, 0, 3, 6, stretch)
|
||||
.tex(59, 25).addBackPlane(0, 0, 8, 3, 6, stretch)
|
||||
.tex(56, 19).addWestPlane(3, 0, 0, 6, 8, stretch)
|
||||
.addWestPlane(0, 0, 0, 6, 8, stretch)
|
||||
.child(0).offset(z, y, x).tex(56, 16)
|
||||
.flipZ().addTopPlane(0, 0, -3, 8, 3, stretch)
|
||||
.tex(56, 22).flipZ().addBottomPlane(0, 6, -3, 8, 3, stretch)
|
||||
.rotateAngleY = ROTATE_270;
|
||||
.tex(56, 25).addBackPlane(0, 0, 0, 3, 6, stretch)
|
||||
.tex(59, 25).addBackPlane(0, 0, 8, 3, 6, stretch)
|
||||
.tex(56, 19).addWestPlane(3, 0, 0, 6, 8, stretch)
|
||||
.addWestPlane(0, 0, 0, 6, 8, stretch)
|
||||
.child(0).offset(z, y, x).tex(56, 16)
|
||||
.flipZ().addTopPlane(0, 0, -3, 8, 3, stretch)
|
||||
.tex(56, 22).flipZ().addBottomPlane(0, 6, -3, 8, 3, stretch)
|
||||
.rotateAngleY = ROTATE_270;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -31,14 +31,14 @@ public class SeaponyTail implements IModelPart {
|
|||
@Override
|
||||
public void init(float yOffset, float stretch) {
|
||||
tailBase.rotate(TAIL_ROTX, 0, 0).around(-2, 14, 8)
|
||||
.box( 0, 0, 0, 4, 6, 4, stretch).flip();
|
||||
.box( 0, 0, 0, 4, 6, 4, stretch).flip();
|
||||
|
||||
tailTip.rotate(0, 0, 0).around(1, 5, 1)
|
||||
.box(0, 0, 0, 2, 6, 1, stretch);
|
||||
.box(0, 0, 0, 2, 6, 1, stretch);
|
||||
|
||||
tailFins.offset(1, 0, 4).rotate(-TAIL_ROTX, 0, 0)
|
||||
.addTopPlane(-8, 0, 0, 8, 8, stretch)
|
||||
.flip().addTopPlane( 0, 0, 0, 8, 8, stretch);
|
||||
.addTopPlane(-8, 0, 0, 8, 8, stretch)
|
||||
.flip().addTopPlane( 0, 0, 0, 8, 8, stretch);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -24,14 +24,14 @@ public class UnicornHorn {
|
|||
glow = new HornGlowRenderer(pony, 0, 3);
|
||||
|
||||
horn.offset(HORN_X + x, HORN_Y + y, HORN_Z + z)
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.box(0, 0, 0, 1, 4, 1, stretch)
|
||||
.rotateAngleX = 0.5F;
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.box(0, 0, 0, 1, 4, 1, stretch)
|
||||
.rotateAngleX = 0.5F;
|
||||
|
||||
glow.offset(HORN_X + x, HORN_Y + y, HORN_Z + z)
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.setAlpha(0.4f).box(0, 0, 0, 1, 4, 1, stretch + 0.5F)
|
||||
.setAlpha(0.2f).box(0, 0, 0, 1, 3, 1, stretch + 0.8F);
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.setAlpha(0.4f).box(0, 0, 0, 1, 4, 1, stretch + 0.5F)
|
||||
.setAlpha(0.2f).box(0, 0, 0, 1, 3, 1, stretch + 0.8F);
|
||||
}
|
||||
|
||||
public void render(float scale) {
|
||||
|
|
|
@ -33,13 +33,13 @@ public class ModelZebra extends ModelEarthPony {
|
|||
bipedHead.addChild(bristles);
|
||||
|
||||
bristles.offset(-1, -1, -3)
|
||||
.box(0, -10, 2, 2, 6, 2, stretch)
|
||||
.box(0, -10, 4, 2, 8, 2, stretch)
|
||||
.box(0, -8, 6, 2, 6, 2, stretch)
|
||||
.rotateAngleX = 0.3F;
|
||||
.box(0, -10, 2, 2, 6, 2, stretch)
|
||||
.box(0, -10, 4, 2, 8, 2, stretch)
|
||||
.box(0, -8, 6, 2, 6, 2, stretch)
|
||||
.rotateAngleX = 0.3F;
|
||||
bristles.child(0).offset(-1.01F, 2, -7) //0.01 to prevent z-fighting
|
||||
.box(0, -10, 4, 2, 8, 2, stretch)
|
||||
.box(0, -8, 6, 2, 6, 2, stretch)
|
||||
.rotateAngleX = -1F;
|
||||
.box(0, -10, 4, 2, 8, 2, stretch)
|
||||
.box(0, -8, 6, 2, 6, 2, stretch)
|
||||
.rotateAngleX = -1F;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ public class ModelIllagerPony extends ModelAlicorn {
|
|||
bipedLeftArm.rotateAngleX -= sin;
|
||||
} else if (pose == IllagerArmPose.SPELLCASTING) {
|
||||
// waving arms!
|
||||
// this.bipedRightArm.rotationPointZ = 0;
|
||||
// this.bipedRightArm.rotationPointZ = 0;
|
||||
arm.rotateAngleX = (float) (-.75F * Math.PI);
|
||||
arm.rotateAngleZ = mult * MathHelper.cos(ticks * 0.6662F) / 4;
|
||||
arm.rotateAngleY = mult * 1.1F;
|
||||
|
|
|
@ -41,7 +41,7 @@ public class ModelSeapony extends ModelUnicorn {
|
|||
|
||||
leftFin = new PlaneRenderer(this, 56, 16)
|
||||
.rotate(0, FIN_ROTY, 0).around(3, -6, 3)
|
||||
.flipZ().addEastPlane(0, 0, 0, 12, 8, stretch);
|
||||
.flipZ().addEastPlane(0, 0, 0, 12, 8, stretch);
|
||||
|
||||
rightFin = new PlaneRenderer(this, 56, 16)
|
||||
.rotate(0, -FIN_ROTY, 0).around(-3, -6, 3)
|
||||
|
|
|
@ -42,24 +42,33 @@ public class ModelSkeletonPony extends ModelMobPony {
|
|||
super.setLivingAnimations(entity, move, swing, ticks);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float getLegOutset() {
|
||||
if (isSleeping()) return 2.6f;
|
||||
if (isCrouching()) return 0;
|
||||
if (isSleeping()) {
|
||||
return 2.6f;
|
||||
}
|
||||
if (isCrouching()) {
|
||||
return 0;
|
||||
}
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getArmWidth() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getArmDepth() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float getLegRotationX() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float getArmRotationY() {
|
||||
return 8;
|
||||
}
|
||||
|
|
|
@ -70,12 +70,12 @@ public class ModelVillagerPony extends ModelAlicorn {
|
|||
saddlebags.init(yOffset, stretch);
|
||||
|
||||
apron = new PlaneRenderer(this, 56, 16)
|
||||
.offset(BODY_CENTRE_X, BODY_CENTRE_Y, BODY_CENTRE_Z)
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.addBackPlane(-4, -4, -9, 8, 10, stretch);
|
||||
.offset(BODY_CENTRE_X, BODY_CENTRE_Y, BODY_CENTRE_Z)
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.addBackPlane(-4, -4, -9, 8, 10, stretch);
|
||||
trinket = new PlaneRenderer(this, 0, 3)
|
||||
.offset(BODY_CENTRE_X, BODY_CENTRE_Y, BODY_CENTRE_Z)
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.addBackPlane(-2, -4, -9, 4, 5, stretch);
|
||||
.offset(BODY_CENTRE_X, BODY_CENTRE_Y, BODY_CENTRE_Z)
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.addBackPlane(-2, -4, -9, 4, 5, stretch);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,8 +26,9 @@ public class ModelWitchPony extends ModelZebra {
|
|||
super(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLivingAnimations(EntityLivingBase entity, float move, float swing, float ticks) {
|
||||
EntityWitch witch = ((EntityWitch) entity);
|
||||
EntityWitch witch = (EntityWitch) entity;
|
||||
|
||||
leftArmPose = ArmPose.EMPTY;
|
||||
rightArmPose = witch.getHeldItemMainhand().isEmpty() ? ArmPose.EMPTY : ArmPose.ITEM;
|
||||
|
@ -48,8 +49,12 @@ public class ModelWitchPony extends ModelZebra {
|
|||
|
||||
if (rightArmPose != ArmPose.EMPTY) {
|
||||
float rot = (float)(Math.tan(ticks / 7) + Math.sin(ticks / 3));
|
||||
if (rot > 1) rot = 1;
|
||||
if (rot < -1) rot = -1;
|
||||
if (rot > 1) {
|
||||
rot = 1;
|
||||
}
|
||||
if (rot < -1) {
|
||||
rot = -1;
|
||||
}
|
||||
|
||||
float legDrinkingAngle = -1 * PI/3 + rot;
|
||||
|
||||
|
@ -60,7 +65,9 @@ public class ModelWitchPony extends ModelZebra {
|
|||
bipedRightArm.offsetZ = 0.1f;
|
||||
bipedRightArmwear.offsetZ = 0.1f;
|
||||
|
||||
if (rot > 0) rot = 0;
|
||||
if (rot > 0) {
|
||||
rot = 0;
|
||||
}
|
||||
|
||||
bipedHead.rotateAngleX = -rot / 2;
|
||||
bipedHeadwear.rotateAngleX = -rot / 2;
|
||||
|
@ -88,15 +95,15 @@ public class ModelWitchPony extends ModelZebra {
|
|||
super.init(yOffset, stretch);
|
||||
witchHat = new PonyRenderer(this).size(64, 128);
|
||||
witchHat.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z - 2)
|
||||
.tex(0, 64).box(-5, -6, -7, 10, 2, 10, stretch)
|
||||
.child(0).around(1.75F, -4, 2)
|
||||
.tex(0, 76).box(-5, -5, -7, 7, 4, 7, stretch)
|
||||
.rotate(-0.05235988F, 0, 0.02617994F)
|
||||
.child(0).around(1.75F, -4, 2)
|
||||
.tex(0, 87).box(-5, -4, -7, 4, 4, 4, stretch)
|
||||
.rotate(-0.10471976F, 0, 0.05235988F)
|
||||
.child(0).around(1.75F, -2, 2)
|
||||
.tex(0, 95).box(-5, -2, -7, 1, 2, 1, stretch)
|
||||
.rotate(-0.20943952F, 0, 0.10471976F);
|
||||
.tex(0, 64).box(-5, -6, -7, 10, 2, 10, stretch)
|
||||
.child(0).around(1.75F, -4, 2)
|
||||
.tex(0, 76).box(-5, -5, -7, 7, 4, 7, stretch)
|
||||
.rotate(-0.05235988F, 0, 0.02617994F)
|
||||
.child(0).around(1.75F, -4, 2)
|
||||
.tex(0, 87).box(-5, -4, -7, 4, 4, 4, stretch)
|
||||
.rotate(-0.10471976F, 0, 0.05235988F)
|
||||
.child(0).around(1.75F, -2, 2)
|
||||
.tex(0, 95).box(-5, -2, -7, 1, 2, 1, stretch)
|
||||
.rotate(-0.20943952F, 0, 0.10471976F);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue