Update mappings

This commit is contained in:
Matthew Messinger 2016-11-22 16:13:24 -05:00
parent bd597bbf1b
commit 945996cfa4
7 changed files with 42 additions and 24 deletions

2
.gitignore vendored
View file

@ -9,3 +9,5 @@ run/
/.apt_generated/ /.apt_generated/
.factorypath .factorypath
logs/ logs/
.idea/
classes/

View file

@ -31,7 +31,8 @@ description = 'Mine Little Pony'
minecraft { minecraft {
version = "1.11" version = "1.11"
mappings = 'snapshot_20161116' // first snapshot for 1.11. Change to stable when possible.
mappings = 'snapshot_20161120'
runDir = 'run' runDir = 'run'
replace '@VERSION@',project.version replace '@VERSION@',project.version
} }

View file

@ -57,7 +57,7 @@ public abstract class MixinRenderPlayer extends RenderLivingBase<AbstractClientP
this.layerRenderers.clear(); this.layerRenderers.clear();
this.addLayer(new LayerPonyArmor(this)); this.addLayer(new LayerPonyArmor(this));
this.addLayer(new LayerHeldPonyItem(this)); this.addLayer(new LayerHeldPonyItem<AbstractClientPlayer>(this));
this.addLayer(new LayerArrow(this)); this.addLayer(new LayerArrow(this));
this.addLayer(new LayerPonyCape(this)); this.addLayer(new LayerPonyCape(this));
this.addLayer(new LayerPonySkull(this)); this.addLayer(new LayerPonySkull(this));
@ -95,7 +95,7 @@ public abstract class MixinRenderPlayer extends RenderLivingBase<AbstractClientP
} }
@Inject( @Inject(
method = "renderLivingAt", method = "renderLivingAt(Lnet/minecraft/client/entity/AbstractClientPlayer;DDD)V",
at = @At("RETURN")) at = @At("RETURN"))
private void setupPlayerScale(AbstractClientPlayer player, double xPosition, double yPosition, double zPosition, CallbackInfo ci) { private void setupPlayerScale(AbstractClientPlayer player, double xPosition, double yPosition, double zPosition, CallbackInfo ci) {
@ -169,16 +169,17 @@ public abstract class MixinRenderPlayer extends RenderLivingBase<AbstractClientP
} }
@Inject( @Inject(
method = "rotateCorpse(Lnet/minecraft/client/entity/AbstractClientPlayer;FFF)V", method = "applyRotations(Lnet/minecraft/client/entity/AbstractClientPlayer;FFF)V",
at = @At( at = @At(
value = "INVOKE", value = "INVOKE",
target = "Lnet/minecraft/client/renderer/entity/RenderLivingBase;" target = "Lnet/minecraft/client/renderer/entity/RenderLivingBase;"
+ "rotateCorpse(Lnet/minecraft/entity/EntityLivingBase;FFF)V", + "applyRotations(Lnet/minecraft/entity/EntityLivingBase;FFF)V",
ordinal = 1, ordinal = 1,
shift = Shift.AFTER)) shift = Shift.AFTER))
private void onRotateCorpse(AbstractClientPlayer player, float yaw, float pitch, float ticks, CallbackInfo ci) { private void onRotateCorpse(AbstractClientPlayer player, float yaw, float pitch, float ticks, CallbackInfo ci) {
if (this.mainModel instanceof ModelPlayerPony) { if (this.mainModel instanceof ModelPlayerPony) {
// require arms to be stretched out (sorry mud ponies, no flight skills for you) // require arms to be stretched out (sorry mud ponies, no flight
// skills for you)
if (!((ModelPlayerPony) this.mainModel).rainboom) { if (!((ModelPlayerPony) this.mainModel).rainboom) {
this.playerModel.getModel().motionPitch = 0; this.playerModel.getModel().motionPitch = 0;
return; return;
@ -212,7 +213,7 @@ public abstract class MixinRenderPlayer extends RenderLivingBase<AbstractClientP
} }
@Redirect( @Redirect(
method = "rotateCorpse(Lnet/minecraft/client/entity/AbstractClientPlayer;FFF)V", method = "applyRotations(Lnet/minecraft/client/entity/AbstractClientPlayer;FFF)V",
at = @At( at = @At(
value = "INVOKE", value = "INVOKE",
target = "Lnet/minecraft/client/renderer/GlStateManager;rotate(FFFF)V", target = "Lnet/minecraft/client/renderer/GlStateManager;rotate(FFFF)V",

View file

@ -27,7 +27,7 @@ public class RenderPonyVex extends RenderBiped<EntityVex> {
@Override @Override
protected ResourceLocation getEntityTexture(EntityVex entity) { protected ResourceLocation getEntityTexture(EntityVex entity) {
return entity.func_190647_dj() ? VEX_CHARGING : VEX; return entity.isCharging() ? VEX_CHARGING : VEX;
} }
} }

View file

@ -3,6 +3,7 @@ package com.minelittlepony.renderer;
import com.minelittlepony.MineLittlePony; import com.minelittlepony.MineLittlePony;
import com.minelittlepony.model.PMAPI; import com.minelittlepony.model.PMAPI;
import com.minelittlepony.model.pony.ModelVillagerPony; import com.minelittlepony.model.pony.ModelVillagerPony;
import com.minelittlepony.util.Villagers;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;
@ -45,17 +46,17 @@ public class RenderPonyVillager extends RenderPonyMob<EntityVillager> {
private ResourceLocation getTextureForVillager(EntityVillager villager) { private ResourceLocation getTextureForVillager(EntityVillager villager) {
switch (villager.getProfession()) { switch (villager.getProfession()) {
case 0: case Villagers.FARMER:
return FARMER; return FARMER;
case 1: case Villagers.LIBRARIAN:
return LIBRARIAN; return LIBRARIAN;
case 2: case Villagers.PRIEST:
return PRIEST; return PRIEST;
case 3: case Villagers.BLACKSMITH:
return SMITH; return SMITH;
case 4: case Villagers.BUTCHER:
return BUTCHER; return BUTCHER;
case 5: case Villagers.GENERIC:
default: default:
return GENERIC; return GENERIC;
} }

View file

@ -1,6 +1,7 @@
package com.minelittlepony.renderer; package com.minelittlepony.renderer;
import com.minelittlepony.model.PMAPI; import com.minelittlepony.model.PMAPI;
import com.minelittlepony.util.Villagers;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.monster.EntityZombieVillager; import net.minecraft.entity.monster.EntityZombieVillager;
@ -25,29 +26,29 @@ public class RenderPonyZombieVillager extends RenderPonyMob<EntityZombieVillager
} }
private ResourceLocation getTextureForVillager(EntityZombieVillager villager) { private ResourceLocation getTextureForVillager(EntityZombieVillager villager) {
switch (villager.func_190736_dl()) { switch (villager.getProfession()) { // getProfession
case 0: case Villagers.FARMER:
return FARMER; // applejack return FARMER; // applejack
case 1: case Villagers.LIBRARIAN:
return LIBRARIAN; // twilight sparkle return LIBRARIAN; // twilight sparkle
case 2: case Villagers.PRIEST:
return PRIEST; // fluttershy return PRIEST; // fluttershy
case 3: case Villagers.BLACKSMITH:
return SMITH; // rarity return SMITH; // rarity
case 4: case Villagers.BUTCHER:
return BUTCHER; // rainbow dash return BUTCHER; // rainbow dash
case 5: case Villagers.GENERIC:
default: default:
return GENERIC; // pinkie pie return GENERIC; // pinkie pie
} }
} }
@Override @Override
protected void rotateCorpse(EntityZombieVillager villager, float p_77043_2_, float p_77043_3_, float partialTicks) { protected void applyRotations(EntityZombieVillager villager, float p_77043_2_, float p_77043_3_, float partialTicks) {
if (villager.isConverting()) { if (villager.isConverting()) {
p_77043_3_ += (float) (Math.cos(villager.ticksExisted * 3.25D) * Math.PI * 0.25D); p_77043_3_ += (float) (Math.cos(villager.ticksExisted * 3.25D) * Math.PI * 0.25D);
} }
super.rotateCorpse(villager, p_77043_2_, p_77043_3_, partialTicks); super.applyRotations(villager, p_77043_2_, p_77043_3_, partialTicks);
} }
} }

View file

@ -0,0 +1,12 @@
package com.minelittlepony.util;
public interface Villagers {
int FARMER = 0;
int LIBRARIAN = 1;
int PRIEST = 2;
int BLACKSMITH = 3;
int BUTCHER = 4;
int GENERIC = 5;
}