mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 19:39:22 +00:00
Allow for modders to decide whether or not players are positioned on ridingEntities similarly to pigs PR #244
This commit is contained in:
1 parent
369f8ce38f
commit
2087b2b44e
2 files changed
+27
-1
No files matched your search
@@ -151,7 +151,7 @@
|
||||
/**
|
||||
* Remove the speified potion effect from this entity.
|
||||
*/
|
||||
@@ -2861,4 +2906,30 @@
|
||||
@@ -2861,4 +2906,42 @@
|
||||
{
|
||||
this.dataWatcher.updateObject(10, Byte.valueOf((byte)par1));
|
||||
}
|
||||
@@ -180,5 +180,17 @@
|
||||
+ onFinishedPotionEffect(effect);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns true if the entity's rider (EntityPlayer) should face forward when mounted.
|
||||
+ * currently only used in vanilla code by pigs.
|
||||
+ *
|
||||
+ * @param player The player who is riding the entity.
|
||||
+ * @return If the player should orient the same direction as this entity.
|
||||
+ */
|
||||
+ public boolean shouldRiderFaceForward(EntityPlayer player)
|
||||
+ {
|
||||
+ return this instanceof EntityPig;
|
||||
+ }
|
||||
}
|
||||
@@ -26,6 +26,20 @@
|
||||
if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0)
|
||||
{
|
||||
this.updateItemUse(var1, 5);
|
||||
@@ -448,11 +460,11 @@
|
||||
this.cameraYaw = 0.0F;
|
||||
this.addMountedMovementStat(this.posX - var1, this.posY - var3, this.posZ - var5);
|
||||
|
||||
- if (this.ridingEntity instanceof EntityPig)
|
||||
+ if (this.ridingEntity instanceof EntityLiving && ((EntityLiving)ridingEntity).shouldRiderFaceForward(this))
|
||||
{
|
||||
this.rotationPitch = var8;
|
||||
this.rotationYaw = var7;
|
||||
- this.renderYawOffset = ((EntityPig)this.ridingEntity).renderYawOffset;
|
||||
+ this.renderYawOffset = ((EntityLiving)this.ridingEntity).renderYawOffset;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -575,6 +587,9 @@
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
this.motionY = 0.10000000149011612D;
|
||||
|
||||
Reference in new issue
Block a user