net.minecraft.client.model.ModelPlayer Java Examples

The following examples show how to use net.minecraft.client.model.ModelPlayer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HyperiumRenderPlayer.java    From Hyperium with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void onUpdateTimer() {
    ModelPlayer modelplayer = parent.getMainModel();
    modelplayer.isRiding = modelplayer.isSneak = false;
}
 
Example #2
Source File: MixinRenderPlayer.java    From Hyperium with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Shadow
public abstract ModelPlayer getMainModel();
 
Example #3
Source File: BloodRenderLayer.java    From Wizardry with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void setModelVisibilities(AbstractClientPlayer clientPlayer) {
	ModelPlayer modelplayer = render.getMainModel();

	if (clientPlayer.isSpectator()) {
		modelplayer.setVisible(true);
		modelplayer.bipedHead.showModel = true;
		modelplayer.bipedHeadwear.showModel = true;
	} else {
		ItemStack stackMain = clientPlayer.getHeldItemMainhand();
		ItemStack stackOff = clientPlayer.getHeldItemOffhand();
		modelplayer.setVisible(false);
		modelplayer.bipedHeadwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.HAT);
		modelplayer.bipedBodyWear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.JACKET);
		modelplayer.bipedLeftLegwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.LEFT_PANTS_LEG);
		modelplayer.bipedRightLegwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.RIGHT_PANTS_LEG);
		modelplayer.bipedLeftArmwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.LEFT_SLEEVE);
		modelplayer.bipedRightArmwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.RIGHT_SLEEVE);
		modelplayer.isSneak = clientPlayer.isSneaking();
		ArmPose poseMain = ArmPose.EMPTY;

		if (!stackMain.isEmpty()) {
			poseMain = ArmPose.ITEM;

			if (clientPlayer.getItemInUseCount() > 0) {
				EnumAction enumaction = stackMain.getItemUseAction();

				if (enumaction == EnumAction.BLOCK) {
					poseMain = ArmPose.BLOCK;
				} else if (enumaction == EnumAction.BOW) {
					poseMain = ArmPose.BOW_AND_ARROW;
				}
			}
		}

		ArmPose poseOff = ArmPose.EMPTY;
		if (!stackOff.isEmpty()) {
			poseOff = ArmPose.ITEM;

			if (clientPlayer.getItemInUseCount() > 0) {
				EnumAction enumaction1 = stackOff.getItemUseAction();

				if (enumaction1 == EnumAction.BLOCK) {
					poseOff = ArmPose.BLOCK;
				}
			}
		}

		if (clientPlayer.getPrimaryHand() == EnumHandSide.RIGHT) {
			modelplayer.rightArmPose = poseMain;
			modelplayer.leftArmPose = poseOff;
		} else {
			modelplayer.rightArmPose = poseOff;
			modelplayer.leftArmPose = poseMain;
		}
	}
}
 
Example #4
Source File: RenderPlayerCyberware.java    From Cyberware with MIT License 4 votes vote down vote up
public void setMainModel(ModelPlayer m)
{
	this.mainModel = m;
}
 
Example #5
Source File: RenderPlayerCyberware.java    From Cyberware with MIT License 4 votes vote down vote up
private void setModelVisibilities(AbstractClientPlayer clientPlayer)
{
	ModelPlayer modelplayer = this.getMainModel();

	if (clientPlayer.isSpectator())
	{
		modelplayer.setInvisible(false);
		modelplayer.bipedHead.showModel = true;
		modelplayer.bipedHeadwear.showModel = true;
	}
	else
	{
		ItemStack itemstack = clientPlayer.getHeldItemMainhand();
		ItemStack itemstack1 = clientPlayer.getHeldItemOffhand();
		modelplayer.setInvisible(true);
		modelplayer.bipedHeadwear.showModel = modelplayer.bipedHead.isHidden ? false : clientPlayer.isWearing(EnumPlayerModelParts.HAT);
		modelplayer.bipedBodyWear.showModel = modelplayer.bipedBody.isHidden ? false : clientPlayer.isWearing(EnumPlayerModelParts.JACKET);
		modelplayer.bipedLeftLegwear.showModel = modelplayer.bipedLeftLeg.isHidden ? false : clientPlayer.isWearing(EnumPlayerModelParts.LEFT_PANTS_LEG);
		modelplayer.bipedRightLegwear.showModel = modelplayer.bipedRightLeg.isHidden ? false : clientPlayer.isWearing(EnumPlayerModelParts.RIGHT_PANTS_LEG);
		modelplayer.bipedLeftArmwear.showModel = modelplayer.bipedLeftArm.isHidden ? false : clientPlayer.isWearing(EnumPlayerModelParts.LEFT_SLEEVE);
		modelplayer.bipedRightArmwear.showModel = modelplayer.bipedRightArm.isHidden ? false :clientPlayer.isWearing(EnumPlayerModelParts.RIGHT_SLEEVE);
		modelplayer.isSneak = clientPlayer.isSneaking();
		ModelBiped.ArmPose modelbiped$armpose = ModelBiped.ArmPose.EMPTY;
		ModelBiped.ArmPose modelbiped$armpose1 = ModelBiped.ArmPose.EMPTY;

		if (itemstack != null)
		{
			modelbiped$armpose = ModelBiped.ArmPose.ITEM;

			if (clientPlayer.getItemInUseCount() > 0)
			{
				EnumAction enumaction = itemstack.getItemUseAction();

				if (enumaction == EnumAction.BLOCK)
				{
					modelbiped$armpose = ModelBiped.ArmPose.BLOCK;
				}
				else if (enumaction == EnumAction.BOW)
				{
					modelbiped$armpose = ModelBiped.ArmPose.BOW_AND_ARROW;
				}
			}
		}

		if (itemstack1 != null)
		{
			modelbiped$armpose1 = ModelBiped.ArmPose.ITEM;

			if (clientPlayer.getItemInUseCount() > 0)
			{
				EnumAction enumaction1 = itemstack1.getItemUseAction();

				if (enumaction1 == EnumAction.BLOCK)
				{
					modelbiped$armpose1 = ModelBiped.ArmPose.BLOCK;
				}
			}
		}

		if (clientPlayer.getPrimaryHand() == EnumHandSide.RIGHT)
		{
			modelplayer.rightArmPose = modelbiped$armpose;
			modelplayer.leftArmPose = modelbiped$armpose1;
		}
		else
		{
			modelplayer.rightArmPose = modelbiped$armpose1;
			modelplayer.leftArmPose = modelbiped$armpose;
		}
	}
}