-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add trial spawner and ominous vault. (#1727)
* Add ominous vault. * Add trial spawner.
- Loading branch information
Showing
6 changed files
with
210 additions
and
17 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
19 changes: 19 additions & 0 deletions
19
chunky/src/java/se/llbit/chunky/block/minecraft/TrialSpawner.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,19 @@ | ||
package se.llbit.chunky.block.minecraft; | ||
|
||
import se.llbit.chunky.block.AbstractModelBlock; | ||
import se.llbit.chunky.model.minecraft.TrialSpawnerModel; | ||
|
||
public class TrialSpawner extends AbstractModelBlock { | ||
private final String description; | ||
|
||
public TrialSpawner(boolean ominous, String trialSpawnerState) { | ||
super("trial_spawner", TrialSpawnerModel.getTopTexture(ominous, trialSpawnerState)); | ||
this.description = "ominous=" + ominous + ", trial_spawner_state=" + trialSpawnerState; | ||
this.model = new TrialSpawnerModel(ominous, trialSpawnerState); | ||
} | ||
|
||
@Override | ||
public String description() { | ||
return description; | ||
} | ||
} |
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
135 changes: 135 additions & 0 deletions
135
chunky/src/java/se/llbit/chunky/model/minecraft/TrialSpawnerModel.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,135 @@ | ||
package se.llbit.chunky.model.minecraft; | ||
|
||
import se.llbit.chunky.model.QuadModel; | ||
import se.llbit.chunky.resources.Texture; | ||
import se.llbit.math.Quad; | ||
import se.llbit.math.Vector3; | ||
import se.llbit.math.Vector4; | ||
|
||
public class TrialSpawnerModel extends QuadModel { | ||
private static final Quad[] quads = new Quad[]{ | ||
new Quad( | ||
new Vector3(0 / 16.0, 16 / 16.0, 16 / 16.0), | ||
new Vector3(16 / 16.0, 16 / 16.0, 16 / 16.0), | ||
new Vector3(0 / 16.0, 16 / 16.0, 0 / 16.0), | ||
new Vector4(0 / 16.0, 16 / 16.0, 0 / 16.0, 16 / 16.0) | ||
), | ||
new Quad( | ||
new Vector3(0 / 16.0, 0 / 16.0, 0 / 16.0), | ||
new Vector3(16 / 16.0, 0 / 16.0, 0 / 16.0), | ||
new Vector3(0 / 16.0, 0 / 16.0, 16 / 16.0), | ||
new Vector4(0 / 16.0, 16 / 16.0, 0 / 16.0, 16 / 16.0) | ||
), | ||
new Quad( | ||
new Vector3(0 / 16.0, 16 / 16.0, 16 / 16.0), | ||
new Vector3(0 / 16.0, 16 / 16.0, 0 / 16.0), | ||
new Vector3(0 / 16.0, 0 / 16.0, 16 / 16.0), | ||
new Vector4(16 / 16.0, 0 / 16.0, 16 / 16.0, 0 / 16.0) | ||
), | ||
new Quad( | ||
new Vector3(16 / 16.0, 16 / 16.0, 0 / 16.0), | ||
new Vector3(16 / 16.0, 16 / 16.0, 16 / 16.0), | ||
new Vector3(16 / 16.0, 0 / 16.0, 0 / 16.0), | ||
new Vector4(16 / 16.0, 0 / 16.0, 16 / 16.0, 0 / 16.0) | ||
), | ||
new Quad( | ||
new Vector3(0 / 16.0, 16 / 16.0, 0 / 16.0), | ||
new Vector3(16 / 16.0, 16 / 16.0, 0 / 16.0), | ||
new Vector3(0 / 16.0, 0 / 16.0, 0 / 16.0), | ||
new Vector4(16 / 16.0, 0 / 16.0, 16 / 16.0, 0 / 16.0) | ||
), | ||
new Quad( | ||
new Vector3(16 / 16.0, 16 / 16.0, 16 / 16.0), | ||
new Vector3(0 / 16.0, 16 / 16.0, 16 / 16.0), | ||
new Vector3(16 / 16.0, 0 / 16.0, 16 / 16.0), | ||
new Vector4(16 / 16.0, 0 / 16.0, 16 / 16.0, 0 / 16.0) | ||
), | ||
new Quad( | ||
new Vector3(15.998 / 16.0, 15.998 / 16.0, 15.998 / 16.0), | ||
new Vector3(0.002 / 16.0, 15.998 / 16.0, 15.998 / 16.0), | ||
new Vector3(15.998 / 16.0, 15.998 / 16.0, 0.002 / 16.0), | ||
new Vector4(16 / 16.0, 0 / 16.0, 0 / 16.0, 16 / 16.0) | ||
), | ||
new Quad( | ||
new Vector3(15.998 / 16.0, 0.002 / 16.0, 0.002 / 16.0), | ||
new Vector3(0.002 / 16.0, 0.002 / 16.0, 0.002 / 16.0), | ||
new Vector3(15.998 / 16.0, 0.002 / 16.0, 15.998 / 16.0), | ||
new Vector4(16 / 16.0, 0 / 16.0, 0 / 16.0, 16 / 16.0) | ||
), | ||
new Quad( | ||
new Vector3(15.998 / 16.0, 15.998 / 16.0, 15.998 / 16.0), | ||
new Vector3(15.998 / 16.0, 15.998 / 16.0, 0.002 / 16.0), | ||
new Vector3(15.998 / 16.0, 0.002 / 16.0, 15.998 / 16.0), | ||
new Vector4(0 / 16.0, 16 / 16.0, 16 / 16.0, 0 / 16.0) | ||
), | ||
new Quad( | ||
new Vector3(0.002 / 16.0, 15.998 / 16.0, 0.002 / 16.0), | ||
new Vector3(0.002 / 16.0, 15.998 / 16.0, 15.998 / 16.0), | ||
new Vector3(0.002 / 16.0, 0.002 / 16.0, 0.002 / 16.0), | ||
new Vector4(0 / 16.0, 16 / 16.0, 16 / 16.0, 0 / 16.0) | ||
), | ||
new Quad( | ||
new Vector3(15.998 / 16.0, 15.998 / 16.0, 0.002 / 16.0), | ||
new Vector3(0.002 / 16.0, 15.998 / 16.0, 0.002 / 16.0), | ||
new Vector3(15.998 / 16.0, 0.002 / 16.0, 0.002 / 16.0), | ||
new Vector4(0 / 16.0, 16 / 16.0, 16 / 16.0, 0 / 16.0) | ||
), | ||
new Quad( | ||
new Vector3(0.002 / 16.0, 15.998 / 16.0, 15.998 / 16.0), | ||
new Vector3(15.998 / 16.0, 15.998 / 16.0, 15.998 / 16.0), | ||
new Vector3(0.002 / 16.0, 0.002 / 16.0, 15.998 / 16.0), | ||
new Vector4(0 / 16.0, 16 / 16.0, 16 / 16.0, 0 / 16.0) | ||
) | ||
}; | ||
|
||
private final Texture[] textures; | ||
|
||
public TrialSpawnerModel( | ||
boolean ominous, String trialSpawnerState | ||
) { | ||
Texture top = getTopTexture(ominous, trialSpawnerState); | ||
Texture bottom = Texture.trialSpawnerBottom; | ||
Texture side; | ||
switch (trialSpawnerState) { | ||
case "active": | ||
case "waiting_for_players": | ||
case "waiting_for_reward_ejection": | ||
case "ejecting_reward": | ||
side = ominous ? Texture.trialSpawnerSideActiveOminous : Texture.trialSpawnerSideActive; | ||
break; | ||
case "inactive": | ||
case "cooldown": | ||
default: | ||
side = ominous ? Texture.trialSpawnerSideInactiveOminous : Texture.trialSpawnerSideInactive; | ||
break; | ||
} | ||
textures = new Texture[]{ | ||
top, bottom, side, side, side, side, top, bottom, side, side, side, side | ||
}; | ||
} | ||
|
||
public static Texture getTopTexture(boolean ominous, String trialSpawnerState) { | ||
switch (trialSpawnerState) { | ||
case "active": | ||
case "waiting_for_players": | ||
case "waiting_for_reward_ejection": | ||
return ominous ? Texture.trialSpawnerTopActiveOminous : Texture.trialSpawnerTopActive; | ||
case "ejecting_reward": | ||
return ominous ? Texture.trialSpawnerTopEjectingRewardOminous : Texture.trialSpawnerTopEjectingReward; | ||
case "inactive": | ||
case "cooldown": | ||
default: | ||
return ominous ? Texture.trialSpawnerTopInactiveOminous : Texture.trialSpawnerTopInactive; | ||
} | ||
} | ||
|
||
@Override | ||
public Quad[] getQuads() { | ||
return quads; | ||
} | ||
|
||
@Override | ||
public Texture[] getTextures() { | ||
return textures; | ||
} | ||
} |
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