Java Code Examples for net.minecraft.client.model.ModelBiped#setInvisible()

The following examples show how to use net.minecraft.client.model.ModelBiped#setInvisible() . 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: TwoPartLayerBipedArmor.java    From Hyperium with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * The only method which is edited. Shows some more model te make everything
 * render properly.
 *
 * @param model     The model which gets rendered
 * @param armorSlot The slot of the armor (1 = boots, 2 = leggins, etc..). Don't ask
 *                  me why it doesn't start at 0.
 * @author 9Y0
 */
protected void setModelPartVisible(ModelBiped model, int armorSlot) {
    model.setInvisible(false);
    IMixinModelBiped modelBiped = (IMixinModelBiped) model;

    switch (armorSlot) {
        case 1: {
            model.bipedRightLeg.showModel = true;
            model.bipedLeftLeg.showModel = true;
            modelBiped.getBipedRightLowerLeg().showModel = true;
            modelBiped.getBipedLeftLowerLeg().showModel = true;
            break;
        }
        case 2: {
            model.bipedBody.showModel = true;
            model.bipedRightLeg.showModel = true;
            model.bipedLeftLeg.showModel = true;
            modelBiped.getBipedRightLowerLeg().showModel = true;
            modelBiped.getBipedLeftLowerLeg().showModel = true;
            break;
        }
        case 3: {
            model.bipedBody.showModel = true;
            model.bipedRightArm.showModel = true;
            model.bipedLeftArm.showModel = true;
            modelBiped.getBipedRightForeArm().showModel = true;
            modelBiped.getBipedLeftForeArm().showModel = true;
            break;
        }
        case 4: {
            model.bipedHead.showModel = true;
            model.bipedHeadwear.showModel = true;
            break;
        }
    }
}