-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
72 changed files
with
1,196 additions
and
70,906 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
153 changes: 75 additions & 78 deletions
153
common/src/main/java/whocraft/tardis_refined/client/ModelRegistry.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 0 additions & 77 deletions
77
.../whocraft/tardis_refined/client/model/blockentity/door/interior/CastleShellDoorModel.java
This file was deleted.
Oops, something went wrong.
83 changes: 0 additions & 83 deletions
83
...java/whocraft/tardis_refined/client/model/blockentity/door/interior/DrifterDoorModel.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
...craft/tardis_refined/client/model/blockentity/door/interior/DualTexInteriorDoorModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package whocraft.tardis_refined.client.model.blockentity.door.interior; | ||
|
||
|
||
import com.mojang.blaze3d.vertex.PoseStack; | ||
import com.mojang.blaze3d.vertex.VertexConsumer; | ||
import dev.jeryn.anim.tardis.JsonToAnimationDefinition; | ||
import net.minecraft.client.model.geom.ModelPart; | ||
import net.minecraft.world.entity.Entity; | ||
import whocraft.tardis_refined.common.blockentity.door.GlobalDoorBlockEntity; | ||
import whocraft.tardis_refined.compat.ModCompatChecker; | ||
import whocraft.tardis_refined.compat.portals.ImmersivePortalsClient; | ||
|
||
public class DualTexInteriorDoorModel extends ShellDoorModel { | ||
|
||
private final ModelPart root; | ||
public final ModelPart open_door; | ||
public final ModelPart closed_door; | ||
private final ModelPart portal; | ||
private final ModelPart frame; | ||
|
||
public DualTexInteriorDoorModel(ModelPart root) { | ||
this.root = root; | ||
this.open_door = JsonToAnimationDefinition.findPart(this, "door_open"); | ||
this.closed_door = JsonToAnimationDefinition.findPart(this, "door_closed"); | ||
this.frame = JsonToAnimationDefinition.findPart(this, "frame"); | ||
this.portal = JsonToAnimationDefinition.findPart(this, "portal"); | ||
} | ||
|
||
|
||
@Override | ||
public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { | ||
this.root().getAllParts().forEach(ModelPart::resetPose); | ||
this.portal.visible = false; | ||
this.root().render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); | ||
} | ||
|
||
@Override | ||
public void renderFrame(GlobalDoorBlockEntity doorBlockEntity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { | ||
this.root().getAllParts().forEach(ModelPart::resetPose); | ||
setDoorPosition(open); | ||
this.root().getAllParts().forEach(modelPart -> { | ||
modelPart.visible = true; | ||
}); | ||
this.portal.visible = false; | ||
closed_door.visible = !open; | ||
open_door.visible = open; | ||
this.root().render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); | ||
} | ||
|
||
@Override | ||
public void renderPortalMask(GlobalDoorBlockEntity doorBlockEntity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { | ||
|
||
if (ModCompatChecker.immersivePortals()) { | ||
if (ImmersivePortalsClient.shouldStopRenderingInPortal()) { | ||
return; | ||
} | ||
} | ||
|
||
this.root().getAllParts().forEach(ModelPart::resetPose); | ||
setDoorPosition(open); | ||
this.root().getAllParts().forEach(modelPart -> modelPart.visible = false); | ||
this.portal.visible = true; | ||
portal.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); | ||
} | ||
|
||
@Override | ||
public ModelPart root() { | ||
return root; | ||
} | ||
|
||
@Override | ||
public void setupAnim(Entity entity, float f, float g, float h, float i, float j) { | ||
|
||
} | ||
|
||
@Override | ||
public void setDoorPosition(boolean open) { | ||
// No OP | ||
} | ||
|
||
} |
Oops, something went wrong.