diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..60ff2b554 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,31 @@ +name: Publish to Maven Repository + +on: + push: + branches: + - minecraft/1.20 + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Set up JDK + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '17' + + - name: Make Gradlew Executable + run: chmod +x ./gradlew + + - name: Build and Publish + run: | + ./gradlew publish + + env: + MAVEN_REPO_USERNAME: ${{ secrets.MAVEN_REPO_USERNAME }} + MAVEN_REPO_PASSWORD: ${{ secrets.MAVEN_REPO_PASSWORD }} diff --git a/build.gradle b/build.gradle index baacdf526..863856a66 100644 --- a/build.gradle +++ b/build.gradle @@ -20,19 +20,37 @@ subprojects { minecraft "com.mojang:minecraft:${rootProject.minecraft_version}" mappings loom.layered() { officialMojangMappings() - // parchment("org.parchmentmc.data:parchment-${rootProject.mappings}") + // parchment("org.parchmentmc.data:parchment-${rootProject.mappings}") } implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2' } } +def gitHash = { -> + def stdout = new ByteArrayOutputStream() + exec { + commandLine 'git', 'rev-parse', '--short', 'HEAD' + standardOutput = stdout + } + return stdout.toString().trim() +} + +def gitBranch() { + def branch = "" + def proc = "git rev-parse --abbrev-ref HEAD".execute() + proc.in.eachLine { line -> branch = line } + proc.err.eachLine { line -> println line } + proc.waitFor() + branch +} + allprojects { apply plugin: "java" apply plugin: "architectury-plugin" apply plugin: "maven-publish" archivesBaseName = rootProject.jar_name - version = "${rootProject.minecraft_version}-${rootProject.mod_version}" + version = "${rootProject.minecraft_version}-${rootProject.mod_version}-${gitHash()}-${gitBranch()}" group = rootProject.maven_group repositories { @@ -51,6 +69,7 @@ allprojects { dirs '../modlibs' } + } tasks.withType(JavaCompile) { @@ -61,4 +80,4 @@ allprojects { java { withSourcesJar() } -} +} \ No newline at end of file diff --git a/changelog.md b/changelog.md new file mode 100644 index 000000000..866674989 --- /dev/null +++ b/changelog.md @@ -0,0 +1,88 @@ +## Upgrades +- ARS Tree now grows with the percentage of upgrades unlocked +- External Shell Configuration now locked behind Upgrades +- x1000 Increment now locked behind upgrades +- x2500 Increment now introduced and locked behind upgrades +- x5000 Increment now introduced and locked behind upgrades +- Added Waypoints +- Added Co-ordinate Input (This might make you lazy people happy, but you are going to hell and back to get it) +- Landing Pad now locked behind upgrades + +## Particles +#### Additions +- Added ARS Leaves Particles +- Crashed TARDIS now emits smokey particles as if room is overflowing with smoke +- Root Plant now emits particles when growing to indicate to the user that they are doing it correctly + +## Sounds +#### Updates +- Added ARS Room sound +- Added Destination Ding noise, plays when TARDIS initially starts landing +- TARDIS flight noise now loops via LoopingSound + +## Commands +#### Additions +- Introduced Upgrades command to unlock/lock TARDIS Upgrades +- Introduced Points command to set TARDIS xp/points + +## Shells +#### Updates +- Updated Police Box Shell Model +- Updated Factory Shell Model +#### Additions +- Added Lift Shell +- Added Hieroglyph +- Added Castle +#### Removals +- Removed Police Box "Marbles" Pattern due to Model Change +- Removed Police Box "Gaudy" Pattern due to Model Change +- Removed Police Box "Metal" Pattern due to Model Change +- Removed Police Box "Stone" Pattern due to Model Change +- Removed Police Box "Red" Pattern due to Model Change + +## Crafting +- Bulkhead doors can now be crafted + +## Consoles +#### Additions +- Updated all Toyota Pattern Textures +#### Updates +- Updated Nuka Default Pattern + +## Interiors +- Added Shalka Interior + +## TARDIS Growth Process +- Players must now use Shears to unlock the growth stage TARDIS + +## Rooms +- ARS Room is back under mod protection +- ARS Room Tree grows as the user upgrades their TARDIS (will degrow if addons add new upgrades as it is calculated with upgrade unlock percentage) + +## Immersive Portals (Fabric) +- Fixed bug where users could not leave via Immersive Portals portals due to a sizing issue + +## Quality of Life +- Interior doors and Shells now hold their own data instead of taking it from their related dimension +- Shell animations now play in Shell Selection Screen +- Sounds that loop are now handled differently, improving performance +- Root shell now only creates the TARDIS dimension when sheared (Hi Performance gains!) +- TARDIS interior is now air instead of growth stone + + +# Bugs +- Fix GlobalDoorBlock deleting the player held item when interacted with +- Fix unexpected behaviour with ConsoleConfigurator console removal logic and change theme +- Fixed console removal running the interaction twice and causing the configurator to change its console theme +- Fixed console changing not updating control positions and sizes +- Fixed various screens hard crashing the server +- Fixed BulkHeadDoor deleting blocks around it when placed, you can no longer place it unless there is enough room + + +## API +#### Additions +- Added TARDIS Upgrade Unlocked Event +- Allows other mods to add: Shells, Patterns, Desktops, Consoles, Upgrades + + + diff --git a/common/src/main/java/whocraft/tardis_refined/api/event/TardisEvents.java b/common/src/main/java/whocraft/tardis_refined/api/event/TardisEvents.java index ebc09376d..46046c3ad 100644 --- a/common/src/main/java/whocraft/tardis_refined/api/event/TardisEvents.java +++ b/common/src/main/java/whocraft/tardis_refined/api/event/TardisEvents.java @@ -7,9 +7,14 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelAccessor; import whocraft.tardis_refined.common.capability.TardisLevelOperator; +import whocraft.tardis_refined.common.capability.upgrades.Upgrade; +import whocraft.tardis_refined.common.entity.ControlEntity; import whocraft.tardis_refined.common.tardis.ExteriorShell; import whocraft.tardis_refined.common.tardis.TardisNavLocation; -import whocraft.tardis_refined.common.tardis.themes.ShellTheme; +import whocraft.tardis_refined.common.tardis.control.Control; + +import java.util.List; +import java.util.function.Function; public class TardisEvents { @@ -51,6 +56,37 @@ public class TardisEvents { } })); + public static final Event UPGRADE_UNLOCKED = new Event<>(UpgradeUnlocked.class, listeners -> ((tardisLevelOperator, upgrade) -> { + for (UpgradeUnlocked listener : listeners) { + listener.onUpgradeUnlock(tardisLevelOperator, upgrade); + } + })); + + + /** + * Represents an event that allows checking whether player control can be used. + */ + public static final Event PLAYER_CONTROL_INTERACT = new Event<>(CanControlBeUsed.class, listeners -> (tardisLevelOperator, control, controlEntity) -> Event.result(listeners, takeOff -> takeOff.canControlBeUsed(tardisLevelOperator, control, controlEntity))); + + + /** + * Functional interface to define the conditions for using player control. + */ + @FunctionalInterface + public interface CanControlBeUsed { + + /** + * Checks whether player control can be used based on specified parameters. + * + * @param tardisLevelOperator The Tardis level operator. + * @param control The control to be used. + * @param controlEntity The entity associated with the control. + * @return True if control can be used, false otherwise. + */ + EventResult canControlBeUsed(TardisLevelOperator tardisLevelOperator, Control control, ControlEntity controlEntity); + } + + /** * An event that is triggered when a TARDIS takes off. */ @@ -153,4 +189,18 @@ public interface TardisCrash { */ void onTardisCrash(TardisLevelOperator tardisLevelOperator, TardisNavLocation crashLocation); } + + /** + * An event that is triggered when a TARDIS unlocks a new Upgrade. + */ + @FunctionalInterface + public interface UpgradeUnlocked { + /** + * Called when a TARDIS unlocks a new Upgrade. + * + * @param tardisLevelOperator The TARDIS Level Operator. + * @param upgrade The Upgrade + */ + void onUpgradeUnlock(TardisLevelOperator tardisLevelOperator, Upgrade upgrade); + } } diff --git a/common/src/main/java/whocraft/tardis_refined/client/ModelRegistry.java b/common/src/main/java/whocraft/tardis_refined/client/ModelRegistry.java index bfbdcf78d..2a6601682 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/ModelRegistry.java +++ b/common/src/main/java/whocraft/tardis_refined/client/ModelRegistry.java @@ -6,11 +6,11 @@ import net.minecraft.resources.ResourceLocation; import whocraft.tardis_refined.TardisRefined; import whocraft.tardis_refined.client.model.blockentity.console.*; -import whocraft.tardis_refined.client.model.blockentity.door.*; +import whocraft.tardis_refined.client.model.blockentity.door.interior.*; import whocraft.tardis_refined.client.model.blockentity.life.ArsEggModel; -import whocraft.tardis_refined.client.model.blockentity.shell.*; import whocraft.tardis_refined.client.model.blockentity.shell.internal.door.RootShellDoorModel; import whocraft.tardis_refined.client.model.blockentity.shell.rootplant.*; +import whocraft.tardis_refined.client.model.blockentity.shell.shells.*; import whocraft.tardis_refined.common.util.PlatformWarning; import java.util.function.Supplier; @@ -49,6 +49,9 @@ public class ModelRegistry { public static ModelLayerLocation GROWTH_SHELL; public static ModelLayerLocation PORTALOO_SHELL; public static ModelLayerLocation PAGODA_SHELL; + public static ModelLayerLocation LIFT_SHELL; + public static ModelLayerLocation HIEROGLYPH_SHELL; + public static ModelLayerLocation CASTLE_SHELL; public static ModelLayerLocation ROOT_SHELL_DOOR; @@ -66,6 +69,9 @@ public class ModelRegistry { public static ModelLayerLocation GROWTH_DOOR; public static ModelLayerLocation PORTALOO_DOOR; public static ModelLayerLocation PAGODA_DOOR; + public static ModelLayerLocation LIFT_DOOR; + public static ModelLayerLocation HIEROGLYPH_DOOR; + public static ModelLayerLocation CASTLE_DOOR; public static ModelLayerLocation ARS_EGG; @@ -103,6 +109,9 @@ public static void init() { GROWTH_SHELL = register(new ModelLayerLocation(new ResourceLocation(TardisRefined.MODID, "growth_shell"), "growth_shell"), GrowthShellModel::createBodyLayer); PORTALOO_SHELL = register(new ModelLayerLocation(new ResourceLocation(TardisRefined.MODID, "portaloo_shell"), "portaloo_shell"), PortalooShellModel::createBodyLayer); PAGODA_SHELL = register(new ModelLayerLocation(new ResourceLocation(TardisRefined.MODID, "pagoda_shell"), "pagoda_shell"), PagodaShellModel::createBodyLayer); + LIFT_SHELL = register(new ModelLayerLocation(new ResourceLocation(TardisRefined.MODID, "lift_shell"), "lift_shell"), LiftShellModel::createBodyLayer); + HIEROGLYPH_SHELL = register(new ModelLayerLocation(new ResourceLocation(TardisRefined.MODID, "hieroglyph_shell"), "hieroglyph_shell"), HieroglyphModel::createBodyLayer); + CASTLE_SHELL = register(new ModelLayerLocation(new ResourceLocation(TardisRefined.MODID, "castle_shell"), "castle_shell"), CastleShellModel::createBodyLayer); ROOT_SHELL_DOOR = register(new ModelLayerLocation(new ResourceLocation(TardisRefined.MODID, "root_shell_door"), "root_shell_door"), RootShellDoorModel::createBodyLayer); @@ -120,6 +129,9 @@ public static void init() { GROWTH_DOOR = register(new ModelLayerLocation(new ResourceLocation(TardisRefined.MODID, "growth_door"), "growth_door"), GrowthDoorModel::createBodyLayer); PORTALOO_DOOR = register(new ModelLayerLocation(new ResourceLocation(TardisRefined.MODID, "portaloo_door"), "portaloo_door"), PortalooDoorModel::createBodyLayer); PAGODA_DOOR = register(new ModelLayerLocation(new ResourceLocation(TardisRefined.MODID, "pagoda_door"), "pagoda_door"), PagodaDoorModel::createBodyLayer); + LIFT_DOOR = register(new ModelLayerLocation(new ResourceLocation(TardisRefined.MODID, "lift_door"), "lift_door"), LiftShellDoorModel::createBodyLayer); + HIEROGLYPH_DOOR = register(new ModelLayerLocation(new ResourceLocation(TardisRefined.MODID, "hieroglyph_door"), "hieroglyph_door"), HieroglyphShellDoor::createBodyLayer); + CASTLE_DOOR = register(new ModelLayerLocation(new ResourceLocation(TardisRefined.MODID, "castle_door"), "castle_door"), CastleShellDoorModel::createBodyLayer); diff --git a/common/src/main/java/whocraft/tardis_refined/client/ParticleGallifrey.java b/common/src/main/java/whocraft/tardis_refined/client/ParticleGallifrey.java index 6e2229e65..ca1304202 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/ParticleGallifrey.java +++ b/common/src/main/java/whocraft/tardis_refined/client/ParticleGallifrey.java @@ -3,6 +3,7 @@ import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.client.particle.*; import net.minecraft.core.particles.SimpleParticleType; +import net.minecraft.util.Mth; public class ParticleGallifrey extends BaseAshSmokeParticle { @@ -51,4 +52,22 @@ public Particle createParticle(SimpleParticleType arg, ClientLevel arg2, double return particleGallifrey; } } + + public static class ARSVinesParticle implements ParticleProvider { + private final SpriteSet sprite; + + public ARSVinesParticle(SpriteSet arg) { + this.sprite = arg; + } + + @Override + public Particle createParticle(SimpleParticleType arg, ClientLevel arg2, double d, double e, double f, double g, double h, double i) { + SuspendedParticle suspendedParticle = new SuspendedParticle(arg2, this.sprite, d, e, f, 0.0, -0.8f, 0.0); + suspendedParticle.setLifetime(Mth.randomBetweenInclusive(arg2.random, 500, 1000)); + suspendedParticle.gravity = 0.01f; + suspendedParticle.setColor(0.4F, 0.4F, 0.7F); + return suspendedParticle; + } + + } } diff --git a/common/src/main/java/whocraft/tardis_refined/client/ScreenHandler.java b/common/src/main/java/whocraft/tardis_refined/client/ScreenHandler.java index 5a97c8692..61ee75717 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/ScreenHandler.java +++ b/common/src/main/java/whocraft/tardis_refined/client/ScreenHandler.java @@ -3,11 +3,17 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.Minecraft; +import net.minecraft.nbt.CompoundTag; import net.minecraft.resources.ResourceKey; import net.minecraft.world.level.Level; +import whocraft.tardis_refined.client.screen.CancelDesktopScreen; +import whocraft.tardis_refined.client.screen.MonitorScreen; +import whocraft.tardis_refined.client.screen.upgrades.UpgradesScreen; import whocraft.tardis_refined.client.screen.waypoints.CoordInputType; import whocraft.tardis_refined.client.screen.waypoints.WaypointListScreen; import whocraft.tardis_refined.client.screen.waypoints.WaypointManageScreen; +import whocraft.tardis_refined.common.capability.TardisLevelOperator; +import whocraft.tardis_refined.common.capability.upgrades.UpgradeHandler; import whocraft.tardis_refined.common.tardis.TardisNavLocation; import java.util.Collection; @@ -26,4 +32,32 @@ public static void setWaypointScreen(Collection waypoints) { public static void setCoordinatesScreen(List> levels, CoordInputType coordInputType, TardisNavLocation tardisNavLocation) { Minecraft.getInstance().setScreen(new WaypointManageScreen(levels, coordInputType, tardisNavLocation)); } + + @Environment(EnvType.CLIENT) + public static void openMonitorScreen(boolean desktopGenerating, CompoundTag upgradeHandlerNbt, TardisNavLocation currentLocation, TardisNavLocation targetLocation) { + if (desktopGenerating) { + Minecraft.getInstance().setScreen(new CancelDesktopScreen()); + } else { + UpgradeHandler upgradeHandlerClient = new UpgradeHandler(new TardisLevelOperator(Minecraft.getInstance().level)); + upgradeHandlerClient.loadData(upgradeHandlerNbt); + Minecraft.getInstance().setScreen(new MonitorScreen(currentLocation, targetLocation, upgradeHandlerClient)); + } + } + + @Environment(EnvType.CLIENT) + public static void openCoordinatesScreen(List> levels, CoordInputType coordInputType, TardisNavLocation tardisNavLocation) { + ScreenHandler.setCoordinatesScreen(levels, coordInputType, tardisNavLocation); + } + + @Environment(EnvType.CLIENT) + public static void displayUpgradesScreen(CompoundTag upgradeTag) { + UpgradeHandler upgradeHandlerClient = new UpgradeHandler(new TardisLevelOperator(Minecraft.getInstance().level)); + upgradeHandlerClient.loadData(upgradeTag); + + if (Minecraft.getInstance().screen instanceof UpgradesScreen screen && screen.selectedTab != null) { + screen.selectedTab.populate(upgradeHandlerClient); + } else { + Minecraft.getInstance().setScreen(new UpgradesScreen(upgradeHandlerClient)); + } + } } diff --git a/common/src/main/java/whocraft/tardis_refined/client/TRParticles.java b/common/src/main/java/whocraft/tardis_refined/client/TRParticles.java index 9ab58b126..b4ae64079 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/TRParticles.java +++ b/common/src/main/java/whocraft/tardis_refined/client/TRParticles.java @@ -1,7 +1,6 @@ package whocraft.tardis_refined.client; import dev.architectury.injectables.annotations.ExpectPlatform; -import net.minecraft.core.Registry; import net.minecraft.core.particles.ParticleType; import net.minecraft.core.particles.SimpleParticleType; import net.minecraft.core.registries.Registries; @@ -14,6 +13,7 @@ public class TRParticles { public static final DeferredRegistry> TYPES = DeferredRegistry.create(TardisRefined.MODID, Registries.PARTICLE_TYPE); public static final RegistrySupplier GALLIFREY = TYPES.register("gallifrey", TRParticles::getParticleType); + public static final RegistrySupplier ARS_LEAVES = TYPES.register("ars_leaves", TRParticles::getParticleType); @ExpectPlatform diff --git a/common/src/main/java/whocraft/tardis_refined/client/TardisClientData.java b/common/src/main/java/whocraft/tardis_refined/client/TardisClientData.java index cde983e3e..091efed29 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/TardisClientData.java +++ b/common/src/main/java/whocraft/tardis_refined/client/TardisClientData.java @@ -3,19 +3,27 @@ import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import net.minecraft.Util; import net.minecraft.client.Minecraft; +import net.minecraft.client.sounds.SoundManager; +import net.minecraft.core.BlockPos; +import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; +import net.minecraft.util.RandomSource; import net.minecraft.world.entity.AnimationState; +import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; -import whocraft.tardis_refined.common.network.messages.SyncIntReactionsMessage; +import net.minecraft.world.phys.Vec3; +import whocraft.tardis_refined.client.sounds.LoopingSound; +import whocraft.tardis_refined.common.network.messages.SyncTardisClientDataMessage; import whocraft.tardis_refined.common.tardis.themes.ShellTheme; -import whocraft.tardis_refined.constants.NbtConstants; -import whocraft.tardis_refined.patterns.ShellPattern; import whocraft.tardis_refined.patterns.ShellPatterns; +import whocraft.tardis_refined.registry.DimensionTypes; import java.util.Map; +import static whocraft.tardis_refined.common.util.TardisHelper.isInArsArea; + public class TardisClientData { @@ -23,7 +31,8 @@ public class TardisClientData { public AnimationState ROTOR_ANIMATION = new AnimationState(); public AnimationState LANDING_ANIMATION = new AnimationState(); public AnimationState TAKEOFF_ANIMATION = new AnimationState(); - public TardisClientData(ResourceKey resourceKey){ + + public TardisClientData(ResourceKey resourceKey) { this.levelKey = resourceKey; } @@ -43,23 +52,24 @@ public ResourceKey getLevelKey() { private boolean isOnCooldown = false; private float flightShakeScale = 0; private ResourceLocation shellTheme = ShellTheme.FACTORY.getId(); - private ShellPattern shellPattern = ShellPatterns.DEFAULT; + private ResourceLocation shellPattern = ShellPatterns.DEFAULT.id(); -// private ShellPattern safeGrabPattern() { -// if (ShellPatterns.getRegistry().isEmpty()) -// return ShellPatterns.getPatternsForThemeDefault(shellTheme).get(0); -// return ShellPatterns.getPatternsForTheme(shellTheme).get(0); -// } + public ResourceLocation getShellTheme() { + return shellTheme; + } - public TardisClientData setShellPattern(ShellPattern shellPattern) { - this.shellPattern = shellPattern; - return this; + public void setShellTheme(ResourceLocation shellTheme) { + this.shellTheme = shellTheme; } - public ShellPattern shellPattern() { + public ResourceLocation getShellPattern() { return shellPattern; } + public void setShellPattern(ResourceLocation shellPattern) { + this.shellPattern = shellPattern; + } + public int landingTime = 0, takeOffTime = 0; public void setFlying(boolean flying) { @@ -78,26 +88,53 @@ public boolean isThrottleDown() { return throttleDown; } - public void setIsLanding(boolean landing) {this.isLanding = landing;} - public boolean isLanding() {return isLanding;} + public void setIsLanding(boolean landing) { + this.isLanding = landing; + } - public void setIsTakingOff(boolean takingOff) {this.isTakingOff = takingOff;} - public boolean isTakingOff() {return isTakingOff;} + public boolean isLanding() { + return isLanding; + } - public void setInDangerZone(boolean isInDangerZone) {this.isInDangerZone = isInDangerZone;} - public boolean isInDangerZone() {return isInDangerZone;} + public void setIsTakingOff(boolean takingOff) { + this.isTakingOff = takingOff; + } - public void setIsCrashing(boolean isCrashing) {this.isCrashing = isCrashing;} - public boolean isCrashing() {return isCrashing;} + public boolean isTakingOff() { + return isTakingOff; + } - public void setIsOnCooldown(boolean isCooldown) {this.isOnCooldown = isCooldown;} - public boolean isOnCooldown() {return isOnCooldown;} + public void setInDangerZone(boolean isInDangerZone) { + this.isInDangerZone = isInDangerZone; + } - public void setFlightShakeScale(float scale) {this.flightShakeScale = scale;} - public float flightShakeScale() {return flightShakeScale;} + public boolean isInDangerZone() { + return isInDangerZone; + } - public void setShellTheme(ResourceLocation theme) {this.shellTheme = theme;} - public ResourceLocation getShellTheme() {return this.shellTheme;} + public void setIsCrashing(boolean isCrashing) { + this.isCrashing = isCrashing; + } + + public boolean isCrashing() { + return isCrashing; + } + + public void setIsOnCooldown(boolean isCooldown) { + this.isOnCooldown = isCooldown; + } + + public boolean isOnCooldown() { + return isOnCooldown; + } + + public void setFlightShakeScale(float scale) { + this.flightShakeScale = scale; + } + + public float flightShakeScale() { + return flightShakeScale; + } /** * Serializes the Tardis instance to a CompoundTag. @@ -111,16 +148,12 @@ public CompoundTag serializeNBT() { compoundTag.putBoolean("throttleDown", throttleDown); compoundTag.putBoolean("isLanding", isLanding); compoundTag.putBoolean("isTakingOff", isTakingOff); - if (shellTheme != null) - compoundTag.putString("shellTheme", shellTheme.toString()); compoundTag.putBoolean("isInDangerZone", this.isInDangerZone); compoundTag.putFloat("flightShakeScale", this.flightShakeScale); compoundTag.putBoolean("isOnCooldown", this.isOnCooldown); - - if (this.shellTheme != null) { - if ( this.shellPattern != null) - compoundTag.putString(NbtConstants.TARDIS_EXT_CURRENT_PATTERN, shellPattern.id().toString()); - } + // Save shellTheme and shellPattern + compoundTag.putString("shellTheme", shellTheme.toString()); + compoundTag.putString("shellPattern", shellPattern.toString()); return compoundTag; } @@ -135,15 +168,13 @@ public void deserializeNBT(CompoundTag compoundTag) { throttleDown = compoundTag.getBoolean("throttleDown"); isLanding = compoundTag.getBoolean("isLanding"); isTakingOff = compoundTag.getBoolean("isTakingOff"); - if (compoundTag.contains("shellTheme")) - shellTheme = new ResourceLocation(compoundTag.getString("shellTheme")); isInDangerZone = compoundTag.getBoolean("isInDangerZone"); flightShakeScale = compoundTag.getFloat("flightShakeScale"); isOnCooldown = compoundTag.getBoolean("isOnCooldown"); - if (compoundTag.getString(NbtConstants.TARDIS_EXT_CURRENT_PATTERN) != null) { - this.shellPattern = ShellPatterns.getPatternOrDefault(shellTheme, new ResourceLocation(compoundTag.getString(NbtConstants.TARDIS_EXT_CURRENT_PATTERN))); - } + // Load shellTheme and shellPattern + shellTheme = new ResourceLocation(compoundTag.getString("shellTheme")); + shellPattern = new ResourceLocation(compoundTag.getString("shellPattern")); } @@ -152,10 +183,14 @@ public void deserializeNBT(CompoundTag compoundTag) { * server-side, as calling it client-side may cause the game to crash. */ public void sync() { - new SyncIntReactionsMessage(getLevelKey(), serializeNBT()).sendToAll(); + new SyncTardisClientDataMessage(getLevelKey(), serializeNBT()).sendToAll(); } public void tickClientside() { + + SoundManager soundManager = Minecraft.getInstance().getSoundManager(); + + if (isTakingOff()) { takeOffTime++; landingTime = 0; @@ -168,6 +203,32 @@ public void tickClientside() { } + if (Minecraft.getInstance().player.level().dimensionTypeId() == DimensionTypes.TARDIS) { + createWorldAmbience(Minecraft.getInstance().player); + + + if (LoopingSound.ARS_HUMMING == null) { + LoopingSound.setupSounds(); + } + + if (isInArsArea(Minecraft.getInstance().player.blockPosition())) { + if (!soundManager.isActive(LoopingSound.ARS_HUMMING)) { + LoopingSound.ARS_HUMMING.setLocation(new Vec3(1024, 100, 16)); + soundManager.play(LoopingSound.ARS_HUMMING); + } + } + + if(!soundManager.isActive(LoopingSound.HUM_TEST)){ + soundManager.play(LoopingSound.HUM_TEST); + } + } + + + if (LoopingSound.shouldMinecraftMusicStop(soundManager)) { + Minecraft.getInstance().getMusicManager().stopPlaying(); + } + + // Responsible for screen-shake. Not sure of a better solution at this point in time. if (isInDangerZone || isCrashing) { if (Minecraft.getInstance().player.level().dimension() == levelKey) { @@ -180,6 +241,7 @@ public void tickClientside() { } + /** * Updates the Tardis instance. This method is called manually from the SyncIntReactionsMessage message. */ @@ -236,7 +298,7 @@ public static void add(TardisClientData tardisClientData, ResourceKey lev * @param levelResourceKey The resource key of the level the Tardis is in. * @return The TardisIntReactions instance containing information about the Tardis. */ - public static TardisClientData getInstance(ResourceKey levelResourceKey){ + public static TardisClientData getInstance(ResourceKey levelResourceKey) { // Check if the map contains information about the Tardis if (DATA.containsKey(levelResourceKey)) { // If the map contains information about the Tardis, return it @@ -262,12 +324,13 @@ public static void clearAll() { /** * Called by platform-specific methods + * * @param client Minecraft client */ public static void tickClientData(Minecraft client) { // Inelegant solution, please revise if (client.level == null || client.isPaused()) { - if(!TardisClientData.getAllEntries().isEmpty() && !client.isPaused()) { + if (!TardisClientData.getAllEntries().isEmpty() && !client.isPaused()) { TardisClientData.clearAll(); } return; @@ -275,4 +338,33 @@ public static void tickClientData(Minecraft client) { TardisClientData.getAllEntries().forEach((levelResourceKey, tardisClientData) -> tardisClientData.tickClientside()); } + + private static void createWorldAmbience(Player player) { + if (player.tickCount % 120 == 0 && !isInArsArea(player.blockPosition())) return; + RandomSource random = player.level().random; + Level level = player.level(); + double originX = player.getX(); + double originY = player.getY(); + double originZ = player.getZ(); + for (int i = 0; i < 5; i++) { + double particleX = originX + (random.nextInt(24) - random.nextInt(24)); + double particleY = originY + (random.nextInt(24) - random.nextInt(24)); + double particleZ = originZ + (random.nextInt(24) - random.nextInt(24)); + double velocityX = (random.nextDouble() - 0.5) * 0.02; + double velocityY = (random.nextDouble() - 0.5) * 0.02; + double velocityZ = (random.nextDouble() - 0.5) * 0.02; + if (isInArsArea(new BlockPos((int) particleX, (int) particleY, (int) particleZ))) { + level.addParticle(TRParticles.ARS_LEAVES.get(), particleX, particleY, particleZ, velocityX, velocityY, velocityZ); + level.addParticle(ParticleTypes.END_ROD, particleX, particleY, particleZ, velocityX, velocityY, velocityZ); + } + } + } + + public Vec3 fogColor(boolean isCrashing) { + if (isCrashing) { + return new Vec3(1, 0, 0); + } + return new Vec3(0.14F, 0.15F, 0.22F); + } + } diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/FactoryDoorModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/FactoryDoorModel.java deleted file mode 100644 index eecc792d3..000000000 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/FactoryDoorModel.java +++ /dev/null @@ -1,84 +0,0 @@ -package whocraft.tardis_refined.client.model.blockentity.door; - - -import com.mojang.blaze3d.vertex.PoseStack; -import com.mojang.blaze3d.vertex.VertexConsumer; -import net.minecraft.client.model.geom.ModelPart; -import net.minecraft.client.model.geom.PartPose; -import net.minecraft.client.model.geom.builders.*; -import net.minecraft.world.entity.Entity; -import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; -import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; - -public class FactoryDoorModel extends ShellModel { - - private final ModelPart root; - private final ModelPart leftDoor; - private final ModelPart rightDoor; - - public FactoryDoorModel(ModelPart root) { - super(root); - this.root = root.getChild("root"); - this.leftDoor = this.root.getChild("left_door"); - this.rightDoor = this.root.getChild("right_door"); - } - - public static LayerDefinition createBodyLayer() { - MeshDefinition meshdefinition = new MeshDefinition(); - PartDefinition partdefinition = meshdefinition.getRoot(); - - PartDefinition root = partdefinition.addOrReplaceChild("root", CubeListBuilder.create().texOffs(18, 45).addBox(-9.0F, -4.0F, -8.0F, 18.0F, 2.0F, 3.0F, new CubeDeformation(0.0F)) - .texOffs(96, 2).addBox(-7.0F, -37.0F, -6.0F, 14.0F, 33.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(19, 17).addBox(-9.0F, -39.0F, -8.0F, 18.0F, 2.0F, 3.0F, new CubeDeformation(0.0F)) - .texOffs(54, 57).addBox(-5.0F, -37.0F, -8.0F, 10.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)) - .texOffs(49, 66).addBox(-9.0F, -37.0F, -7.0F, 2.0F, 33.0F, 2.0F, new CubeDeformation(0.0F)) - .texOffs(13, 66).addBox(7.0F, -37.0F, -7.0F, 2.0F, 33.0F, 2.0F, new CubeDeformation(0.0F)) - .texOffs(19, 52).addBox(-7.0F, -37.0F, -6.1F, 14.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 26.0F, 13.0F)); - - PartDefinition left_door = root.addOrReplaceChild("left_door", CubeListBuilder.create().texOffs(70, 96).addBox(0.0F, -15.0F, -0.6F, 7.0F, 31.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(-7.0F, -20.0F, -5.6F)); - - PartDefinition right_door = root.addOrReplaceChild("right_door", CubeListBuilder.create().texOffs(95, 81).addBox(-7.0F, -15.0F, -0.6F, 7.0F, 31.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(7.0F, -20.0F, -5.6F)); - - ShellModel.splice(partdefinition); - - - return LayerDefinition.create(meshdefinition, 128, 128); - } - - - @Override - public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - root.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 setDoorOpen(boolean open) { - if (open) { - this.leftDoor.yRot = -250f; - this.rightDoor.yRot = 250f; - } else { - this.leftDoor.yRot = 0; - this.rightDoor.yRot = 0; - } - } - - @Override - public boolean isDoorModel() { - return true; - } - - @Override - public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - - } -} \ No newline at end of file diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/BigBenDoorModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/BigBenDoorModel.java similarity index 81% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/BigBenDoorModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/BigBenDoorModel.java index d15924901..65ae3beab 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/BigBenDoorModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/BigBenDoorModel.java @@ -1,6 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.door;// Made with Blockbench 4.5.2 -// Exported for Minecraft version 1.17 - 1.18 with Mojang mappings -// Paste this class into your mod and generate all required imports +package whocraft.tardis_refined.client.model.blockentity.door.interior; import com.mojang.blaze3d.vertex.PoseStack; @@ -8,11 +6,10 @@ import net.minecraft.client.model.geom.ModelPart; import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; -import net.minecraft.world.entity.Entity; import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; -import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; +import whocraft.tardis_refined.common.blockentity.door.GlobalDoorBlockEntity; -public class BigBenDoorModel extends ShellModel { +public class BigBenDoorModel extends ShellDoorModel { private final ModelPart root; private final ModelPart door; private final ModelPart bone27; @@ -21,23 +18,11 @@ public class BigBenDoorModel extends ShellModel { private final ModelPart bb_main; @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { this.door.yRot = (open) ? -275f : 0; - - } - - @Override - public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - - } - - @Override - public boolean isDoorModel() { - return true; } public BigBenDoorModel(ModelPart root) { - super(root); this.root = root; this.door = root.getChild("door"); this.bone27 = root.getChild("bone27"); @@ -79,13 +64,13 @@ public static LayerDefinition createBodyLayer() { .texOffs(0, 0).addBox(-7.0F, -57.0F, 5.0F, 14.0F, 57.0F, 3.0F, new CubeDeformation(0.0F)) .texOffs(35, 0).addBox(-7.0F, -35.0F, 6.25F, 14.0F, 35.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F)); - ShellModel.splice(partdefinition); + ShellModel.addMaterializationPart(partdefinition); return LayerDefinition.create(meshdefinition, 128, 128); } @Override - public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + public void renderInteriorDoor(GlobalDoorBlockEntity doorBlockEntity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); bone27.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); bone5.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); @@ -97,9 +82,4 @@ public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, i public ModelPart root() { return this.root; } - - @Override - public void setupAnim(Entity entity, float f, float g, float h, float i, float j) { - - } } \ No newline at end of file diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/BriefcaseDoorModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/BriefcaseDoorModel.java similarity index 71% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/BriefcaseDoorModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/BriefcaseDoorModel.java index 94c8593f4..a72634e0b 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/BriefcaseDoorModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/BriefcaseDoorModel.java @@ -1,15 +1,14 @@ -package whocraft.tardis_refined.client.model.blockentity.door; +package whocraft.tardis_refined.client.model.blockentity.door.interior; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; import net.minecraft.client.model.geom.ModelPart; import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; -import net.minecraft.world.entity.Entity; import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; -import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; +import whocraft.tardis_refined.common.blockentity.door.GlobalDoorBlockEntity; -public class BriefcaseDoorModel extends ShellModel { +public class BriefcaseDoorModel extends ShellDoorModel { private final ModelPart root; private final ModelPart door_open; @@ -19,27 +18,18 @@ public class BriefcaseDoorModel extends ShellModel { private boolean isDoorOpen; @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { this.isDoorOpen = open; } - @Override - public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - - } public BriefcaseDoorModel(ModelPart root) { - super(root); this.root = root; this.door_open = root.getChild("door_open"); this.door_closed = root.getChild("door_closed"); this.bb_main = root.getChild("bb_main"); } - @Override - public boolean isDoorModel() { - return true; - } public static LayerDefinition createBodyLayer() { MeshDefinition meshdefinition = new MeshDefinition(); @@ -54,15 +44,14 @@ public static LayerDefinition createBodyLayer() { PartDefinition cube_r1 = bb_main.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(0, 49).addBox(-7.0F, 1.0F, -2.25F, 14.0F, 48.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -48.0F, 9.25F, -0.1309F, 0.0F, 0.0F)); - ShellModel.splice(partdefinition); + ShellModel.addMaterializationPart(partdefinition); return LayerDefinition.create(meshdefinition, 128, 128); } @Override - public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - + public void renderInteriorDoor(GlobalDoorBlockEntity doorBlockEntity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { if (isDoorOpen) { door_open.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); } else { @@ -77,8 +66,4 @@ public ModelPart root() { return root; } - @Override - public void setupAnim(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { - - } } \ No newline at end of file diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/BulkHeadDoorModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/BulkHeadDoorModel.java similarity index 97% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/BulkHeadDoorModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/BulkHeadDoorModel.java index 94e45dea0..66667cfd0 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/BulkHeadDoorModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/BulkHeadDoorModel.java @@ -1,4 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.door; +package whocraft.tardis_refined.client.model.blockentity.door.interior; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/CastleShellDoorModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/CastleShellDoorModel.java new file mode 100644 index 000000000..ea4e2a23e --- /dev/null +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/CastleShellDoorModel.java @@ -0,0 +1,72 @@ +package whocraft.tardis_refined.client.model.blockentity.door.interior; + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import net.minecraft.client.model.geom.ModelPart; +import net.minecraft.client.model.geom.PartPose; +import net.minecraft.client.model.geom.builders.*; +import whocraft.tardis_refined.common.blockentity.door.GlobalDoorBlockEntity; + +public class CastleShellDoorModel extends ShellDoorModel { + + private final ModelPart r_door; + private final ModelPart l_door; + private final ModelPart bone8; + + public CastleShellDoorModel(ModelPart root) { + this.r_door = root.getChild("r_door"); + this.l_door = root.getChild("l_door"); + this.bone8 = root.getChild("bone8"); + } + + public static LayerDefinition createBodyLayer() { + MeshDefinition meshdefinition = new MeshDefinition(); + PartDefinition partdefinition = meshdefinition.getRoot(); + + PartDefinition r_door = partdefinition.addOrReplaceChild("r_door", CubeListBuilder.create().texOffs(0, 40).mirror().addBox(-0.25F, -16.0F, -0.5F, 8.0F, 32.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(-7.5F, 8.0F, 4.5F)); + + PartDefinition l_door = partdefinition.addOrReplaceChild("l_door", CubeListBuilder.create().texOffs(0, 40).addBox(-7.75F, -16.0F, -0.5F, 8.0F, 32.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(7.5F, 8.0F, 4.5F)); + + PartDefinition bone8 = partdefinition.addOrReplaceChild("bone8", CubeListBuilder.create().texOffs(37, 0).addBox(-10.5F, -36.0F, 7.0F, 3.0F, 36.0F, 3.0F, new CubeDeformation(0.0F)) + .texOffs(37, 0).mirror().addBox(7.5F, -36.0F, 7.0F, 3.0F, 36.0F, 3.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(0, 0).addBox(-7.5F, -36.0F, 7.0F, 15.0F, 36.0F, 3.0F, new CubeDeformation(0.0F)) + .texOffs(19, 40).addBox(-2.5F, -36.0F, 5.0F, 5.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(45, 45).addBox(2.5F, -35.0F, 5.0F, 4.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(34, 40).addBox(6.5F, -36.0F, 5.0F, 4.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(34, 40).mirror().addBox(-10.5F, -36.0F, 5.0F, 4.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(45, 45).mirror().addBox(-6.5F, -35.0F, 5.0F, 4.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(0.0F, 24.0F, -2.0F)); + + PartDefinition bone = bone8.addOrReplaceChild("bone", CubeListBuilder.create().texOffs(34, 40).addBox(7.5F, -4.0F, 5.0F, 4.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(19, 47).addBox(7.5F, -8.0F, 5.0F, 3.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(34, 40).addBox(7.5F, -12.0F, 5.0F, 4.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(19, 47).addBox(7.5F, -16.0F, 5.0F, 3.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(30, 47).addBox(7.5F, -20.0F, 5.0F, 2.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(19, 47).addBox(7.5F, -24.0F, 5.0F, 3.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(30, 47).addBox(7.5F, -28.0F, 5.0F, 2.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(19, 47).addBox(7.5F, -32.0F, 5.0F, 3.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 0.0F)); + + PartDefinition bone2 = bone8.addOrReplaceChild("bone2", CubeListBuilder.create().texOffs(34, 40).mirror().addBox(-11.5F, -4.0F, 5.0F, 4.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(19, 47).mirror().addBox(-10.5F, -8.0F, 5.0F, 3.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(34, 40).mirror().addBox(-11.5F, -12.0F, 5.0F, 4.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(19, 47).mirror().addBox(-10.5F, -16.0F, 5.0F, 3.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(30, 47).mirror().addBox(-9.5F, -20.0F, 5.0F, 2.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(19, 47).mirror().addBox(-10.5F, -24.0F, 5.0F, 3.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(30, 47).mirror().addBox(-9.5F, -28.0F, 5.0F, 2.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(19, 47).mirror().addBox(-10.5F, -32.0F, 5.0F, 3.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(0.0F, 0.0F, 0.0F)); + + return LayerDefinition.create(meshdefinition, 128, 128); + } + + @Override + public void renderInteriorDoor(GlobalDoorBlockEntity doorBlockEntity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + r_door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + l_door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + bone8.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + } + + @Override + public void setDoorPosition(boolean open) { + l_door.yRot = open ? (float) Math.toRadians(90) : (float) Math.toRadians(0); + r_door.yRot = open ? (float) Math.toRadians(-90) : (float) Math.toRadians(0); + } +} diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/DrifterDoorModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/DrifterDoorModel.java similarity index 78% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/DrifterDoorModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/DrifterDoorModel.java index a3b7d39b4..137ed72a3 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/DrifterDoorModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/DrifterDoorModel.java @@ -1,6 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.door;// Made with Blockbench 4.5.2 -// Exported for Minecraft version 1.17 - 1.18 with Mojang mappings -// Paste this class into your mod and generate all required imports +package whocraft.tardis_refined.client.model.blockentity.door.interior; import com.mojang.blaze3d.vertex.PoseStack; @@ -10,9 +8,9 @@ import net.minecraft.client.model.geom.builders.*; import net.minecraft.world.entity.Entity; import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; -import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; +import whocraft.tardis_refined.common.blockentity.door.GlobalDoorBlockEntity; -public class DrifterDoorModel extends ShellModel { +public class DrifterDoorModel extends ShellDoorModel { private final ModelPart door_closed; private final ModelPart door_open; @@ -20,7 +18,6 @@ public class DrifterDoorModel extends ShellModel { private final ModelPart root; public DrifterDoorModel(ModelPart root) { - super(root); this.root = root; this.door_closed = root.getChild("door_closed"); this.door_open = root.getChild("door_open"); @@ -47,20 +44,15 @@ public static LayerDefinition createBodyLayer() { PartDefinition bone = main.addOrReplaceChild("bone", CubeListBuilder.create().texOffs(41, 5).addBox(-9.5F, 0.0F, -2.0F, 19.0F, 1.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -34.0F, 6.0F, 0.7418F, 0.0F, 0.0F)); - ShellModel.splice(partdefinition); + ShellModel.addMaterializationPart(partdefinition); return LayerDefinition.create(meshdefinition, 128, 128); } - @Override - public boolean isDoorModel() { - return true; - } - boolean isDoorOpen = false; - @Override - public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + @Override + public void renderInteriorDoor(GlobalDoorBlockEntity doorBlockEntity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { door_open.visible = isDoorOpen; door_closed.visible = !isDoorOpen; @@ -75,14 +67,10 @@ public ModelPart root() { } @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { this.isDoorOpen = open; } - @Override - public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - - } @Override public void setupAnim(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/FactoryDoorModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/FactoryDoorModel.java new file mode 100644 index 000000000..7a0ce3117 --- /dev/null +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/FactoryDoorModel.java @@ -0,0 +1,76 @@ +package whocraft.tardis_refined.client.model.blockentity.door.interior; + + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import net.minecraft.client.model.geom.ModelPart; +import net.minecraft.client.model.geom.PartPose; +import net.minecraft.client.model.geom.builders.*; +import net.minecraft.world.entity.Entity; +import whocraft.tardis_refined.common.blockentity.door.GlobalDoorBlockEntity; + +public class FactoryDoorModel extends ShellDoorModel { + + private final ModelPart root; + private final ModelPart leftDoor; + private final ModelPart rightDoor; + + public FactoryDoorModel(ModelPart root) { + this.root = root; + this.leftDoor = this.root.getChild("left_door"); + this.rightDoor = this.root.getChild("right_door"); + } + + public static LayerDefinition createBodyLayer() { + MeshDefinition meshdefinition = new MeshDefinition(); + PartDefinition partdefinition = meshdefinition.getRoot(); + + PartDefinition door = partdefinition.addOrReplaceChild("door", CubeListBuilder.create().texOffs(48, 6).addBox(-9.0F, -4.0F, -8.0F, 18.0F, 2.0F, 3.0F, new CubeDeformation(0.0F)) + .texOffs(0, 0).addBox(-7.0F, -37.0F, -6.0F, 14.0F, 33.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(48, 0).addBox(-9.0F, -39.0F, -8.0F, 18.0F, 2.0F, 3.0F, new CubeDeformation(0.0F)) + .texOffs(48, 17).addBox(-5.0F, -37.0F, -8.0F, 10.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(9, 35).addBox(-9.0F, -37.0F, -7.0F, 2.0F, 33.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(0, 35).addBox(7.0F, -37.0F, -7.0F, 2.0F, 33.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(48, 12).addBox(-7.0F, -37.0F, -6.1F, 14.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 26.0F, 13.0F)); + + PartDefinition bone = door.addOrReplaceChild("bone", CubeListBuilder.create(), PartPose.offsetAndRotation(0.0F, -20.0F, 11.0F, 0.0F, 1.5708F, 0.0F)); + + PartDefinition left_door = partdefinition.addOrReplaceChild("left_door", CubeListBuilder.create().texOffs(31, 33).addBox(0.0F, -15.0F, -0.6F, 7.0F, 31.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(-7.0F, 6.0F, 7.4F)); + + PartDefinition right_door = partdefinition.addOrReplaceChild("right_door", CubeListBuilder.create().texOffs(31, 0).addBox(-7.0F, -15.0F, -0.6F, 7.0F, 31.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(7.0F, 6.0F, 7.4F)); + + return LayerDefinition.create(meshdefinition, 128, 128); + } + + @Override + public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + root.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + } + + @Override + public void renderInteriorDoor(GlobalDoorBlockEntity doorBlockEntity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + root.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) { + if (open) { + this.leftDoor.yRot = -250f; + this.rightDoor.yRot = 250f; + } else { + this.leftDoor.yRot = 0; + this.rightDoor.yRot = 0; + } + } + +} \ No newline at end of file diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/GroeningDoorModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/GroeningDoorModel.java similarity index 81% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/GroeningDoorModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/GroeningDoorModel.java index cf070bab7..b9587ed1b 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/GroeningDoorModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/GroeningDoorModel.java @@ -1,4 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.door; +package whocraft.tardis_refined.client.model.blockentity.door.interior; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; @@ -7,9 +7,9 @@ import net.minecraft.client.model.geom.builders.*; import net.minecraft.world.entity.Entity; import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; -import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; +import whocraft.tardis_refined.common.blockentity.door.GlobalDoorBlockEntity; -public class GroeningDoorModel extends ShellModel { +public class GroeningDoorModel extends ShellDoorModel { private final ModelPart root; private final ModelPart door; @@ -18,17 +18,11 @@ public class GroeningDoorModel extends ShellModel { private final ModelPart bb_main; @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { this.door.yRot = (open) ? -275f : 0; } - @Override - public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - - } - public GroeningDoorModel(ModelPart root) { - super(root); this.root = root; this.door = root.getChild("door"); this.bone = root.getChild("bone"); @@ -36,11 +30,6 @@ public GroeningDoorModel(ModelPart root) { this.bb_main = root.getChild("bb_main"); } - @Override - public boolean isDoorModel() { - return true; - } - public static LayerDefinition createBodyLayer() { MeshDefinition meshdefinition = new MeshDefinition(); PartDefinition partdefinition = meshdefinition.getRoot(); @@ -59,7 +48,7 @@ public static LayerDefinition createBodyLayer() { PartDefinition bb_main = partdefinition.addOrReplaceChild("bb_main", CubeListBuilder.create().texOffs(0, 0).addBox(-10.5F, -39.0F, 6.0F, 21.0F, 39.0F, 2.0F, new CubeDeformation(0.0F)).texOffs(35, 42).addBox(-9.0F, -39.0F, 3.025F, 18.0F, 5.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F)); - ShellModel.splice(partdefinition); + ShellModel.addMaterializationPart(partdefinition); return LayerDefinition.create(meshdefinition, 128, 128); } @@ -73,6 +62,14 @@ public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, i bb_main.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); } + @Override + public void renderInteriorDoor(GlobalDoorBlockEntity doorBlockEntity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + bone.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + bone2.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + bb_main.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + } + @Override public ModelPart root() { return root; diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/GrowthDoorModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/GrowthDoorModel.java similarity index 70% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/GrowthDoorModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/GrowthDoorModel.java index 9066299be..e1b0a0f6d 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/GrowthDoorModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/GrowthDoorModel.java @@ -1,6 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.door;// Made with Blockbench 4.5.2 -// Exported for Minecraft version 1.17 - 1.18 with Mojang mappings -// Paste this class into your mod and generate all required imports +package whocraft.tardis_refined.client.model.blockentity.door.interior; import com.mojang.blaze3d.vertex.PoseStack; @@ -8,18 +6,16 @@ import net.minecraft.client.model.geom.ModelPart; import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; -import net.minecraft.world.entity.Entity; import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; -import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; +import whocraft.tardis_refined.common.blockentity.door.GlobalDoorBlockEntity; -public class GrowthDoorModel extends ShellModel { +public class GrowthDoorModel extends ShellDoorModel { private final ModelPart root; private final ModelPart door_closed; private final ModelPart door_open; private final ModelPart bb_main; public GrowthDoorModel(ModelPart root) { - super(root); this.root = root; this.door_closed = root.getChild("door_closed"); this.door_open = root.getChild("door_open"); @@ -41,15 +37,15 @@ public static LayerDefinition createBodyLayer() { PartDefinition bb_main = partdefinition.addOrReplaceChild("bb_main", CubeListBuilder.create().texOffs(44, 46).addBox(-5.5F, -34.0F, 7.55F, 11.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)) .texOffs(0, 0).addBox(-15.5F, -44.0F, 7.825F, 31.0F, 44.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F)); - ShellModel.splice(partdefinition); + ShellModel.addMaterializationPart(partdefinition); return LayerDefinition.create(meshdefinition, 128, 128); } boolean isDoorOpen = false; - @Override - public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + @Override + public void renderInteriorDoor(GlobalDoorBlockEntity doorBlockEntity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { door_closed.visible = !isDoorOpen; door_open.visible = isDoorOpen; @@ -65,22 +61,8 @@ public ModelPart root() { } @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { this.isDoorOpen = open; } - @Override - public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - - } - - @Override - public boolean isDoorModel() { - return true; - } - - @Override - public void setupAnim(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { - - } } \ No newline at end of file diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/HieroglyphShellDoor.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/HieroglyphShellDoor.java new file mode 100644 index 000000000..cb143f8b4 --- /dev/null +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/HieroglyphShellDoor.java @@ -0,0 +1,116 @@ +package whocraft.tardis_refined.client.model.blockentity.door.interior; + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import net.minecraft.client.model.geom.ModelPart; +import net.minecraft.client.model.geom.PartPose; +import net.minecraft.client.model.geom.builders.*; +import whocraft.tardis_refined.common.blockentity.door.GlobalDoorBlockEntity; + +public class HieroglyphShellDoor extends ShellDoorModel{ + + private final ModelPart root; + private final ModelPart door_closed; + private final ModelPart door_open; + private final ModelPart bone6; + private final ModelPart pillars; + private final ModelPart bone18; + private final ModelPart bb_main; + + + public HieroglyphShellDoor(ModelPart modelPart) { + this.root = modelPart; + this.door_closed = root.getChild("door_closed"); + this.door_open = root.getChild("door_open"); + this.bone6 = root.getChild("bone6"); + this.pillars = root.getChild("pillars"); + this.bone18 = root.getChild("bone18"); + this.bb_main = root.getChild("bb_main"); + } + + public static LayerDefinition createBodyLayer() { + MeshDefinition meshdefinition = new MeshDefinition(); + PartDefinition partdefinition = meshdefinition.getRoot(); + + PartDefinition door_closed = partdefinition.addOrReplaceChild("door_closed", CubeListBuilder.create().texOffs(66, 69).addBox(-7.5F, -33.0F, -7.5F, 15.0F, 31.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(95, 98).addBox(-5.0F, -27.0F, -11.0F, 10.0F, 3.0F, 4.0F, new CubeDeformation(0.025F)) + .texOffs(0, 25).addBox(2.5F, -24.0F, -9.5F, 2.0F, 12.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(0, 25).mirror().addBox(-4.5F, -24.0F, -9.5F, 2.0F, 12.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(98, 33).addBox(-5.0F, -12.0F, -11.0F, 10.0F, 12.0F, 4.0F, new CubeDeformation(0.0F)) + .texOffs(64, 33).addBox(-4.5F, -11.5F, -10.5F, 9.0F, 9.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 12.5F)); + + PartDefinition cube_r1 = door_closed.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(0, 13).addBox(-2.5F, -2.5F, -1.0F, 5.0F, 5.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -12.0F, -9.0F, 0.0F, 0.0F, 0.7854F)); + + PartDefinition cube_r2 = door_closed.addOrReplaceChild("cube_r2", CubeListBuilder.create().texOffs(99, 69).addBox(-5.0F, -5.0F, 0.0F, 10.0F, 5.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -27.0F, -11.0F, -0.5236F, 0.0F, 0.0F)); + + PartDefinition bone29 = door_closed.addOrReplaceChild("bone29", CubeListBuilder.create().texOffs(9, 25).addBox(-1.5F, 0.0F, 0.25F, 3.0F, 5.0F, 1.0F, new CubeDeformation(0.25F)), PartPose.offset(0.0F, -24.0F, -9.75F)); + + PartDefinition door_open = partdefinition.addOrReplaceChild("door_open", CubeListBuilder.create().texOffs(33, 69).addBox(5.5F, -33.0F, -7.5F, 15.0F, 33.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(0, 60).addBox(5.5F, -33.0F, -6.5F, 15.0F, 33.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(95, 98).addBox(8.0F, -27.0F, -11.0F, 10.0F, 3.0F, 4.0F, new CubeDeformation(0.025F)) + .texOffs(9, 25).addBox(11.5F, -24.0F, -9.5F, 3.0F, 5.0F, 1.0F, new CubeDeformation(0.25F)) + .texOffs(0, 25).addBox(15.5F, -24.0F, -9.5F, 2.0F, 12.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(0, 25).mirror().addBox(8.5F, -24.0F, -9.5F, 2.0F, 12.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(98, 33).addBox(8.0F, -12.0F, -11.0F, 10.0F, 12.0F, 4.0F, new CubeDeformation(0.0F)) + .texOffs(64, 33).addBox(8.5F, -11.5F, -10.5F, 9.0F, 9.0F, 3.0F, new CubeDeformation(0.0F)) + .texOffs(0, 49).addBox(-8.5F, -0.2F, -14.75F, 26.0F, 1.0F, 9.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(1.5F, 24.0F, 8.0F, 0.0F, -0.0873F, 0.0F)); + + PartDefinition cube_r3 = door_open.addOrReplaceChild("cube_r3", CubeListBuilder.create().texOffs(0, 13).addBox(-2.5F, -2.5F, -1.0F, 5.0F, 5.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(13.0F, -12.0F, -9.0F, 0.0F, 0.0F, 0.7854F)); + + PartDefinition cube_r4 = door_open.addOrReplaceChild("cube_r4", CubeListBuilder.create().texOffs(99, 69).addBox(-5.0F, -5.0F, 0.0F, 10.0F, 5.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(13.0F, -27.0F, -11.0F, -0.5236F, 0.0F, 0.0F)); + + PartDefinition bone6 = partdefinition.addOrReplaceChild("bone6", CubeListBuilder.create().texOffs(0, 40).addBox(1.25F, -40.0F, -8.5F, 6.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(0, 40).mirror().addBox(-7.25F, -40.0F, -8.5F, 6.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(0.0F, 22.0F, 12.5F)); + + PartDefinition bone5 = bone6.addOrReplaceChild("bone5", CubeListBuilder.create(), PartPose.offsetAndRotation(-3.245F, -36.7704F, -8.0F, 0.0F, -0.0044F, 0.0F)); + + PartDefinition cube_r5 = bone5.addOrReplaceChild("cube_r5", CubeListBuilder.create().texOffs(33, 60).mirror().addBox(-0.55F, 0.0F, 0.0F, 8.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-3.755F, -0.2296F, -1.5F, 0.0F, 0.0F, -0.3491F)); + + PartDefinition bone2 = bone6.addOrReplaceChild("bone2", CubeListBuilder.create(), PartPose.offsetAndRotation(3.245F, -36.7704F, -8.0F, 0.0F, 0.0044F, 0.0F)); + + PartDefinition cube_r6 = bone2.addOrReplaceChild("cube_r6", CubeListBuilder.create().texOffs(33, 60).addBox(-7.45F, 0.0F, 0.0F, 8.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(3.755F, -0.2296F, -1.5F, 0.0F, 0.0F, 0.3491F)); + + PartDefinition pillars = partdefinition.addOrReplaceChild("pillars", CubeListBuilder.create(), PartPose.offset(0.0F, 24.0F, 12.5F)); + + PartDefinition bone3 = pillars.addOrReplaceChild("bone3", CubeListBuilder.create().texOffs(0, 0).addBox(6.5F, -10.0F, -10.5F, 4.0F, 8.0F, 4.0F, new CubeDeformation(0.0F)) + .texOffs(0, 95).addBox(7.0F, -41.0F, -9.5F, 3.0F, 31.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 0.0F)); + + PartDefinition bone4 = pillars.addOrReplaceChild("bone4", CubeListBuilder.create().texOffs(0, 0).mirror().addBox(-10.5F, -10.0F, -10.5F, 4.0F, 8.0F, 4.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(0, 95).mirror().addBox(-10.0F, -41.0F, -9.5F, 3.0F, 31.0F, 3.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(0.0F, 0.0F, 0.0F)); + + PartDefinition bone18 = partdefinition.addOrReplaceChild("bone18", CubeListBuilder.create().texOffs(98, 50).addBox(-7.5F, -34.0F, -9.25F, 15.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 22.0F, 12.5F)); + + PartDefinition bb_main = partdefinition.addOrReplaceChild("bb_main", CubeListBuilder.create().texOffs(17, 42).addBox(-10.5F, -2.0F, 2.0F, 21.0F, 2.0F, 4.0F, new CubeDeformation(0.0F)) + .texOffs(17, 17).addBox(-10.5F, -39.0F, 2.0F, 21.0F, 3.0F, 4.0F, new CubeDeformation(0.0F)) + .texOffs(69, 60).addBox(-6.5F, -45.0F, 6.0F, 13.0F, 6.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(85, 0).addBox(-7.0F, -33.0F, 5.5F, 14.0F, 31.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(15, 105).addBox(-10.5F, -39.0F, 6.0F, 21.0F, 39.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F)); + + return LayerDefinition.create(meshdefinition, 256, 256); + } + + + + @Override + public void renderInteriorDoor(GlobalDoorBlockEntity doorBlockEntity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + door_closed.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + door_open.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + bone6.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + pillars.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + bone18.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + bb_main.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + + door_closed.visible = !open; + door_open.visible = open; + } + + @Override + public void setDoorPosition(boolean open) { + + } + + @Override + public ModelPart root() { + return root; + } +} diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/LiftShellDoorModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/LiftShellDoorModel.java new file mode 100644 index 000000000..54ae367e6 --- /dev/null +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/LiftShellDoorModel.java @@ -0,0 +1,100 @@ +package whocraft.tardis_refined.client.model.blockentity.door.interior; + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import net.minecraft.client.model.geom.ModelPart; +import net.minecraft.client.model.geom.PartPose; +import net.minecraft.client.model.geom.builders.*; +import whocraft.tardis_refined.common.blockentity.door.GlobalDoorBlockEntity; + +public class LiftShellDoorModel extends ShellDoorModel { + + private final ModelPart bone28; + private final ModelPart doorOpen, doorClosed; + + public LiftShellDoorModel(ModelPart modelPart) { + this.bone28 = modelPart.getChild("bone28"); + this.doorOpen = bone28.getChild("door_open"); + this.doorClosed = bone28.getChild("door_closed"); + } + + public static LayerDefinition createBodyLayer() { + MeshDefinition meshdefinition = new MeshDefinition(); + PartDefinition partdefinition = meshdefinition.getRoot(); + + PartDefinition bone28 = partdefinition.addOrReplaceChild("bone28", CubeListBuilder.create().texOffs(0, 0).addBox(-10.0F, -39.0F, 0.25F, 20.0F, 39.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(0, 73).addBox(-9.0F, -35.0F, -1.0F, 18.0F, 3.0F, 1.0F, new CubeDeformation(0.025F)) + .texOffs(66, 72).addBox(-9.5F, -36.0F, -1.5F, 19.0F, 1.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(42, 33).addBox(-5.5F, -40.5F, -0.775F, 11.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 7.0F)); + + PartDefinition door_open = bone28.addOrReplaceChild("door_open", CubeListBuilder.create().texOffs(38, 73).addBox(5.0F, -32.0F, -1.0F, 3.0F, 32.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(-13.0F, 0.0F, 0.0F)); + + PartDefinition door_closed = bone28.addOrReplaceChild("door_closed", CubeListBuilder.create().texOffs(42, 0).addBox(-8.0F, -32.0F, -1.0F, 16.0F, 32.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(34, 40).addBox(-8.0F, -32.0F, -0.25F, 16.0F, 32.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 0.0F)); + + PartDefinition bone7 = door_closed.addOrReplaceChild("bone7", CubeListBuilder.create(), PartPose.offset(0.0F, 0.0F, 0.0F)); + + PartDefinition bone6 = bone7.addOrReplaceChild("bone6", CubeListBuilder.create(), PartPose.offset(4.0F, -11.0F, -0.5F)); + + PartDefinition cube_r1 = bone6.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(70, 75).mirror().addBox(0.0F, -5.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(1.0F, -5.5F, 0.0F, 0.0F, 0.0F, 0.4189F)); + + PartDefinition cube_r2 = bone6.addOrReplaceChild("cube_r2", CubeListBuilder.create().texOffs(66, 75).mirror().addBox(0.0F, 0.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(1.0F, -5.5F, 0.0F, 0.0F, 0.0F, -0.4189F)); + + PartDefinition bone5 = bone7.addOrReplaceChild("bone5", CubeListBuilder.create(), PartPose.offset(-4.0F, -11.0F, -0.5F)); + + PartDefinition cube_r3 = bone5.addOrReplaceChild("cube_r3", CubeListBuilder.create().texOffs(70, 75).addBox(-1.0F, -5.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-1.0F, -5.5F, 0.0F, 0.0F, 0.0F, -0.4189F)); + + PartDefinition cube_r4 = bone5.addOrReplaceChild("cube_r4", CubeListBuilder.create().texOffs(66, 75).addBox(-1.0F, 0.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-1.0F, -5.5F, 0.0F, 0.0F, 0.0F, 0.4189F)); + + PartDefinition bone4 = bone7.addOrReplaceChild("bone4", CubeListBuilder.create(), PartPose.offset(-4.0F, -11.0F, -0.5F)); + + PartDefinition cube_r5 = bone4.addOrReplaceChild("cube_r5", CubeListBuilder.create().texOffs(66, 75).mirror().addBox(0.0F, 0.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, -0.4189F)); + + PartDefinition cube_r6 = bone4.addOrReplaceChild("cube_r6", CubeListBuilder.create().texOffs(66, 75).addBox(-1.0F, 0.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-1.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.4189F)); + + PartDefinition bone3 = bone7.addOrReplaceChild("bone3", CubeListBuilder.create(), PartPose.offset(5.0F, -11.0F, -0.5F)); + + PartDefinition cube_r7 = bone3.addOrReplaceChild("cube_r7", CubeListBuilder.create().texOffs(66, 75).mirror().addBox(0.0F, 0.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, -0.4189F)); + + PartDefinition cube_r8 = bone3.addOrReplaceChild("cube_r8", CubeListBuilder.create().texOffs(66, 75).addBox(-1.0F, 0.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-1.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.4189F)); + + PartDefinition bone2 = bone7.addOrReplaceChild("bone2", CubeListBuilder.create(), PartPose.offset(5.0F, -22.0F, -0.5F)); + + PartDefinition cube_r9 = bone2.addOrReplaceChild("cube_r9", CubeListBuilder.create().texOffs(66, 75).mirror().addBox(0.0F, -5.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.4189F)); + + PartDefinition cube_r10 = bone2.addOrReplaceChild("cube_r10", CubeListBuilder.create().texOffs(66, 75).addBox(-1.0F, -5.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-1.0F, 0.0F, 0.0F, 0.0F, 0.0F, -0.4189F)); + + PartDefinition bone = bone7.addOrReplaceChild("bone", CubeListBuilder.create(), PartPose.offset(-4.0F, -22.0F, -0.5F)); + + PartDefinition cube_r11 = bone.addOrReplaceChild("cube_r11", CubeListBuilder.create().texOffs(66, 75).mirror().addBox(0.0F, -5.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.4189F)); + + PartDefinition cube_r12 = bone.addOrReplaceChild("cube_r12", CubeListBuilder.create().texOffs(66, 75).addBox(-1.0F, -5.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-1.0F, 0.0F, 0.0F, 0.0F, 0.0F, -0.4189F)); + + PartDefinition bone10 = bone28.addOrReplaceChild("bone10", CubeListBuilder.create().texOffs(68, 33).addBox(8.0F, -37.0F, -1.75F, 2.0F, 37.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(46, 73).addBox(-8.5F, -33.25F, -3.5F, 3.0F, 1.0F, 3.0F, new CubeDeformation(0.0F)) + .texOffs(74, 31).addBox(-7.5F, -33.225F, -2.5F, 16.0F, 1.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(68, 33).mirror().addBox(-10.0F, -37.0F, -1.75F, 2.0F, 37.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(58, 73).addBox(7.5F, -22.0F, -2.25F, 3.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 0.0F)); + + PartDefinition blackface = bone28.addOrReplaceChild("blackface", CubeListBuilder.create().texOffs(0, 40).addBox(-8.0F, -32.0F, -0.75F, 16.0F, 32.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 1.0F)); + + PartDefinition clock_hand = bone28.addOrReplaceChild("clock_hand", CubeListBuilder.create().texOffs(74, 75).addBox(-0.5F, -2.5F, 0.25F, 1.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -37.0F, -1.275F)); + + return LayerDefinition.create(meshdefinition, 128, 128); + } + + + @Override + public void renderInteriorDoor(GlobalDoorBlockEntity doorBlockEntity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + bone28.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + doorOpen.visible = isDoorOpen; + doorClosed.visible = !isDoorOpen; + } + + public boolean isDoorOpen = false; + + @Override + public void setDoorPosition(boolean open) { + isDoorOpen = open; + } +} diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/MysticDoorModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/MysticDoorModel.java similarity index 85% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/MysticDoorModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/MysticDoorModel.java index a4de902bc..7a6605535 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/MysticDoorModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/MysticDoorModel.java @@ -1,4 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.door; +package whocraft.tardis_refined.client.model.blockentity.door.interior; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; @@ -6,10 +6,9 @@ import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; import net.minecraft.world.entity.Entity; -import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; -import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; +import whocraft.tardis_refined.common.blockentity.door.GlobalDoorBlockEntity; -public class MysticDoorModel extends ShellModel { +public class MysticDoorModel extends ShellDoorModel { private final ModelPart right_door; private final ModelPart left_door; @@ -17,7 +16,6 @@ public class MysticDoorModel extends ShellModel { private final ModelPart root; public MysticDoorModel(ModelPart root) { - super(root); this.root = root; this.right_door = root.getChild("right_door"); this.left_door = root.getChild("left_door"); @@ -57,7 +55,6 @@ public static LayerDefinition createBodyLayer() { PartDefinition bone4 = bone3.addOrReplaceChild("bone4", CubeListBuilder.create(), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.5708F, 0.0F)); PartDefinition bone5 = bone4.addOrReplaceChild("bone5", CubeListBuilder.create(), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.5708F, 0.0F)); - splice(partdefinition); return LayerDefinition.create(meshdefinition, 128, 128); } @@ -68,6 +65,13 @@ public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, i left_door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); root_door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); } + @Override + public void renderInteriorDoor(GlobalDoorBlockEntity doorBlockEntity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + right_door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + left_door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + root_door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + } + @Override public ModelPart root() { return root; @@ -79,7 +83,7 @@ public void setupAnim(Entity entity, float limbSwing, float limbSwingAmount, flo } @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { if (open) { this.left_door.yRot = -250f; this.right_door.yRot = 250f; @@ -89,14 +93,5 @@ public void setDoorOpen(boolean open) { } } - @Override - public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - - } - - @Override - public boolean isDoorModel() { - return true; - } } \ No newline at end of file diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/NukaDoorModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/NukaDoorModel.java similarity index 79% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/NukaDoorModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/NukaDoorModel.java index 5c5c664aa..d8efb111a 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/NukaDoorModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/NukaDoorModel.java @@ -1,6 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.door;// Made with Blockbench 4.5.2 -// Exported for Minecraft version 1.17 - 1.18 with Mojang mappings -// Paste this class into your mod and generate all required imports +package whocraft.tardis_refined.client.model.blockentity.door.interior; import com.mojang.blaze3d.vertex.PoseStack; @@ -10,16 +8,15 @@ import net.minecraft.client.model.geom.builders.*; import net.minecraft.world.entity.Entity; import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; -import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; +import whocraft.tardis_refined.common.blockentity.door.GlobalDoorBlockEntity; -public class NukaDoorModel extends ShellModel { +public class NukaDoorModel extends ShellDoorModel { private final ModelPart root; private final ModelPart left_door; private final ModelPart right_door; private final ModelPart bb_main; public NukaDoorModel(ModelPart root) { - super(root); this.root = root; this.left_door = root.getChild("left_door"); this.right_door = root.getChild("right_door"); @@ -41,7 +38,7 @@ public static LayerDefinition createBodyLayer() { PartDefinition cube_r2 = bb_main.addOrReplaceChild("cube_r2", CubeListBuilder.create().texOffs(51, 47).addBox(-1.5F, -36.5F, -1.5F, 3.0F, 35.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(9.5F, 1.5F, 6.5F, 0.0F, -0.7854F, 0.0F)); - ShellModel.splice(partdefinition); + ShellModel.addMaterializationPart(partdefinition); return LayerDefinition.create(meshdefinition, 128, 128); } @@ -52,6 +49,11 @@ public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, i root.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); } + @Override + public void renderInteriorDoor(GlobalDoorBlockEntity doorBlockEntity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + + } + @Override public ModelPart root() { return root; @@ -63,7 +65,7 @@ public void setupAnim(Entity entity, float f, float g, float h, float i, float j } @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { if (open) { this.left_door.yRot = -250f; this.right_door.yRot = 250f; @@ -73,13 +75,4 @@ public void setDoorOpen(boolean open) { } } - @Override - public boolean isDoorModel() { - return true; - } - - @Override - public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - - } } \ No newline at end of file diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/PagodaDoorModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/PagodaDoorModel.java similarity index 86% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/PagodaDoorModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/PagodaDoorModel.java index 9d1c0a727..98a776e6d 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/PagodaDoorModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/PagodaDoorModel.java @@ -1,6 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.door;// Made with Blockbench 4.6.4 -// Exported for Minecraft version 1.17 or later with Mojang mappings -// Paste this class into your mod and generate all required imports +package whocraft.tardis_refined.client.model.blockentity.door.interior; import com.mojang.blaze3d.vertex.PoseStack; @@ -10,9 +8,9 @@ import net.minecraft.client.model.geom.builders.*; import net.minecraft.world.entity.Entity; import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; -import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; +import whocraft.tardis_refined.common.blockentity.door.GlobalDoorBlockEntity; -public class PagodaDoorModel extends ShellModel { +public class PagodaDoorModel extends ShellDoorModel { private final ModelPart root; private final ModelPart door; private final ModelPart bone10; @@ -23,7 +21,6 @@ public class PagodaDoorModel extends ShellModel { private final ModelPart bb_main; public PagodaDoorModel(ModelPart root) { - super(root); this.root = root; this.door = root.getChild("door"); this.bone10 = root.getChild("bone10"); @@ -78,44 +75,35 @@ public static LayerDefinition createBodyLayer() { PartDefinition bb_main = partdefinition.addOrReplaceChild("bb_main", CubeListBuilder.create().texOffs(0, 0).addBox(-9.0F, -38.0F, 5.0F, 18.0F, 38.0F, 3.0F, new CubeDeformation(0.0F)) .texOffs(0, 76).addBox(-9.0F, -0.025F, 3.0F, 18.0F, 1.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F)); - ShellModel.splice(partdefinition); + ShellModel.addMaterializationPart(partdefinition); return LayerDefinition.create(meshdefinition, 128, 128); } @Override - public ModelPart root() { - return root; + public void renderInteriorDoor(GlobalDoorBlockEntity doorBlockEntity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + bone10.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + bone9.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + bone13.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + bone.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + bone4.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + bb_main.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); } @Override - public void setupAnim(Entity entity, float f, float g, float h, float i, float j) { - + public ModelPart root() { + return root; } @Override - public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - - } + public void setupAnim(Entity entity, float f, float g, float h, float i, float j) { - @Override - public boolean isDoorModel() { - return true; } @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { this.door.yRot = (open) ? -275f : 0; } - @Override - public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); - bone10.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); - bone9.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); - bone13.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); - bone.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); - bone4.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); - bb_main.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); - } } \ No newline at end of file diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/PhoneBoothDoorModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/PhoneBoothDoorModel.java similarity index 81% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/PhoneBoothDoorModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/PhoneBoothDoorModel.java index 04a198f06..5bb6c0f2c 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/PhoneBoothDoorModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/PhoneBoothDoorModel.java @@ -1,4 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.door; +package whocraft.tardis_refined.client.model.blockentity.door.interior; import com.mojang.blaze3d.vertex.PoseStack; @@ -8,10 +8,10 @@ import net.minecraft.client.model.geom.builders.*; import net.minecraft.world.entity.Entity; import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; -import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; +import whocraft.tardis_refined.common.blockentity.door.GlobalDoorBlockEntity; import whocraft.tardis_refined.compat.ModCompatChecker; -public class PhoneBoothDoorModel extends ShellModel { +public class PhoneBoothDoorModel extends ShellDoorModel { private final ModelPart Door2; private final ModelPart bone5; @@ -20,7 +20,6 @@ public class PhoneBoothDoorModel extends ShellModel { private final ModelPart root; public PhoneBoothDoorModel(ModelPart root) { - super(root); this.root = root; this.Door2 = root.getChild("Door2"); this.bone5 = root.getChild("bone5"); @@ -49,15 +48,14 @@ public static LayerDefinition createBodyLayer() { PartDefinition bb_main = partdefinition.addOrReplaceChild("bb_main", CubeListBuilder.create().texOffs(40, 27).addBox(-8.5F, -40.0F, 7.225F, 17.0F, 4.0F, 1.0F, new CubeDeformation(0.0F)) .texOffs(0, 79).addBox(-9.0F, -37.0F, 7.25F, 18.0F, 37.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F)); - ShellModel.splice(partdefinition); + ShellModel.addMaterializationPart(partdefinition); return LayerDefinition.create(meshdefinition, 128, 128); } - @Override - public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + public void renderInteriorDoor(GlobalDoorBlockEntity doorBlockEntity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { Door2.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); bone5.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); bone10.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); @@ -75,17 +73,7 @@ public void setupAnim(Entity entity, float f, float g, float h, float i, float j } @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { this.Door2.yRot = (open) ? (ModCompatChecker.immersivePortals() ? 1.75f : -1.75f) : 0; } - - @Override - public boolean isDoorModel() { - return true; - } - - @Override - public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - - } } \ No newline at end of file diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/PoliceBoxDoorModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/PoliceBoxDoorModel.java similarity index 82% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/PoliceBoxDoorModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/PoliceBoxDoorModel.java index c37fc0077..82798e8fe 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/PoliceBoxDoorModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/PoliceBoxDoorModel.java @@ -1,4 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.door; +package whocraft.tardis_refined.client.model.blockentity.door.interior; import com.mojang.blaze3d.vertex.PoseStack; @@ -8,16 +8,15 @@ import net.minecraft.client.model.geom.builders.*; import net.minecraft.world.entity.Entity; import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; -import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; +import whocraft.tardis_refined.common.blockentity.door.GlobalDoorBlockEntity; -public class PoliceBoxDoorModel extends ShellModel { +public class PoliceBoxDoorModel extends ShellDoorModel { private final ModelPart left_door; private final ModelPart right_door; private final ModelPart frame; public PoliceBoxDoorModel(ModelPart root) { - super(root); this.frame = root.getChild("frame"); this.left_door = root.getChild("left_door"); this.right_door = root.getChild("right_door"); @@ -49,14 +48,14 @@ public static LayerDefinition createBodyLayer() { .texOffs(19, 46).addBox(-10.0F, -37.0F, -11.0F, 2.0F, 35.0F, 2.0F, new CubeDeformation(0.0F)) .texOffs(19, 46).mirror().addBox(8.0F, -37.0F, -11.0F, 2.0F, 35.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(0.0F, 25.0F, 16.75F)); - ShellModel.splice(partdefinition); + ShellModel.addMaterializationPart(partdefinition); return LayerDefinition.create(meshdefinition, 128, 128); } @Override - public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + public void renderInteriorDoor(GlobalDoorBlockEntity doorBlockEntity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { left_door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); right_door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); frame.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); @@ -73,18 +72,8 @@ public void setupAnim(Entity entity, float f, float g, float h, float i, float j } @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { this.right_door.yRot = (open) ? -275f : 0; } - @Override - public void renderShell(GlobalShellBlockEntity entity, boolean open,boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - - } - - @Override - public boolean isDoorModel() { - return true; - } - } \ No newline at end of file diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/PortalooDoorModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/PortalooDoorModel.java similarity index 71% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/PortalooDoorModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/PortalooDoorModel.java index 2097e777c..b01395145 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/PortalooDoorModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/PortalooDoorModel.java @@ -1,6 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.door;// Made with Blockbench 4.6.4 -// Exported for Minecraft version 1.17 or later with Mojang mappings -// Paste this class into your mod and generate all required imports +package whocraft.tardis_refined.client.model.blockentity.door.interior; import com.mojang.blaze3d.vertex.PoseStack; @@ -8,19 +6,17 @@ import net.minecraft.client.model.geom.ModelPart; import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; -import net.minecraft.world.entity.Entity; import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; -import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; +import whocraft.tardis_refined.common.blockentity.door.GlobalDoorBlockEntity; import whocraft.tardis_refined.compat.ModCompatChecker; -public class PortalooDoorModel extends ShellModel { +public class PortalooDoorModel extends ShellDoorModel { private final ModelPart bone; private final ModelPart Door; private final ModelPart root; public PortalooDoorModel(ModelPart root) { - super(root); this.root = root; this.bone = root.getChild("bone"); this.Door = root.getChild("Door"); @@ -45,14 +41,15 @@ public static LayerDefinition createBodyLayer() { .texOffs(47, 4).addBox(-13.0F, -10.5F, -1.0F, 12.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)) .texOffs(47, 7).addBox(-13.0F, 2.0F, -2.75F, 2.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(7.0F, 2.5F, 6.75F)); - ShellModel.splice(partdefinition); + ShellModel.addMaterializationPart(partdefinition); return LayerDefinition.create(meshdefinition, 128, 128); } + @Override - public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + public void renderInteriorDoor(GlobalDoorBlockEntity doorBlockEntity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { bone.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); Door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); } @@ -63,22 +60,8 @@ public ModelPart root() { } @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { this.Door.yRot = (open) ? (ModCompatChecker.immersivePortals() ? 1.75f : -1.75f) : 0; } - @Override - public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - - } - - @Override - public boolean isDoorModel() { - return true; - } - - @Override - public void setupAnim(Entity entity, float f, float g, float h, float i, float j) { - - } } \ No newline at end of file diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/PresentDoorModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/PresentDoorModel.java similarity index 78% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/PresentDoorModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/PresentDoorModel.java index 57285decc..bc54d30d3 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/PresentDoorModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/PresentDoorModel.java @@ -1,4 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.door; +package whocraft.tardis_refined.client.model.blockentity.door.interior; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; @@ -6,11 +6,10 @@ import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; import net.minecraft.world.entity.Entity; -import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; -import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; +import whocraft.tardis_refined.common.blockentity.door.GlobalDoorBlockEntity; import whocraft.tardis_refined.compat.ModCompatChecker; -public class PresentDoorModel extends ShellModel { +public class PresentDoorModel extends ShellDoorModel { private final ModelPart root; private final ModelPart bone2; @@ -18,7 +17,6 @@ public class PresentDoorModel extends ShellModel { private final ModelPart bb_main; public PresentDoorModel(ModelPart root) { - super(root); this.root = root; this.bone2 = root.getChild("bone2"); this.door = root.getChild("door"); @@ -42,14 +40,11 @@ public static LayerDefinition createBodyLayer() { .texOffs(0, 0).addBox(-9.0F, -35.0F, 8.025F, 18.0F, 35.0F, 1.0F, new CubeDeformation(0.0F)) .texOffs(35, 45).mirror().addBox(8.0F, -35.0F, 7.0F, 1.0F, 35.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) .texOffs(42, 45).addBox(-9.0F, -36.0F, 7.0F, 18.0F, 1.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F)); - splice(partdefinition); - return LayerDefinition.create(meshdefinition, 128, 128); } - @Override - public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + public void renderInteriorDoor(GlobalDoorBlockEntity doorBlockEntity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { bone2.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); bb_main.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); @@ -61,20 +56,10 @@ public ModelPart root() { } @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { this.door.xRot = (open) ? (ModCompatChecker.immersivePortals() ? -1.5f : 1.5F) : 0; } - @Override - public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - - } - - @Override - public boolean isDoorModel() { - return true; - } - @Override public void setupAnim(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/ShellDoorModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/ShellDoorModel.java new file mode 100644 index 000000000..905508d7a --- /dev/null +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/ShellDoorModel.java @@ -0,0 +1,32 @@ +package whocraft.tardis_refined.client.model.blockentity.door.interior; + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import net.minecraft.client.model.HierarchicalModel; +import net.minecraft.client.model.geom.ModelPart; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.Entity; +import whocraft.tardis_refined.common.blockentity.door.GlobalDoorBlockEntity; +import whocraft.tardis_refined.patterns.ShellPattern; + +public abstract class ShellDoorModel extends HierarchicalModel { + + public abstract void renderInteriorDoor(GlobalDoorBlockEntity doorBlockEntity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha); + + @Override + public ModelPart root() { + return null; + } + + public abstract void setDoorPosition(boolean open); + + @Override + public void setupAnim(Entity entity, float f, float g, float h, float i, float j) { + throw new RuntimeException("Woah! You should not be calling this...how are you calling this?"); + } + + public ResourceLocation getInteriorDoorTexture(GlobalDoorBlockEntity globalDoorBlockEntity) { + ShellPattern pattern = globalDoorBlockEntity.pattern(); + return pattern.interiorDoorTexture().texture(); + } +} diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/VendingMachineDoorModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/VendingMachineDoorModel.java similarity index 74% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/VendingMachineDoorModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/VendingMachineDoorModel.java index 4a5e768fb..35950a6bf 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/VendingMachineDoorModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/VendingMachineDoorModel.java @@ -1,4 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.door; +package whocraft.tardis_refined.client.model.blockentity.door.interior; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; @@ -7,17 +7,16 @@ import net.minecraft.client.model.geom.builders.*; import net.minecraft.world.entity.Entity; import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; -import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; +import whocraft.tardis_refined.common.blockentity.door.GlobalDoorBlockEntity; import whocraft.tardis_refined.compat.ModCompatChecker; -public class VendingMachineDoorModel extends ShellModel { +public class VendingMachineDoorModel extends ShellDoorModel { private final ModelPart root; private final ModelPart door; private final ModelPart bone11; public VendingMachineDoorModel(ModelPart root) { - super(root); this.root = root; this.door = root.getChild("door"); this.bone11 = root.getChild("bone11"); @@ -31,13 +30,13 @@ public static LayerDefinition createBodyLayer() { PartDefinition bone11 = partdefinition.addOrReplaceChild("bone11", CubeListBuilder.create().texOffs(58, 0).addBox(-7.0F, -35.0F, 0.0F, 14.0F, 6.0F, 3.0F, new CubeDeformation(0.0F)).texOffs(0, 0).addBox(-10.0F, -32.0F, 2.0F, 20.0F, 36.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 20.0F, 6.0F)); - ShellModel.splice(partdefinition); + ShellModel.addMaterializationPart(partdefinition); return LayerDefinition.create(meshdefinition, 128, 128); } @Override - public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + public void renderInteriorDoor(GlobalDoorBlockEntity doorBlockEntity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); bone11.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); } @@ -48,19 +47,10 @@ public ModelPart root() { } @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { this.door.xRot = (open) ? (ModCompatChecker.immersivePortals() ? -1.6f : 1.6F) : 0; } - @Override - public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - - } - - @Override - public boolean isDoorModel() { - return true; - } @Override public void setupAnim(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/life/ArsEggModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/life/ArsEggModel.java index 984a54b4a..75351df95 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/life/ArsEggModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/life/ArsEggModel.java @@ -2,53 +2,98 @@ import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; +import net.minecraft.client.animation.AnimationChannel; +import net.minecraft.client.animation.AnimationDefinition; +import net.minecraft.client.animation.Keyframe; +import net.minecraft.client.animation.KeyframeAnimations; import net.minecraft.client.model.HierarchicalModel; import net.minecraft.client.model.geom.ModelPart; import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; +import net.minecraft.world.entity.AnimationState; import net.minecraft.world.entity.Entity; +import net.minecraft.world.level.block.state.BlockState; +import whocraft.tardis_refined.common.block.life.ArsEggBlock; +import whocraft.tardis_refined.common.blockentity.life.ArsEggBlockEntity; public class ArsEggModel extends HierarchicalModel { - private final ModelPart bone; - private final ModelPart bone2; - private final ModelPart bb_main; + private final ModelPart Lamp; + private final ModelPart root; + + public static final AnimationDefinition SWINGING = AnimationDefinition.Builder.withLength(8.0F).looping() + .addAnimation("Lamp", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, -2.5F), AnimationChannel.Interpolations.CATMULLROM), + new Keyframe(2.0F, KeyframeAnimations.degreeVec(0.0F, 5.0F, 0.0F), AnimationChannel.Interpolations.CATMULLROM), + new Keyframe(4.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 2.5F), AnimationChannel.Interpolations.CATMULLROM), + new Keyframe(6.0F, KeyframeAnimations.degreeVec(0.0F, -5.0F, 0.0F), AnimationChannel.Interpolations.CATMULLROM), + new Keyframe(8.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, -2.5F), AnimationChannel.Interpolations.CATMULLROM) + )) + .build(); + + public static final AnimationDefinition CRASHING = AnimationDefinition.Builder.withLength(7.875F).looping() + .addAnimation("Lamp", new AnimationChannel(AnimationChannel.Targets.ROTATION, + new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, -6.7F, -0.79F), AnimationChannel.Interpolations.CATMULLROM), + new Keyframe(1.5F, KeyframeAnimations.degreeVec(0.4217F, 22.6276F, 2.087F), AnimationChannel.Interpolations.CATMULLROM), + new Keyframe(3.0F, KeyframeAnimations.degreeVec(-0.106F, -0.9725F, -7.5631F), AnimationChannel.Interpolations.CATMULLROM), + new Keyframe(4.5F, KeyframeAnimations.degreeVec(-3.3138F, -8.9145F, 9.1782F), AnimationChannel.Interpolations.CATMULLROM), + new Keyframe(6.0F, KeyframeAnimations.degreeVec(-0.102F, -10.1874F, 1.7066F), AnimationChannel.Interpolations.CATMULLROM), + new Keyframe(7.5F, KeyframeAnimations.degreeVec(0.0F, -6.7F, -0.79F), AnimationChannel.Interpolations.CATMULLROM) + )) + .build(); + private final ModelPart clamp; + public ArsEggModel(ModelPart root) { - this.bone = root.getChild("bone"); - this.bone2 = root.getChild("bone2"); - this.bb_main = root.getChild("bb_main"); + this.Lamp = root.getChild("Lamp"); + this.clamp = Lamp.getChild("clamp"); + this.root = root; } public static LayerDefinition createBodyLayer() { MeshDefinition meshdefinition = new MeshDefinition(); PartDefinition partdefinition = meshdefinition.getRoot(); - PartDefinition bone = partdefinition.addOrReplaceChild("bone", CubeListBuilder.create().texOffs(0, 25).addBox(-9.0F, -1.5F, 0.0F, 18.0F, 16.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 9.0F, 0.0F, 0.0F, -0.7854F, 0.0F)); + PartDefinition Lamp = partdefinition.addOrReplaceChild("Lamp", CubeListBuilder.create(), PartPose.offset(0.0F, 11.0F, 0.0F)); - PartDefinition bone2 = partdefinition.addOrReplaceChild("bone2", CubeListBuilder.create().texOffs(0, 25).addBox(-9.0F, -1.5F, 0.0F, 18.0F, 16.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 9.0F, 0.0F, 0.0F, 0.7854F, 0.0F)); + PartDefinition clamp = Lamp.addOrReplaceChild("clamp", CubeListBuilder.create().texOffs(18, 20).addBox(-4.0F, -10.0F, -1.0F, 8.0F, 1.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(0, 17).addBox(-3.0F, -11.0F, -3.0F, 6.0F, 2.0F, 6.0F, new CubeDeformation(0.0F)) + .texOffs(20, 23).addBox(-2.0F, -13.0F, -2.0F, 4.0F, 2.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 13.0F, 0.0F)); - PartDefinition bb_main = partdefinition.addOrReplaceChild("bb_main", CubeListBuilder.create().texOffs(0, 0).addBox(-6.0F, -13.0F, -6.0F, 12.0F, 12.0F, 12.0F, new CubeDeformation(0.0F)) - .texOffs(37, 0).addBox(-3.0F, -16.0F, -3.0F, 6.0F, 3.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F)); + PartDefinition cube_r1 = clamp.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(18, 17).addBox(-4.0F, -10.0F, -1.0F, 8.0F, 1.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 1.5708F, 0.0F)); + + PartDefinition bulb = Lamp.addOrReplaceChild("bulb", CubeListBuilder.create().texOffs(0, 0).addBox(-4.0F, -9.0F, -4.0F, 8.0F, 9.0F, 8.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 13.0F, 0.0F)); return LayerDefinition.create(meshdefinition, 64, 64); } + public void renderToBuffer(ArsEggBlockEntity arsEggBlockEntity, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + BlockState blockState = arsEggBlockEntity.getBlockState(); + + if (blockState.hasProperty(ArsEggBlock.ALIVE)) { + clamp.visible = blockState.getValue(ArsEggBlock.ALIVE); + } + + Lamp.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + } + @Override public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - bone.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); - bone2.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); - bb_main.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + Lamp.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); } @Override public ModelPart root() { - return this.bb_main; + return this.root; } @Override public void setupAnim(Entity entity, float f, float g, float h, float i, float j) { } + + public void doAnimation(AnimationState liveliness, AnimationDefinition animationDefinition, int animationCounter) { + this.animate(liveliness, animationDefinition, animationCounter); + } } \ No newline at end of file diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/FactoryShellModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/FactoryShellModel.java deleted file mode 100644 index fd791b5ff..000000000 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/FactoryShellModel.java +++ /dev/null @@ -1,90 +0,0 @@ -package whocraft.tardis_refined.client.model.blockentity.shell; - -import com.mojang.blaze3d.vertex.PoseStack; -import com.mojang.blaze3d.vertex.VertexConsumer; -import net.minecraft.client.model.geom.ModelPart; -import net.minecraft.client.model.geom.PartPose; -import net.minecraft.client.model.geom.builders.*; -import net.minecraft.world.entity.Entity; -import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; - -public class FactoryShellModel extends ShellModel { - - private final ModelPart realRoot; - private final ModelPart root; - private final ModelPart leftDoor; - private final ModelPart rightDoor; - - public FactoryShellModel(ModelPart root) { - super(root); - this.realRoot = root; - this.root = root.getChild("root"); - this.leftDoor = this.root.getChild("left_door"); - this.rightDoor = this.root.getChild("right_door"); - } - - public static LayerDefinition createBodyLayer() { - MeshDefinition meshdefinition = new MeshDefinition(); - PartDefinition partdefinition = meshdefinition.getRoot(); - - PartDefinition root = partdefinition.addOrReplaceChild("root", CubeListBuilder.create().texOffs(0, 28).addBox(-10.0F, -3.0F, -8.0F, 20.0F, 3.0F, 20.0F, new CubeDeformation(0.0F)) - .texOffs(0, 0).addBox(-10.0F, -44.0F, -8.0F, 20.0F, 7.0F, 20.0F, new CubeDeformation(0.0F)) - .texOffs(54, 57).addBox(-5.0F, -37.0F, -8.0F, 10.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)) - .texOffs(54, 52).addBox(-5.0F, -5.0F, -8.0F, 10.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)) - .texOffs(35, 52).addBox(-8.0F, -37.0F, -6.0F, 1.0F, 34.0F, 16.0F, new CubeDeformation(0.0F)) - .texOffs(95, 45).addBox(-7.0F, -37.0F, 9.0F, 14.0F, 34.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(0, 52).addBox(7.0F, -37.0F, -6.0F, 1.0F, 34.0F, 16.0F, new CubeDeformation(0.0F)) - .texOffs(19, 52).addBox(-7.0F, -37.0F, -6.0F, 14.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(19, 57).addBox(-7.0F, -5.0F, -6.0F, 14.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(81, 0).mirror().addBox(8.0F, -37.0F, -3.0F, 2.0F, 34.0F, 10.0F, new CubeDeformation(0.0F)).mirror(false) - .texOffs(81, 0).addBox(-10.0F, -37.0F, -3.0F, 2.0F, 34.0F, 10.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, -2.0F)); - - PartDefinition left_door = root.addOrReplaceChild("left_door", CubeListBuilder.create().texOffs(70, 97).addBox(0.0F, -15.0F, -0.5F, 7.0F, 30.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(-7.0F, -20.0F, -5.6F)); - - PartDefinition right_door = root.addOrReplaceChild("right_door", CubeListBuilder.create().texOffs(95, 81).addBox(-7.0F, -15.0F, -0.5F, 7.0F, 30.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(7.0F, -20.0F, -5.6F)); - - PartDefinition bone = root.addOrReplaceChild("bone", CubeListBuilder.create().texOffs(70, 52).addBox(-1.0F, -17.0F, -5.0F, 2.0F, 34.0F, 10.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -20.0F, 11.0F, 0.0F, 1.5708F, 0.0F)); - - ShellModel.splice(partdefinition); - - - return LayerDefinition.create(meshdefinition, 128, 128); - } - - - @Override - public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - root.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); - } - - @Override - public ModelPart root() { - return this.realRoot; - } - - @Override - public void setupAnim(Entity entity, float f, float g, float h, float i, float j) { - } - - @Override - public void setDoorOpen(boolean open) { - if (open) { - this.leftDoor.yRot = 250f; - this.rightDoor.yRot = -250f; - } else { - this.leftDoor.yRot = 0; - this.rightDoor.yRot = 0; - } - } - - @Override - public boolean isDoorModel() { - return false; - } - - @Override - public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - - handleAllAnimations(entity, root(), isBaseModel, open, poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); - } -} \ No newline at end of file diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/PoliceBoxModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/PoliceBoxModel.java deleted file mode 100644 index ec7df4117..000000000 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/PoliceBoxModel.java +++ /dev/null @@ -1,159 +0,0 @@ -package whocraft.tardis_refined.client.model.blockentity.shell; - -import com.mojang.blaze3d.vertex.PoseStack; -import com.mojang.blaze3d.vertex.VertexConsumer; -import net.minecraft.client.model.geom.ModelPart; -import net.minecraft.client.model.geom.PartPose; -import net.minecraft.client.model.geom.builders.*; -import net.minecraft.world.entity.Entity; -import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; - -public class PoliceBoxModel extends ShellModel { - private final ModelPart root; - private final ModelPart left_door; - private final ModelPart right_door; - private final ModelPart frame; - - public PoliceBoxModel(ModelPart root) { - super(root); - this.root = root; - this.frame = root.getChild("frame"); - this.left_door = root.getChild("left_door"); - this.right_door = root.getChild("right_door"); - } - - public static LayerDefinition createBodyLayer() { - MeshDefinition meshdefinition = new MeshDefinition(); - PartDefinition partdefinition = meshdefinition.getRoot(); - - PartDefinition left_door = partdefinition.addOrReplaceChild("left_door", CubeListBuilder.create().texOffs(0, 27).addBox(1.25F, -8.0F, -0.5F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(61, 36).addBox(1.25F, -22.0F, -1.0F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(0, 0).addBox(5.15F, -20.5F, -1.75F, 1.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(0, 27).addBox(1.25F, -15.0F, -0.5F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(13, 52).addBox(0.0F, -30.0F, 0.0F, 8.0F, 30.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(32, 64).addBox(7.5F, -30.0F, -0.5F, 1.0F, 30.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(-8.0F, 22.5F, -10.25F)); - - PartDefinition bone5 = left_door.addOrReplaceChild("bone5", CubeListBuilder.create().texOffs(0, 15).addBox(-2.5F, -6.0F, 0.65F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(3.75F, -23.0F, -0.75F)); - - PartDefinition right_door = partdefinition.addOrReplaceChild("right_door", CubeListBuilder.create().texOffs(0, 27).mirror().addBox(-6.25F, -8.0F, -0.5F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) - .texOffs(0, 35).addBox(-6.25F, -22.0F, -0.5F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(0, 27).mirror().addBox(-6.25F, -15.0F, -0.5F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) - .texOffs(13, 52).mirror().addBox(-8.0F, -30.0F, 0.0F, 8.0F, 30.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) - .texOffs(0, 15).mirror().addBox(-6.25F, -29.0F, -0.1F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(8.0F, 22.5F, -10.25F)); - - PartDefinition frame = partdefinition.addOrReplaceChild("frame", CubeListBuilder.create().texOffs(32, 59).addBox(-8.0F, -33.5F, -10.75F, 16.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)) - .texOffs(0, 27).addBox(-10.0F, -41.0F, -10.0F, 20.0F, 4.0F, 20.0F, new CubeDeformation(0.0F)) - .texOffs(61, 27).addBox(-3.0F, -43.0F, -3.0F, 6.0F, 2.0F, 6.0F, new CubeDeformation(0.0F)) - .texOffs(0, 7).addBox(-2.0F, -46.0F, -2.0F, 4.0F, 3.0F, 4.0F, new CubeDeformation(0.0F)) - .texOffs(0, 0).addBox(-2.5F, -47.0F, -2.5F, 5.0F, 1.0F, 5.0F, new CubeDeformation(0.0F)) - .texOffs(32, 52).addBox(-9.0F, -37.5F, -12.0F, 18.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) - .texOffs(0, 0).addBox(-12.0F, -2.0F, -12.0F, 24.0F, 2.0F, 24.0F, new CubeDeformation(0.0F)) - .texOffs(0, 97).mirror().addBox(-9.5F, -31.5F, -1.25F, 19.0F, 30.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) - .texOffs(0, 117).mirror().addBox(-9.5F, -32.5F, -8.25F, 19.0F, 1.0F, 9.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(0.0F, 24.0F, 0.0F)); - - PartDefinition bone2 = frame.addOrReplaceChild("bone2", CubeListBuilder.create().texOffs(0, 52).mirror().addBox(8.0F, -39.0F, -11.0F, 3.0F, 37.0F, 3.0F, new CubeDeformation(0.0F)).mirror(false) - .texOffs(0, 52).mirror().addBox(8.0F, -39.0F, 8.0F, 3.0F, 37.0F, 3.0F, new CubeDeformation(0.0F)).mirror(false) - .texOffs(0, 52).addBox(-11.0F, -39.0F, 8.0F, 3.0F, 37.0F, 3.0F, new CubeDeformation(0.0F)) - .texOffs(0, 52).addBox(-11.0F, -39.0F, -11.0F, 3.0F, 37.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 0.0F)); - - PartDefinition bone6 = frame.addOrReplaceChild("bone6", CubeListBuilder.create().texOffs(32, 59).addBox(-8.0F, -33.5F, -10.75F, 16.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)) - .texOffs(32, 52).addBox(-9.0F, -37.5F, -12.0F, 18.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.5708F, 0.0F)); - - PartDefinition bone7 = bone6.addOrReplaceChild("bone7", CubeListBuilder.create().texOffs(0, 27).addBox(-6.75F, -9.5F, -10.75F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(0, 27).addBox(-6.75F, -23.5F, -10.75F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(0, 27).addBox(-6.75F, -16.5F, -10.75F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(13, 52).addBox(-8.0F, -31.5F, -10.25F, 8.0F, 30.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(32, 64).addBox(-0.5F, -31.5F, -10.75F, 1.0F, 30.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 0.0F)); - - PartDefinition bone8 = bone7.addOrReplaceChild("bone8", CubeListBuilder.create().texOffs(0, 15).addBox(-2.5F, -6.0F, 0.65F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(-4.25F, -24.5F, -11.0F)); - - PartDefinition bone9 = bone6.addOrReplaceChild("bone9", CubeListBuilder.create().texOffs(0, 27).mirror().addBox(1.75F, -9.5F, -10.75F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) - .texOffs(0, 27).mirror().addBox(1.75F, -23.5F, -10.75F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) - .texOffs(0, 27).mirror().addBox(1.75F, -16.5F, -10.75F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) - .texOffs(13, 52).mirror().addBox(0.0F, -31.5F, -10.25F, 8.0F, 30.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) - .texOffs(32, 64).mirror().addBox(-0.5F, -31.5F, -10.75F, 1.0F, 30.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) - .texOffs(0, 15).mirror().addBox(1.75F, -30.5F, -10.35F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(0.0F, 0.0F, 0.0F)); - - PartDefinition bone10 = frame.addOrReplaceChild("bone10", CubeListBuilder.create().texOffs(32, 59).addBox(-8.0F, -33.5F, -10.75F, 16.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)) - .texOffs(32, 52).addBox(-9.0F, -37.5F, -12.0F, 18.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 3.1416F, 0.0F)); - - PartDefinition bone11 = bone10.addOrReplaceChild("bone11", CubeListBuilder.create().texOffs(0, 27).addBox(-6.75F, -9.5F, -10.75F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(0, 27).addBox(-6.75F, -23.5F, -10.75F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(0, 27).addBox(-6.75F, -16.5F, -10.75F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(13, 52).addBox(-8.0F, -31.5F, -10.25F, 8.0F, 30.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(32, 64).addBox(-0.5F, -31.5F, -10.75F, 1.0F, 30.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 0.0F)); - - PartDefinition bone12 = bone11.addOrReplaceChild("bone12", CubeListBuilder.create().texOffs(0, 15).addBox(-2.5F, -6.0F, 0.65F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(-4.25F, -24.5F, -11.0F)); - - PartDefinition bone13 = bone10.addOrReplaceChild("bone13", CubeListBuilder.create().texOffs(0, 27).mirror().addBox(1.75F, -9.5F, -10.75F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) - .texOffs(0, 27).mirror().addBox(1.75F, -23.5F, -10.75F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) - .texOffs(0, 27).mirror().addBox(1.75F, -16.5F, -10.75F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) - .texOffs(13, 52).mirror().addBox(0.0F, -31.5F, -10.25F, 8.0F, 30.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) - .texOffs(32, 64).mirror().addBox(-0.5F, -31.5F, -10.75F, 1.0F, 30.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) - .texOffs(0, 15).mirror().addBox(1.75F, -30.5F, -10.35F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(0.0F, 0.0F, 0.0F)); - - PartDefinition bone14 = frame.addOrReplaceChild("bone14", CubeListBuilder.create().texOffs(32, 59).addBox(-8.0F, -33.5F, -10.75F, 16.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)) - .texOffs(32, 52).addBox(-9.0F, -37.5F, -12.0F, 18.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 1.5708F, 0.0F)); - - PartDefinition bone15 = bone14.addOrReplaceChild("bone15", CubeListBuilder.create().texOffs(0, 27).addBox(-6.75F, -9.5F, -10.75F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(0, 27).addBox(-6.75F, -23.5F, -10.75F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(0, 27).addBox(-6.75F, -16.5F, -10.75F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(13, 52).addBox(-8.0F, -31.5F, -10.25F, 8.0F, 30.0F, 1.0F, new CubeDeformation(0.0F)) - .texOffs(32, 64).addBox(-0.5F, -31.5F, -10.75F, 1.0F, 30.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 0.0F)); - - PartDefinition bone16 = bone15.addOrReplaceChild("bone16", CubeListBuilder.create().texOffs(0, 15).addBox(-2.5F, -6.0F, 0.65F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(-4.25F, -24.5F, -11.0F)); - - PartDefinition bone17 = bone14.addOrReplaceChild("bone17", CubeListBuilder.create().texOffs(0, 27).mirror().addBox(1.75F, -9.5F, -10.75F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) - .texOffs(0, 27).mirror().addBox(1.75F, -23.5F, -10.75F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) - .texOffs(0, 27).mirror().addBox(1.75F, -16.5F, -10.75F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) - .texOffs(13, 52).mirror().addBox(0.0F, -31.5F, -10.25F, 8.0F, 30.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) - .texOffs(32, 64).mirror().addBox(-0.5F, -31.5F, -10.75F, 1.0F, 30.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) - .texOffs(0, 15).mirror().addBox(1.75F, -30.5F, -10.35F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(0.0F, 0.0F, 0.0F)); - - ShellModel.splice(partdefinition); - - return LayerDefinition.create(meshdefinition, 128, 128); - } - - @Override - public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - poseStack.scale(1.05f, 1.05f, 1.05f); - poseStack.translate(0, -0.07, 0); - frame.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); - left_door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); - right_door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); - } - - @Override - public ModelPart root() { - return this.root; - } - - @Override - public void setupAnim(Entity entity, float f, float g, float h, float i, float j) { - - } - - @Override - public void setDoorOpen(boolean open) { - this.right_door.yRot = (open) ? -275f : 0; - } - - @Override - public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { - if (isBaseModel) { - poseStack.scale(1.05f, 1.05f, 1.05f); - poseStack.translate(0, -0.07, 0); - } - handleAllAnimations(entity,frame,isBaseModel, open, poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); - - frame.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, this.getCurrentAlpha()); - left_door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, this.getCurrentAlpha()); - right_door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, this.getCurrentAlpha()); - } - - @Override - public boolean isDoorModel() { - return false; - } -} \ No newline at end of file diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/ShellEntry.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/ShellEntry.java new file mode 100644 index 000000000..342903d5c --- /dev/null +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/ShellEntry.java @@ -0,0 +1,30 @@ +package whocraft.tardis_refined.client.model.blockentity.shell; + +import whocraft.tardis_refined.client.model.blockentity.door.interior.ShellDoorModel; + +public class ShellEntry { + + private ShellModel shellModel; + private ShellDoorModel shellDoorModel; + + public ShellEntry(ShellModel shellModel, ShellDoorModel shellDoorModel) { + this.shellModel = shellModel; + this.shellDoorModel = shellDoorModel; + } + + public ShellModel getShellModel() { + return shellModel; + } + + public void setShellModel(ShellModel shellModel) { + this.shellModel = shellModel; + } + + public ShellDoorModel getShellDoorModel() { + return shellDoorModel; + } + + public void setShellDoorModel(ShellDoorModel shellDoorModel) { + this.shellDoorModel = shellDoorModel; + } +} diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/ShellModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/ShellModel.java index a86591e31..cebdd34d4 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/ShellModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/ShellModel.java @@ -11,34 +11,32 @@ import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.CubeListBuilder; import net.minecraft.client.model.geom.builders.PartDefinition; -import net.minecraft.core.registries.Registries; -import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; -import whocraft.tardis_refined.TardisRefined; import whocraft.tardis_refined.client.TardisClientData; import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; import whocraft.tardis_refined.patterns.ShellPattern; public abstract class ShellModel extends HierarchicalModel { - public abstract void setDoorOpen(boolean open); - - public abstract boolean isDoorModel(); + public abstract void setDoorPosition(boolean open); public abstract void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha); - public ResourceLocation texture(GlobalShellBlockEntity entity, boolean isEmmissive) { - ShellPattern pattern = entity.pattern(); + + public ResourceLocation getShellTexture(ShellPattern pattern, boolean isEmmissive) { return texture(pattern, isEmmissive); } - public ResourceLocation texture(ShellPattern pattern, boolean isEmmissive) { - if (isDoorModel()) { - return pattern.interiorDoorTexture().texture(); - } + public ResourceLocation getShellTexture(GlobalShellBlockEntity shellBlockEntitys, boolean isEmmissive) { + ShellPattern pattern = shellBlockEntitys.pattern(); + return texture(pattern, isEmmissive); + } + + private ResourceLocation texture(ShellPattern pattern, boolean isEmmissive) { return isEmmissive ? pattern.exteriorDoorTexture().emissiveTexture() : pattern.exteriorDoorTexture().texture(); } + ModelPart fade_value; float initAlpha = 0; @@ -70,7 +68,7 @@ public void handleAllAnimations(GlobalShellBlockEntity entity, ModelPart root, b this.root().getAllParts().forEach(ModelPart::resetPose); TardisClientData reactions = TardisClientData.getInstance(entity.getTardisId()); - setDoorOpen(isDoorOpen); + setDoorPosition(isDoorOpen); if (reactions.isLanding()) { this.animate(reactions.LANDING_ANIMATION, MODEL_LAND, reactions.landingTime * ANIMATION_SPEED); @@ -91,7 +89,7 @@ public void handleSpecialAnimation(GlobalShellBlockEntity entity, PoseStack pose } - public static void splice(PartDefinition partDefinition) { + public static void addMaterializationPart(PartDefinition partDefinition) { partDefinition.addOrReplaceChild("fade_value", CubeListBuilder.create().texOffs(128, 128), PartPose.offset(-24.0F, 24.0F, 0.0F)); } diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/ShellModelCollection.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/ShellModelCollection.java index 8712c9a95..ad4c68a8d 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/ShellModelCollection.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/ShellModelCollection.java @@ -4,6 +4,8 @@ import net.minecraft.client.model.geom.EntityModelSet; import net.minecraft.resources.ResourceLocation; import whocraft.tardis_refined.client.ModelRegistry; +import whocraft.tardis_refined.client.model.blockentity.door.interior.*; +import whocraft.tardis_refined.client.model.blockentity.shell.shells.*; import whocraft.tardis_refined.common.tardis.themes.ShellTheme; import java.util.HashMap; @@ -13,10 +15,12 @@ public class ShellModelCollection { private static ShellModel factoryShellModel, policeBoxModel, phoneBoothModel, mysticModel, drifterModel, presentModel, vendingModel, briefcaseModel, groeningModel, bigBenModel, nukaModel, growthModel, - portalooModel, pagodaModel; + portalooModel, pagodaModel, liftModel, hieroglyphModel, castleShellModel; - public static Map SHELL_MODELS = new HashMap<>(); + private static ShellDoorModel factoryDoorModel, policeBoxDoorModel, phoneBoothDoorModel, mysticDoorModel, drifterDoorModel, presentDoorModel, vendingDoorModel, briefcaseDoorModel, + groeningDoorModel, bigBenDoorModel, nukaDoorModel, growthDoorModel, portalooDoorModel, pagodaDoorModel, liftDoorModel, hieroglyphDoorModel, castleDoorModel; + public static Map SHELL_MODELS = new HashMap<>(); public ShellModelCollection() { var context = Minecraft.getInstance().getEntityModels(); @@ -24,6 +28,8 @@ public ShellModelCollection() { } public void registerModels(EntityModelSet context){ + + // Shells factoryShellModel = new FactoryShellModel(context.bakeLayer((ModelRegistry.FACTORY_SHELL))); policeBoxModel = new PoliceBoxModel(context.bakeLayer((ModelRegistry.POLICE_BOX_SHELL))); phoneBoothModel = new PhoneBoothModel(context.bakeLayer((ModelRegistry.PHONE_BOOTH_SHELL))); @@ -38,21 +44,50 @@ public void registerModels(EntityModelSet context){ growthModel = new GrowthShellModel(context.bakeLayer((ModelRegistry.GROWTH_SHELL))); portalooModel = new PortalooShellModel(context.bakeLayer((ModelRegistry.PORTALOO_SHELL))); pagodaModel = new PagodaShellModel(context.bakeLayer((ModelRegistry.PAGODA_SHELL))); + liftModel = new LiftShellModel(context.bakeLayer((ModelRegistry.LIFT_SHELL))); + hieroglyphModel = new HieroglyphModel(context.bakeLayer((ModelRegistry.HIEROGLYPH_SHELL))); + castleShellModel = new CastleShellModel(context.bakeLayer((ModelRegistry.CASTLE_SHELL))); + + // Doors + factoryDoorModel = new FactoryDoorModel(context.bakeLayer((ModelRegistry.FACTORY_DOOR))); + policeBoxDoorModel = new PoliceBoxDoorModel(context.bakeLayer((ModelRegistry.POLICE_BOX_DOOR))); + phoneBoothDoorModel = new PhoneBoothDoorModel(context.bakeLayer((ModelRegistry.PHONE_BOOTH_DOOR))); + mysticDoorModel = new MysticDoorModel(context.bakeLayer((ModelRegistry.MYSTIC_DOOR))); + drifterDoorModel = new DrifterDoorModel(context.bakeLayer((ModelRegistry.DRIFTER_DOOR))); + presentDoorModel = new PresentDoorModel(context.bakeLayer((ModelRegistry.PRESENT_DOOR))); + vendingDoorModel = new VendingMachineDoorModel(context.bakeLayer((ModelRegistry.VENDING_DOOR))); + briefcaseDoorModel = new BriefcaseDoorModel(context.bakeLayer((ModelRegistry.BRIEFCASE_DOOR))); + groeningDoorModel = new GroeningDoorModel(context.bakeLayer((ModelRegistry.GROENING_DOOR))); + bigBenDoorModel = new BigBenDoorModel(context.bakeLayer((ModelRegistry.BIG_BEN_DOOR))); + nukaDoorModel = new NukaDoorModel(context.bakeLayer((ModelRegistry.NUKA_DOOR))); + growthDoorModel = new GrowthDoorModel(context.bakeLayer((ModelRegistry.GROWTH_DOOR))); + portalooDoorModel = new PortalooDoorModel(context.bakeLayer((ModelRegistry.PORTALOO_DOOR))); + pagodaDoorModel = new PagodaDoorModel(context.bakeLayer((ModelRegistry.PAGODA_DOOR))); + liftDoorModel = new LiftShellDoorModel(context.bakeLayer((ModelRegistry.LIFT_DOOR))); + hieroglyphDoorModel = new HieroglyphShellDoor(context.bakeLayer((ModelRegistry.HIEROGLYPH_DOOR))); + castleDoorModel = new CastleShellDoorModel(context.bakeLayer((ModelRegistry.CASTLE_DOOR))); + + registerShellEntry(ShellTheme.FACTORY.get(), factoryShellModel, factoryDoorModel); + registerShellEntry(ShellTheme.POLICE_BOX.get(), policeBoxModel, policeBoxDoorModel); + registerShellEntry(ShellTheme.PHONE_BOOTH.get(), phoneBoothModel, phoneBoothDoorModel); + registerShellEntry(ShellTheme.MYSTIC.get(), mysticModel, mysticDoorModel); + registerShellEntry(ShellTheme.DRIFTER.get(), drifterModel, drifterDoorModel); + registerShellEntry(ShellTheme.PRESENT.get(), presentModel, presentDoorModel); + registerShellEntry(ShellTheme.VENDING.get(), vendingModel, vendingDoorModel); + registerShellEntry(ShellTheme.BRIEFCASE.get(), briefcaseModel, briefcaseDoorModel); + registerShellEntry(ShellTheme.GROENING.get(), groeningModel, groeningDoorModel); + registerShellEntry(ShellTheme.BIG_BEN.get(), bigBenModel, bigBenDoorModel); + registerShellEntry(ShellTheme.NUKA.get(), nukaModel, nukaDoorModel); + registerShellEntry(ShellTheme.GROWTH.get(), growthModel, growthDoorModel); + registerShellEntry(ShellTheme.PORTALOO.get(), portalooModel, portalooDoorModel); + registerShellEntry(ShellTheme.PAGODA.get(), pagodaModel, pagodaDoorModel); + registerShellEntry(ShellTheme.LIFT.get(), liftModel, liftDoorModel); + registerShellEntry(ShellTheme.HIEROGLYPH.get(), hieroglyphModel, hieroglyphDoorModel); + registerShellEntry(ShellTheme.CASTLE.get(), castleShellModel, castleDoorModel); + } - SHELL_MODELS.put(ShellTheme.FACTORY.getId(), factoryShellModel); - SHELL_MODELS.put(ShellTheme.POLICE_BOX.getId(), policeBoxModel); - SHELL_MODELS.put(ShellTheme.PHONE_BOOTH.getId(), phoneBoothModel); - SHELL_MODELS.put(ShellTheme.MYSTIC.getId(), mysticModel); - SHELL_MODELS.put(ShellTheme.DRIFTER.getId(), drifterModel); - SHELL_MODELS.put(ShellTheme.PRESENT.getId(), presentModel); - SHELL_MODELS.put(ShellTheme.VENDING.getId(), vendingModel); - SHELL_MODELS.put(ShellTheme.BRIEFCASE.getId(), briefcaseModel); - SHELL_MODELS.put(ShellTheme.GROENING.getId(), groeningModel); - SHELL_MODELS.put(ShellTheme.BIG_BEN.getId(), bigBenModel); - SHELL_MODELS.put(ShellTheme.NUKA.getId(), nukaModel); - SHELL_MODELS.put(ShellTheme.GROWTH.getId(), growthModel); - SHELL_MODELS.put(ShellTheme.PORTALOO.getId(), portalooModel); - SHELL_MODELS.put(ShellTheme.PAGODA.getId(), pagodaModel); + public static void registerShellEntry(ShellTheme theme, ShellModel shellModel, ShellDoorModel shellDoorModel){ + SHELL_MODELS.put(ShellTheme.getKey(theme), new ShellEntry(shellModel, shellDoorModel)); } /** @@ -60,7 +95,7 @@ public void registerModels(EntityModelSet context){ * @param themeId The Shell theme Id. * @return Shell model tied with the shell theme. * **/ - public ShellModel getShellModel(ResourceLocation themeId) { + public ShellEntry getShellEntry(ResourceLocation themeId) { return SHELL_MODELS.get(themeId); } diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/BigBenShellModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/BigBenShellModel.java similarity index 98% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/BigBenShellModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/BigBenShellModel.java index 255748999..26e5baea3 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/BigBenShellModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/BigBenShellModel.java @@ -1,4 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.shell; +package whocraft.tardis_refined.client.model.blockentity.shell.shells; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; @@ -6,6 +6,7 @@ import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; import net.minecraft.world.entity.Entity; +import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; import java.util.Calendar; @@ -33,16 +34,11 @@ public class BigBenShellModel extends ShellModel { private final ModelPart bb_main; @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { this.door.yRot = (open) ? -275f : 0; } - @Override - public boolean isDoorModel() { - return false; - } - @Override public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { handleAllAnimations(entity, root(), isBaseModel, open, poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); @@ -213,7 +209,7 @@ public static LayerDefinition createBodyLayer() { .texOffs(0, 103).addBox(-8.5F, -34.0F, 5.5F, 3.0F, 34.0F, 3.0F, new CubeDeformation(0.0F)) .texOffs(0, 103).mirror().addBox(5.5F, -34.0F, 5.5F, 3.0F, 34.0F, 3.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(0.0F, 24.0F, 0.0F)); - splice(partdefinition); + addMaterializationPart(partdefinition); return LayerDefinition.create(meshdefinition, 256, 256); } diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/BriefcaseShellModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/BriefcaseShellModel.java similarity index 92% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/BriefcaseShellModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/BriefcaseShellModel.java index 8eaddec2d..c4af2185a 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/BriefcaseShellModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/BriefcaseShellModel.java @@ -1,4 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.shell; +package whocraft.tardis_refined.client.model.blockentity.shell.shells; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; @@ -6,6 +6,7 @@ import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; import net.minecraft.world.entity.Entity; +import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; public class BriefcaseShellModel extends ShellModel { @@ -33,7 +34,7 @@ public static LayerDefinition createBodyLayer() { PartDefinition bb_main = partdefinition.addOrReplaceChild("bb_main", CubeListBuilder.create().texOffs(0, 21).addBox(-10.0F, -6.0F, -7.0F, 20.0F, 6.0F, 14.0F, new CubeDeformation(0.0F)).texOffs(0, 0).addBox(-10.0F, -6.25F, -7.0F, 20.0F, 6.0F, 14.0F, new CubeDeformation(0.25F)).texOffs(55, 21).addBox(-5.0F, -4.25F, -10.0F, 10.0F, 2.0F, 3.0F, new CubeDeformation(0.0F)).texOffs(0, 0).addBox(-8.0F, -7.5F, -8.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)).texOffs(0, 0).mirror().addBox(5.0F, -7.5F, -8.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(0.0F, 24.0F, 0.0F)); - ShellModel.splice(partdefinition); + ShellModel.addMaterializationPart(partdefinition); return LayerDefinition.create(meshdefinition, 128, 128); } @@ -45,7 +46,7 @@ public ModelPart root() { } @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { this.door.xRot = (open) ? -2f : 0f; } @@ -54,11 +55,6 @@ public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isB handleAllAnimations(entity, root(), isBaseModel, open, poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); } - @Override - public boolean isDoorModel() { - return false; - } - @Override public void setupAnim(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/CastleShellModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/CastleShellModel.java new file mode 100644 index 000000000..06e210537 --- /dev/null +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/CastleShellModel.java @@ -0,0 +1,283 @@ +package whocraft.tardis_refined.client.model.blockentity.shell.shells; + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import net.minecraft.client.model.geom.ModelPart; +import net.minecraft.client.model.geom.PartPose; +import net.minecraft.client.model.geom.builders.*; +import net.minecraft.world.entity.Entity; +import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; +import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; + +public class CastleShellModel extends ShellModel { + + private final ModelPart r_door; + private final ModelPart l_door; + private final ModelPart bone38; + private final ModelPart bone8; + private final ModelPart bone3; + private final ModelPart bone10; + private final ModelPart bone16; + private final ModelPart bone32; + private final ModelPart blackbox; + private final ModelPart bb_main; + private final ModelPart root; + + public CastleShellModel(ModelPart root) { + super(root); + this.r_door = root.getChild("r_door"); + this.l_door = root.getChild("l_door"); + this.bone38 = root.getChild("bone38"); + this.bone8 = root.getChild("bone8"); + this.bone3 = root.getChild("bone3"); + this.bone10 = root.getChild("bone10"); + this.bone16 = root.getChild("bone16"); + this.bone32 = root.getChild("bone32"); + this.blackbox = root.getChild("blackbox"); + this.bb_main = root.getChild("bb_main"); + this.root = root; + } + + + + public static LayerDefinition createBodyLayer() { + MeshDefinition meshdefinition = new MeshDefinition(); + PartDefinition partdefinition = meshdefinition.getRoot(); + + PartDefinition r_door = partdefinition.addOrReplaceChild("r_door", CubeListBuilder.create().texOffs(48, 46).mirror().addBox(-0.25F, -16.0F, -0.5F, 8.0F, 32.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-7.5F, 8.0F, -13.5F, 0.0F, -1.5708F, 0.0F)); + + PartDefinition l_door = partdefinition.addOrReplaceChild("l_door", CubeListBuilder.create().texOffs(48, 46).addBox(-7.75F, -16.0F, -0.5F, 8.0F, 32.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(7.5F, 8.0F, -13.5F, 0.0F, 1.5708F, 0.0F)); + + PartDefinition bone38 = partdefinition.addOrReplaceChild("bone38", CubeListBuilder.create(), PartPose.offset(9.0F, -12.0F, -13.0F)); + + PartDefinition cube_r1 = bone38.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(64, 32).mirror().addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.2618F, -1.1781F, 0.0F)); + + PartDefinition cube_r2 = bone38.addOrReplaceChild("cube_r2", CubeListBuilder.create().texOffs(64, 32).addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-18.25F, 20.0F, 0.0F, -0.3491F, 1.0036F, 0.0F)); + + PartDefinition cube_r3 = bone38.addOrReplaceChild("cube_r3", CubeListBuilder.create().texOffs(64, 32).addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-19.0F, 12.0F, -0.75F, 0.1309F, 2.0071F, 0.0F)); + + PartDefinition cube_r4 = bone38.addOrReplaceChild("cube_r4", CubeListBuilder.create().texOffs(64, 32).addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-18.0F, 0.0F, 0.0F, -0.2618F, 1.1781F, 0.0F)); + + PartDefinition cube_r5 = bone38.addOrReplaceChild("cube_r5", CubeListBuilder.create().texOffs(64, 32).addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-15.0F, 0.25F, 0.0F, -0.6109F, 0.3491F, 0.0F)); + + PartDefinition cube_r6 = bone38.addOrReplaceChild("cube_r6", CubeListBuilder.create().texOffs(64, 32).addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-13.0F, 1.0F, 0.0F, -0.5236F, -0.2618F, 0.0F)); + + PartDefinition cube_r7 = bone38.addOrReplaceChild("cube_r7", CubeListBuilder.create().texOffs(64, 32).addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-9.0F, 0.0F, 0.0F, -0.5236F, -0.0436F, 0.0F)); + + PartDefinition cube_r8 = bone38.addOrReplaceChild("cube_r8", CubeListBuilder.create().texOffs(80, 73).addBox(-1.5F, -3.0F, -0.5F, 3.0F, 4.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-4.75F, 1.0F, -0.5F, 0.0F, 0.0F, 0.2182F)); + + PartDefinition cube_r9 = bone38.addOrReplaceChild("cube_r9", CubeListBuilder.create().texOffs(80, 67).addBox(-1.5F, -3.0F, -0.5F, 3.0F, 4.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-12.75F, 1.0F, -0.5F, 0.0F, 0.0F, -0.3054F)); + + PartDefinition cube_r10 = bone38.addOrReplaceChild("cube_r10", CubeListBuilder.create().texOffs(64, 32).addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-4.0F, 1.25F, 0.0F, -1.0472F, -0.48F, 0.0F)); + + PartDefinition cube_r11 = bone38.addOrReplaceChild("cube_r11", CubeListBuilder.create().texOffs(64, 32).addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-5.0F, 1.0F, 0.0F, -0.5672F, 0.0F, 0.0F)); + + PartDefinition bone39 = bone38.addOrReplaceChild("bone39", CubeListBuilder.create(), PartPose.offset(-21.0F, 34.5F, 5.75F)); + + PartDefinition cube_r12 = bone39.addOrReplaceChild("cube_r12", CubeListBuilder.create().texOffs(64, 32).addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(2.5F, 1.25F, -0.5F, -0.6981F, 1.4835F, 0.0F)); + + PartDefinition cube_r13 = bone39.addOrReplaceChild("cube_r13", CubeListBuilder.create().texOffs(80, 73).addBox(-1.5F, -3.0F, 0.0F, 3.0F, 4.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.6279F, 1.0782F, -0.6892F)); + + PartDefinition cube_r14 = bone39.addOrReplaceChild("cube_r14", CubeListBuilder.create().texOffs(64, 32).addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.5F, -0.75F, 2.5F, -0.0873F, 1.4835F, 0.0F)); + + PartDefinition cube_r15 = bone39.addOrReplaceChild("cube_r15", CubeListBuilder.create().texOffs(64, 32).addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.25F, 2.25F, 0.0F, -1.2217F, 1.4399F, 0.0F)); + + PartDefinition cube_r16 = bone39.addOrReplaceChild("cube_r16", CubeListBuilder.create().texOffs(64, 32).addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(2.5F, -0.5F, -1.75F, -0.3491F, 1.0036F, 0.0F)); + + PartDefinition cube_r17 = bone39.addOrReplaceChild("cube_r17", CubeListBuilder.create().texOffs(64, 32).addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(2.5F, -4.5F, -1.75F, 0.1309F, 1.3526F, 0.0F)); + + PartDefinition bone40 = bone38.addOrReplaceChild("bone40", CubeListBuilder.create(), PartPose.offset(3.0F, 34.5F, 5.75F)); + + PartDefinition cube_r18 = bone40.addOrReplaceChild("cube_r18", CubeListBuilder.create().texOffs(64, 32).mirror().addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-2.5F, 1.25F, -0.5F, -0.6981F, -1.4835F, 0.0F)); + + PartDefinition cube_r19 = bone40.addOrReplaceChild("cube_r19", CubeListBuilder.create().texOffs(80, 67).mirror().addBox(-1.5F, -3.0F, 0.0F, 3.0F, 4.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.6279F, -1.0782F, 0.6892F)); + + PartDefinition cube_r20 = bone40.addOrReplaceChild("cube_r20", CubeListBuilder.create().texOffs(64, 32).mirror().addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-0.5F, -0.75F, 2.5F, -0.0873F, -1.4835F, 0.0F)); + + PartDefinition cube_r21 = bone40.addOrReplaceChild("cube_r21", CubeListBuilder.create().texOffs(64, 32).mirror().addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-0.25F, 2.25F, 0.0F, -1.2217F, -1.4399F, 0.0F)); + + PartDefinition cube_r22 = bone40.addOrReplaceChild("cube_r22", CubeListBuilder.create().texOffs(64, 32).mirror().addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-2.5F, -9.25F, -6.5F, -0.9599F, -0.8727F, 0.0F)); + + PartDefinition cube_r23 = bone40.addOrReplaceChild("cube_r23", CubeListBuilder.create().texOffs(64, 32).mirror().addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-2.5F, -14.0F, -6.5F, 0.2618F, -1.2217F, 0.0F)); + + PartDefinition cube_r24 = bone40.addOrReplaceChild("cube_r24", CubeListBuilder.create().texOffs(64, 32).mirror().addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-2.5F, -5.0F, -6.5F, -0.5672F, -0.3927F, 0.0F)); + + PartDefinition cube_r25 = bone40.addOrReplaceChild("cube_r25", CubeListBuilder.create().texOffs(64, 32).mirror().addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-1.75F, -2.5F, -7.0F, 0.1309F, -0.9599F, 0.0F)); + + PartDefinition cube_r26 = bone40.addOrReplaceChild("cube_r26", CubeListBuilder.create().texOffs(64, 32).mirror().addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-2.5F, -0.5F, -1.75F, -0.3491F, -1.0036F, 0.0F)); + + PartDefinition cube_r27 = bone40.addOrReplaceChild("cube_r27", CubeListBuilder.create().texOffs(64, 32).mirror().addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-2.5F, -4.5F, -1.75F, 0.1309F, -1.3526F, 0.0F)); + + PartDefinition bone8 = partdefinition.addOrReplaceChild("bone8", CubeListBuilder.create().texOffs(35, 46).addBox(-10.5F, -36.0F, 7.0F, 3.0F, 36.0F, 3.0F, new CubeDeformation(0.0F)) + .texOffs(35, 46).mirror().addBox(7.5F, -36.0F, 7.0F, 3.0F, 36.0F, 3.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(48, 80).addBox(-2.5F, -36.0F, 5.0F, 5.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(33, 7).addBox(2.5F, -35.0F, 5.0F, 4.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(33, 0).addBox(6.5F, -36.0F, 5.0F, 4.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(33, 0).mirror().addBox(-10.5F, -36.0F, 5.0F, 4.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(33, 7).mirror().addBox(-6.5F, -35.0F, 5.0F, 4.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(0.0F, 24.0F, -20.0F)); + + PartDefinition bone = bone8.addOrReplaceChild("bone", CubeListBuilder.create().texOffs(33, 0).addBox(7.5F, -4.0F, 5.0F, 4.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(64, 25).addBox(7.5F, -8.0F, 5.0F, 3.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(33, 0).addBox(7.5F, -12.0F, 5.0F, 4.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(64, 25).addBox(7.5F, -16.0F, 5.0F, 3.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(80, 60).addBox(7.5F, -20.0F, 5.0F, 2.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(64, 25).addBox(7.5F, -24.0F, 5.0F, 3.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(80, 60).addBox(7.5F, -28.0F, 5.0F, 2.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(64, 25).addBox(7.5F, -32.0F, 5.0F, 3.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 0.0F)); + + PartDefinition bone2 = bone8.addOrReplaceChild("bone2", CubeListBuilder.create().texOffs(33, 0).mirror().addBox(-11.5F, -4.0F, 5.0F, 4.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(64, 25).mirror().addBox(-10.5F, -8.0F, 5.0F, 3.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(33, 0).mirror().addBox(-11.5F, -12.0F, 5.0F, 4.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(64, 25).mirror().addBox(-10.5F, -16.0F, 5.0F, 3.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(80, 60).mirror().addBox(-9.5F, -20.0F, 5.0F, 2.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(64, 25).mirror().addBox(-10.5F, -24.0F, 5.0F, 3.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(80, 60).mirror().addBox(-9.5F, -28.0F, 5.0F, 2.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(64, 25).mirror().addBox(-10.5F, -32.0F, 5.0F, 3.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(0.0F, 0.0F, 0.0F)); + + PartDefinition bone3 = partdefinition.addOrReplaceChild("bone3", CubeListBuilder.create().texOffs(77, 0).addBox(-7.5F, -42.0F, -13.0F, 15.0F, 10.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F)); + + PartDefinition bone4 = bone3.addOrReplaceChild("bone4", CubeListBuilder.create().texOffs(0, 0).addBox(-7.5F, -42.0F, -13.0F, 15.0F, 42.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.0472F, 0.0F)); + + PartDefinition bone5 = bone4.addOrReplaceChild("bone5", CubeListBuilder.create().texOffs(0, 0).addBox(-7.5F, -42.0F, -13.0F, 15.0F, 42.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(80, 41).addBox(-5.5F, -32.0F, -14.0F, 11.0F, 11.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(80, 54).addBox(-6.5F, -21.0F, -15.0F, 13.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.0472F, 0.0F)); + + PartDefinition bone28 = bone5.addOrReplaceChild("bone28", CubeListBuilder.create().texOffs(80, 73).addBox(0.5F, -25.0F, -6.5F, 3.0F, 4.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(80, 67).addBox(-5.25F, -25.0F, -6.75F, 3.0F, 4.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(80, 67).addBox(-1.25F, -23.0F, -6.75F, 3.0F, 4.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, -8.0F)); + + PartDefinition cube_r28 = bone28.addOrReplaceChild("cube_r28", CubeListBuilder.create().texOffs(64, 32).addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(4.0F, -21.0F, -6.0F, -0.6981F, -0.5236F, 0.0F)); + + PartDefinition cube_r29 = bone28.addOrReplaceChild("cube_r29", CubeListBuilder.create().texOffs(64, 32).addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-3.0F, -21.0F, -6.0F, -0.6981F, -0.5236F, 0.0F)); + + PartDefinition cube_r30 = bone28.addOrReplaceChild("cube_r30", CubeListBuilder.create().texOffs(64, 32).addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-4.0F, -21.0F, -6.0F, -0.6981F, 0.5672F, 0.0F)); + + PartDefinition cube_r31 = bone28.addOrReplaceChild("cube_r31", CubeListBuilder.create().texOffs(80, 73).addBox(-1.5F, -3.0F, -0.5F, 3.0F, 4.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-2.0F, -21.5F, -6.0F, 0.0F, 0.0F, -0.2618F)); + + PartDefinition cube_r32 = bone28.addOrReplaceChild("cube_r32", CubeListBuilder.create().texOffs(64, 32).addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(2.0F, -21.0F, -6.0F, -0.6981F, 0.0F, 0.0F)); + + PartDefinition bone6 = bone5.addOrReplaceChild("bone6", CubeListBuilder.create().texOffs(0, 0).addBox(-7.5F, -42.0F, -13.0F, 15.0F, 42.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.0472F, 0.0F)); + + PartDefinition bone7 = bone6.addOrReplaceChild("bone7", CubeListBuilder.create().texOffs(0, 0).addBox(-7.5F, -42.0F, -13.0F, 15.0F, 42.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(80, 41).addBox(-5.5F, -32.0F, -14.0F, 11.0F, 11.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(80, 54).addBox(-6.5F, -21.0F, -15.0F, 13.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.0472F, 0.0F)); + + PartDefinition bone29 = bone7.addOrReplaceChild("bone29", CubeListBuilder.create().texOffs(80, 73).addBox(0.5F, -25.0F, -6.5F, 3.0F, 4.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(80, 67).addBox(-5.25F, -25.0F, -6.75F, 3.0F, 4.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(80, 67).addBox(-1.25F, -23.0F, -6.75F, 3.0F, 4.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, -8.0F)); + + PartDefinition cube_r33 = bone29.addOrReplaceChild("cube_r33", CubeListBuilder.create().texOffs(64, 32).addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(4.0F, -21.0F, -6.0F, -0.6981F, -0.5236F, 0.0F)); + + PartDefinition cube_r34 = bone29.addOrReplaceChild("cube_r34", CubeListBuilder.create().texOffs(64, 32).addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-3.0F, -21.0F, -6.0F, -0.6981F, -0.5236F, 0.0F)); + + PartDefinition cube_r35 = bone29.addOrReplaceChild("cube_r35", CubeListBuilder.create().texOffs(64, 32).addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-4.0F, -21.0F, -6.0F, -0.6981F, 0.5672F, 0.0F)); + + PartDefinition cube_r36 = bone29.addOrReplaceChild("cube_r36", CubeListBuilder.create().texOffs(80, 73).addBox(-1.5F, -3.0F, -0.5F, 3.0F, 4.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-2.0F, -21.5F, -6.0F, 0.0F, 0.0F, -0.2618F)); + + PartDefinition cube_r37 = bone29.addOrReplaceChild("cube_r37", CubeListBuilder.create().texOffs(64, 32).addBox(-1.5F, 0.0F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(2.0F, -21.0F, -6.0F, -0.6981F, 0.0F, 0.0F)); + + PartDefinition bone9 = bone7.addOrReplaceChild("bone9", CubeListBuilder.create().texOffs(0, 0).mirror().addBox(-7.5F, -42.0F, -13.0F, 15.0F, 42.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.0472F, 0.0F)); + + PartDefinition bone10 = partdefinition.addOrReplaceChild("bone10", CubeListBuilder.create().texOffs(74, 15).addBox(-8.5F, -42.0F, -14.725F, 17.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F)); + + PartDefinition bone11 = bone10.addOrReplaceChild("bone11", CubeListBuilder.create().texOffs(74, 15).addBox(-8.5F, -42.0F, -14.725F, 17.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.0472F, 0.0F)); + + PartDefinition bone12 = bone11.addOrReplaceChild("bone12", CubeListBuilder.create().texOffs(74, 15).addBox(-8.5F, -42.0F, -14.725F, 17.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.0472F, 0.0F)); + + PartDefinition bone13 = bone12.addOrReplaceChild("bone13", CubeListBuilder.create().texOffs(74, 15).addBox(-8.5F, -42.0F, -14.725F, 17.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.0472F, 0.0F)); + + PartDefinition bone14 = bone13.addOrReplaceChild("bone14", CubeListBuilder.create().texOffs(74, 15).addBox(-8.5F, -42.0F, -14.725F, 17.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.0472F, 0.0F)); + + PartDefinition bone15 = bone14.addOrReplaceChild("bone15", CubeListBuilder.create().texOffs(74, 15).addBox(-8.5F, -42.0F, -14.725F, 17.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.0472F, 0.0F)); + + PartDefinition bone16 = partdefinition.addOrReplaceChild("bone16", CubeListBuilder.create(), PartPose.offset(0.0F, 24.0F, 0.0F)); + + PartDefinition bone22 = bone16.addOrReplaceChild("bone22", CubeListBuilder.create().texOffs(33, 0).addBox(-7.5F, 0.0F, 0.0F, 15.0F, 1.0F, 13.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -42.0F, -13.0F, 0.6109F, 0.0F, 0.0F)); + + PartDefinition cube_r38 = bone22.addOrReplaceChild("cube_r38", CubeListBuilder.create().texOffs(64, 25).mirror().addBox(0.0F, 0.025F, 0.0F, 2.0F, 1.0F, 14.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-7.5F, 0.0F, 0.0F, 0.0F, 0.4407F, 0.0F)); + + PartDefinition cube_r39 = bone22.addOrReplaceChild("cube_r39", CubeListBuilder.create().texOffs(64, 25).addBox(-2.0F, 0.025F, 0.0F, 2.0F, 1.0F, 14.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(7.5F, 0.0F, 0.0F, 0.0F, -0.4407F, 0.0F)); + + PartDefinition bone17 = bone16.addOrReplaceChild("bone17", CubeListBuilder.create(), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.0472F, 0.0F)); + + PartDefinition bone23 = bone17.addOrReplaceChild("bone23", CubeListBuilder.create().texOffs(33, 0).addBox(-7.5F, 0.0F, 0.0F, 15.0F, 1.0F, 13.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -42.0F, -13.0F, 0.6109F, 0.0F, 0.0F)); + + PartDefinition cube_r40 = bone23.addOrReplaceChild("cube_r40", CubeListBuilder.create().texOffs(64, 25).addBox(-2.0F, 0.025F, 0.0F, 2.0F, 1.0F, 14.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(7.5F, 0.0F, 0.0F, 0.0F, -0.4407F, 0.0F)); + + PartDefinition cube_r41 = bone23.addOrReplaceChild("cube_r41", CubeListBuilder.create().texOffs(64, 25).mirror().addBox(0.0F, 0.025F, 0.0F, 2.0F, 1.0F, 14.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-7.5F, 0.0F, 0.0F, 0.0F, 0.4407F, 0.0F)); + + PartDefinition bone18 = bone17.addOrReplaceChild("bone18", CubeListBuilder.create(), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.0472F, 0.0F)); + + PartDefinition bone19 = bone18.addOrReplaceChild("bone19", CubeListBuilder.create().texOffs(33, 0).addBox(-7.5F, 0.0F, 0.0F, 15.0F, 1.0F, 13.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -42.0F, -13.0F, 0.6109F, 0.0F, 0.0F)); + + PartDefinition cube_r42 = bone19.addOrReplaceChild("cube_r42", CubeListBuilder.create().texOffs(64, 25).addBox(-2.0F, 0.025F, 0.0F, 2.0F, 1.0F, 14.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(7.5F, 0.0F, 0.0F, 0.0F, -0.4407F, 0.0F)); + + PartDefinition cube_r43 = bone19.addOrReplaceChild("cube_r43", CubeListBuilder.create().texOffs(64, 25).mirror().addBox(0.0F, 0.025F, 0.0F, 2.0F, 1.0F, 14.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-7.5F, 0.0F, 0.0F, 0.0F, 0.4407F, 0.0F)); + + PartDefinition bone20 = bone18.addOrReplaceChild("bone20", CubeListBuilder.create(), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.0472F, 0.0F)); + + PartDefinition bone21 = bone20.addOrReplaceChild("bone21", CubeListBuilder.create().texOffs(33, 0).addBox(-7.5F, 0.0F, 0.0F, 15.0F, 1.0F, 13.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -42.0F, -13.0F, 0.6109F, 0.0F, 0.0F)); + + PartDefinition cube_r44 = bone21.addOrReplaceChild("cube_r44", CubeListBuilder.create().texOffs(64, 25).addBox(-2.0F, 0.025F, 0.0F, 2.0F, 1.0F, 14.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(7.5F, 0.0F, 0.0F, 0.0F, -0.4407F, 0.0F)); + + PartDefinition cube_r45 = bone21.addOrReplaceChild("cube_r45", CubeListBuilder.create().texOffs(64, 25).mirror().addBox(0.0F, 0.025F, 0.0F, 2.0F, 1.0F, 14.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-7.5F, 0.0F, 0.0F, 0.0F, 0.4407F, 0.0F)); + + PartDefinition bone24 = bone20.addOrReplaceChild("bone24", CubeListBuilder.create(), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.0472F, 0.0F)); + + PartDefinition bone25 = bone24.addOrReplaceChild("bone25", CubeListBuilder.create().texOffs(33, 0).addBox(-7.5F, 0.0F, 0.0F, 15.0F, 1.0F, 13.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -42.0F, -13.0F, 0.6109F, 0.0F, 0.0F)); + + PartDefinition cube_r46 = bone25.addOrReplaceChild("cube_r46", CubeListBuilder.create().texOffs(64, 25).addBox(-2.0F, 0.025F, 0.0F, 2.0F, 1.0F, 14.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(7.5F, 0.0F, 0.0F, 0.0F, -0.4407F, 0.0F)); + + PartDefinition cube_r47 = bone25.addOrReplaceChild("cube_r47", CubeListBuilder.create().texOffs(64, 25).mirror().addBox(0.0F, 0.025F, 0.0F, 2.0F, 1.0F, 14.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-7.5F, 0.0F, 0.0F, 0.0F, 0.4407F, 0.0F)); + + PartDefinition bone26 = bone24.addOrReplaceChild("bone26", CubeListBuilder.create(), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.0472F, 0.0F)); + + PartDefinition bone27 = bone26.addOrReplaceChild("bone27", CubeListBuilder.create().texOffs(33, 0).addBox(-7.5F, 0.0F, 0.0F, 15.0F, 1.0F, 13.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -42.0F, -13.0F, 0.6109F, 0.0F, 0.0F)); + + PartDefinition cube_r48 = bone27.addOrReplaceChild("cube_r48", CubeListBuilder.create().texOffs(64, 25).addBox(-2.0F, 0.025F, 0.0F, 2.0F, 1.0F, 14.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(7.5F, 0.0F, 0.0F, 0.0F, -0.4407F, 0.0F)); + + PartDefinition cube_r49 = bone27.addOrReplaceChild("cube_r49", CubeListBuilder.create().texOffs(64, 25).mirror().addBox(0.0F, 0.025F, 0.0F, 2.0F, 1.0F, 14.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-7.5F, 0.0F, 0.0F, 0.0F, 0.4407F, 0.0F)); + + PartDefinition bone32 = partdefinition.addOrReplaceChild("bone32", CubeListBuilder.create().texOffs(19, 30).addBox(-7.5F, -1.2F, -13.0F, 15.0F, 1.0F, 14.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 25.0F, 0.0F)); + + PartDefinition bone33 = bone32.addOrReplaceChild("bone33", CubeListBuilder.create().texOffs(19, 30).addBox(-7.5F, -1.2F, -13.0F, 15.0F, 1.0F, 14.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.0472F, 0.0F)); + + PartDefinition bone34 = bone33.addOrReplaceChild("bone34", CubeListBuilder.create().texOffs(19, 30).addBox(-7.5F, -1.2F, -13.0F, 15.0F, 1.0F, 14.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.0472F, 0.0F)); + + PartDefinition bone35 = bone34.addOrReplaceChild("bone35", CubeListBuilder.create().texOffs(19, 30).addBox(-7.5F, -1.2F, -13.0F, 15.0F, 1.0F, 14.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.0472F, 0.0F)); + + PartDefinition bone36 = bone35.addOrReplaceChild("bone36", CubeListBuilder.create().texOffs(19, 30).addBox(-7.5F, -1.2F, -13.0F, 15.0F, 1.0F, 14.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.0472F, 0.0F)); + + PartDefinition bone37 = bone36.addOrReplaceChild("bone37", CubeListBuilder.create().texOffs(19, 30).addBox(-7.5F, -1.2F, -13.0F, 15.0F, 1.0F, 14.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.0472F, 0.0F)); + + PartDefinition blackbox = partdefinition.addOrReplaceChild("blackbox", CubeListBuilder.create().texOffs(67, 46).mirror().addBox(-9.0F, -33.0F, -6.0F, 1.0F, 33.0F, 5.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(67, 46).addBox(8.0F, -33.0F, -6.0F, 1.0F, 33.0F, 5.0F, new CubeDeformation(0.0F)) + .texOffs(33, 15).addBox(-8.0F, -34.0F, -9.0F, 16.0F, 1.0F, 8.0F, new CubeDeformation(0.0F)) + .texOffs(0, 46).addBox(-8.0F, -33.0F, -1.0F, 16.0F, 33.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, -4.25F)); + + PartDefinition bb_main = partdefinition.addOrReplaceChild("bb_main", CubeListBuilder.create().texOffs(74, 79).addBox(-3.0F, -53.0F, -3.0F, 6.0F, 5.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F)); + addMaterializationPart(partdefinition); + return LayerDefinition.create(meshdefinition, 128, 128); + } + + @Override + public void setDoorPosition(boolean open) { + r_door.yRot = open ? (float) Math.toRadians(90) : (float) Math.toRadians(0); + l_door.yRot = open ? (float) Math.toRadians(-90) : (float) Math.toRadians(0); + } + + @Override + public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + handleAllAnimations(entity, root(), isBaseModel, open, 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) { + + } +} diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/DrifterShellModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/DrifterShellModel.java similarity index 98% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/DrifterShellModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/DrifterShellModel.java index 9233bd5e6..18db96594 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/DrifterShellModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/DrifterShellModel.java @@ -1,4 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.shell; +package whocraft.tardis_refined.client.model.blockentity.shell.shells; import com.mojang.blaze3d.vertex.PoseStack; @@ -7,6 +7,7 @@ import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; import net.minecraft.world.entity.Entity; +import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; public class DrifterShellModel extends ShellModel { @@ -159,7 +160,7 @@ public static LayerDefinition createBodyLayer() { PartDefinition bone24 = bone23.addOrReplaceChild("bone24", CubeListBuilder.create().texOffs(79, 11).addBox(-1.0F, 0.0F, 0.0F, 1.0F, 9.0F, 12.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -0.5F, -13.0F, 1.1781F, 0.0F, 0.0F)); - ShellModel.splice(partdefinition); + ShellModel.addMaterializationPart(partdefinition); return LayerDefinition.create(meshdefinition, 256, 256); } @@ -179,7 +180,7 @@ public ModelPart root() { } @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { } @@ -192,11 +193,6 @@ public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isB door_closed.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, this.getCurrentAlpha()); } - @Override - public boolean isDoorModel() { - return false; - } - @Override public void setupAnim(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/FactoryShellModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/FactoryShellModel.java new file mode 100644 index 000000000..778847697 --- /dev/null +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/FactoryShellModel.java @@ -0,0 +1,82 @@ +package whocraft.tardis_refined.client.model.blockentity.shell.shells; + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import net.minecraft.client.model.geom.ModelPart; +import net.minecraft.client.model.geom.PartPose; +import net.minecraft.client.model.geom.builders.*; +import net.minecraft.world.entity.Entity; +import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; +import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; + +public class FactoryShellModel extends ShellModel { + + private final ModelPart realRoot; + private final ModelPart root; + private final ModelPart leftDoor; + private final ModelPart rightDoor; + + public FactoryShellModel(ModelPart root) { + super(root); + this.realRoot = root; + this.root = root.getChild("model_outline"); + this.leftDoor = this.root.getChild("left_door"); + this.rightDoor = this.root.getChild("right_door"); + } + + + public static LayerDefinition createBodyLayer() { + MeshDefinition meshdefinition = new MeshDefinition(); + PartDefinition partdefinition = meshdefinition.getRoot(); + + PartDefinition model_outline = partdefinition.addOrReplaceChild("model_outline", CubeListBuilder.create().texOffs(0, 28).addBox(-10.0F, -3.0F, -8.0F, 20.0F, 3.0F, 20.0F, new CubeDeformation(0.0F)) + .texOffs(0, 0).addBox(-10.0F, -44.0F, -8.0F, 20.0F, 7.0F, 20.0F, new CubeDeformation(0.0F)) + .texOffs(81, 46).addBox(-5.0F, -37.0F, -8.0F, 10.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(61, 41).addBox(-5.0F, -5.0F, -8.0F, 10.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(79, 84).addBox(-8.0F, -37.0F, -6.0F, 1.0F, 34.0F, 3.0F, new CubeDeformation(0.0F)) + .texOffs(0, 52).addBox(-9.0F, -37.0F, 7.0F, 18.0F, 34.0F, 4.0F, new CubeDeformation(0.0F)) + .texOffs(70, 84).addBox(7.0F, -37.0F, -6.0F, 1.0F, 34.0F, 3.0F, new CubeDeformation(0.0F)) + .texOffs(61, 32).addBox(-7.0F, -37.0F, -6.0F, 14.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(61, 37).addBox(-7.0F, -5.0F, -6.0F, 14.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(45, 52).mirror().addBox(8.0F, -37.0F, -3.0F, 2.0F, 34.0F, 10.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(45, 52).addBox(-10.0F, -37.0F, -3.0F, 2.0F, 34.0F, 10.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, -2.0F)); + + PartDefinition left_door = model_outline.addOrReplaceChild("left_door", CubeListBuilder.create().texOffs(81, 0).addBox(0.0F, -15.0F, -0.5F, 7.0F, 30.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(-7.0F, -20.0F, -5.6F)); + + PartDefinition right_door = model_outline.addOrReplaceChild("right_door", CubeListBuilder.create().texOffs(70, 52).addBox(-7.0F, -15.0F, -0.5F, 7.0F, 30.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(7.0F, -20.0F, -5.6F)); + addMaterializationPart(partdefinition); + return LayerDefinition.create(meshdefinition, 128, 128); + } + + + @Override + public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + root.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + } + + @Override + public ModelPart root() { + return this.realRoot; + } + + @Override + public void setupAnim(Entity entity, float f, float g, float h, float i, float j) { + } + + @Override + public void setDoorPosition(boolean open) { + if (open) { + this.leftDoor.yRot = 250f; + this.rightDoor.yRot = -250f; + } else { + this.leftDoor.yRot = 0; + this.rightDoor.yRot = 0; + } + } + + @Override + public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + + handleAllAnimations(entity, root(), isBaseModel, open, poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + } +} \ No newline at end of file diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/GroeningShellModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/GroeningShellModel.java similarity index 96% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/GroeningShellModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/GroeningShellModel.java index 6de57c2f0..c47f609e2 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/GroeningShellModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/GroeningShellModel.java @@ -1,4 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.shell; +package whocraft.tardis_refined.client.model.blockentity.shell.shells; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; @@ -6,6 +6,7 @@ import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; import net.minecraft.world.entity.Entity; +import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; public class GroeningShellModel extends ShellModel { @@ -55,7 +56,7 @@ public static LayerDefinition createBodyLayer() { PartDefinition cube_r7 = bone5.addOrReplaceChild("cube_r7", CubeListBuilder.create().texOffs(88, 9).addBox(-2.0F, 0.0F, 0.0F, 3.0F, 4.0F, 10.0F, new CubeDeformation(0.025F)), PartPose.offsetAndRotation(0.5F, -8.0F, -15.15F, 0.9599F, 0.0F, 0.0F)); - ShellModel.splice(partdefinition); + ShellModel.addMaterializationPart(partdefinition); return LayerDefinition.create(meshdefinition, 256, 256); } @@ -66,7 +67,7 @@ public ModelPart root() { } @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { this.door.yRot = (open) ? -275f : 0; } @@ -75,11 +76,6 @@ public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isB handleAllAnimations(entity, root(), isBaseModel, open, poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); } - @Override - public boolean isDoorModel() { - return false; - } - @Override public void setupAnim(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/GrowthShellModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/GrowthShellModel.java similarity index 97% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/GrowthShellModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/GrowthShellModel.java index 55475a20d..7c7c50880 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/GrowthShellModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/GrowthShellModel.java @@ -1,6 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.shell;// Made with Blockbench 4.5.2 -// Exported for Minecraft version 1.17 - 1.18 with Mojang mappings -// Paste this class into your mod and generate all required imports +package whocraft.tardis_refined.client.model.blockentity.shell.shells; import com.mojang.blaze3d.vertex.PoseStack; @@ -9,6 +7,7 @@ import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; import net.minecraft.world.entity.Entity; +import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; public class GrowthShellModel extends ShellModel { @@ -152,7 +151,7 @@ public static LayerDefinition createBodyLayer() { PartDefinition bone7 = bone6.addOrReplaceChild("bone7", CubeListBuilder.create().texOffs(21, 0).addBox(-6.5F, -21.0F, -11.275F, 13.0F, 21.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.0472F, 0.0F)); - ShellModel.splice(partdefinition); + ShellModel.addMaterializationPart(partdefinition); return LayerDefinition.create(meshdefinition, 256, 256); } @@ -168,7 +167,7 @@ public ModelPart root() { } @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { } @@ -181,11 +180,6 @@ public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isB door_closed.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, this.getCurrentAlpha()); } - @Override - public boolean isDoorModel() { - return false; - } - @Override public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { door_closed.visible = true; diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/HieroglyphModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/HieroglyphModel.java new file mode 100644 index 000000000..7f03906f1 --- /dev/null +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/HieroglyphModel.java @@ -0,0 +1,228 @@ +package whocraft.tardis_refined.client.model.blockentity.shell.shells; + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import net.minecraft.client.model.geom.ModelPart; +import net.minecraft.client.model.geom.PartPose; +import net.minecraft.client.model.geom.builders.*; +import net.minecraft.world.entity.Entity; +import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; +import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; + +public class HieroglyphModel extends ShellModel { + + + private final ModelPart door_closed; + private final ModelPart door_open; + private final ModelPart sides; + private final ModelPart bone6; + private final ModelPart pillars; + private final ModelPart bone18; + private final ModelPart bb_main; + private final ModelPart root; + + public HieroglyphModel(ModelPart root) { + super(root); + this.root = root; + this.door_closed = root.getChild("door_closed"); + this.door_open = root.getChild("door_open"); + this.sides = root.getChild("sides"); + this.bone6 = root.getChild("bone6"); + this.pillars = root.getChild("pillars"); + this.bone18 = root.getChild("bone18"); + this.bb_main = root.getChild("bb_main"); + } + + public static LayerDefinition createBodyLayer() { + MeshDefinition meshdefinition = new MeshDefinition(); + PartDefinition partdefinition = meshdefinition.getRoot(); + + PartDefinition door_closed = partdefinition.addOrReplaceChild("door_closed", CubeListBuilder.create().texOffs(66, 69).addBox(-7.5F, -33.0F, -7.5F, 15.0F, 31.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(95, 98).addBox(-5.0F, -27.0F, -11.0F, 10.0F, 3.0F, 4.0F, new CubeDeformation(0.025F)) + .texOffs(0, 25).addBox(2.5F, -24.0F, -9.5F, 2.0F, 12.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(0, 25).mirror().addBox(-4.5F, -24.0F, -9.5F, 2.0F, 12.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(98, 33).addBox(-5.0F, -12.0F, -11.0F, 10.0F, 12.0F, 4.0F, new CubeDeformation(0.0F)) + .texOffs(64, 33).addBox(-4.5F, -11.5F, -10.5F, 9.0F, 9.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F)); + + PartDefinition cube_r1 = door_closed.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(0, 13).addBox(-2.5F, -2.5F, -1.0F, 5.0F, 5.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -12.0F, -9.0F, 0.0F, 0.0F, 0.7854F)); + + PartDefinition cube_r2 = door_closed.addOrReplaceChild("cube_r2", CubeListBuilder.create().texOffs(99, 69).addBox(-5.0F, -5.0F, 0.0F, 10.0F, 5.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -27.0F, -11.0F, -0.5236F, 0.0F, 0.0F)); + + PartDefinition bone29 = door_closed.addOrReplaceChild("bone29", CubeListBuilder.create().texOffs(9, 25).addBox(-1.5F, 0.0F, 0.25F, 3.0F, 5.0F, 1.0F, new CubeDeformation(0.25F)), PartPose.offset(0.0F, -24.0F, -9.75F)); + + PartDefinition door_open = partdefinition.addOrReplaceChild("door_open", CubeListBuilder.create().texOffs(33, 69).addBox(5.5F, -33.0F, -7.5F, 15.0F, 33.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(0, 60).addBox(5.5F, -33.0F, -6.5F, 15.0F, 33.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(95, 98).addBox(8.0F, -27.0F, -11.0F, 10.0F, 3.0F, 4.0F, new CubeDeformation(0.025F)) + .texOffs(9, 25).addBox(11.5F, -24.0F, -9.5F, 3.0F, 5.0F, 1.0F, new CubeDeformation(0.25F)) + .texOffs(0, 25).addBox(15.5F, -24.0F, -9.5F, 2.0F, 12.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(0, 25).mirror().addBox(8.5F, -24.0F, -9.5F, 2.0F, 12.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(98, 33).addBox(8.0F, -12.0F, -11.0F, 10.0F, 12.0F, 4.0F, new CubeDeformation(0.0F)) + .texOffs(64, 33).addBox(8.5F, -11.5F, -10.5F, 9.0F, 9.0F, 3.0F, new CubeDeformation(0.0F)) + .texOffs(0, 49).addBox(-8.5F, -0.2F, -14.75F, 26.0F, 1.0F, 9.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(1.5F, 24.0F, -4.5F, 0.0F, -0.0873F, 0.0F)); + + PartDefinition cube_r3 = door_open.addOrReplaceChild("cube_r3", CubeListBuilder.create().texOffs(0, 13).addBox(-2.5F, -2.5F, -1.0F, 5.0F, 5.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(13.0F, -12.0F, -9.0F, 0.0F, 0.0F, 0.7854F)); + + PartDefinition cube_r4 = door_open.addOrReplaceChild("cube_r4", CubeListBuilder.create().texOffs(99, 69).addBox(-5.0F, -5.0F, 0.0F, 10.0F, 5.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(13.0F, -27.0F, -11.0F, -0.5236F, 0.0F, 0.0F)); + + PartDefinition sides = partdefinition.addOrReplaceChild("sides", CubeListBuilder.create().texOffs(66, 69).addBox(-7.5F, -33.0F, -7.5F, 15.0F, 31.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(95, 98).addBox(-5.0F, -27.0F, -11.0F, 10.0F, 3.0F, 4.0F, new CubeDeformation(0.025F)) + .texOffs(0, 25).addBox(2.5F, -24.0F, -9.5F, 2.0F, 12.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(0, 25).mirror().addBox(-4.5F, -24.0F, -9.5F, 2.0F, 12.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(98, 33).addBox(-5.0F, -12.0F, -11.0F, 10.0F, 12.0F, 4.0F, new CubeDeformation(0.0F)) + .texOffs(9, 32).addBox(-2.0F, -16.0F, -10.0F, 2.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(15, 13).addBox(-0.25F, -15.0F, -9.5F, 1.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(15, 13).addBox(1.0F, -14.25F, -9.75F, 1.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(15, 13).addBox(-1.25F, -13.5F, -10.75F, 1.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(15, 13).addBox(0.5F, -13.5F, -10.5F, 1.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(64, 33).addBox(-4.5F, -11.5F, -10.5F, 9.0F, 9.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 24.0F, 0.0F, 0.0F, -1.5708F, 0.0F)); + + PartDefinition cube_r5 = sides.addOrReplaceChild("cube_r5", CubeListBuilder.create().texOffs(99, 69).addBox(-5.0F, -5.0F, 0.0F, 10.0F, 5.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -27.0F, -11.0F, -0.5236F, 0.0F, 0.0F)); + + PartDefinition bone30 = sides.addOrReplaceChild("bone30", CubeListBuilder.create().texOffs(9, 25).addBox(-1.5F, 0.0F, 1.25F, 3.0F, 5.0F, 1.0F, new CubeDeformation(0.25F)), PartPose.offset(0.0F, -24.0F, -9.75F)); + + PartDefinition bone = sides.addOrReplaceChild("bone", CubeListBuilder.create().texOffs(13, 0).addBox(-0.5F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(-1.0F, -17.5F, -9.0F)); + + PartDefinition bone23 = sides.addOrReplaceChild("bone23", CubeListBuilder.create().texOffs(13, 0).addBox(-0.5F, -0.5F, -0.075F, 1.0F, 1.0F, 1.0F, new CubeDeformation(-0.1F)) + .texOffs(13, 0).addBox(-0.9F, 0.5F, -0.925F, 1.0F, 1.0F, 1.0F, new CubeDeformation(-0.1F)) + .texOffs(13, 0).addBox(-2.75F, 0.5F, -1.175F, 1.0F, 1.0F, 1.0F, new CubeDeformation(-0.1F)), PartPose.offset(1.5F, -14.25F, -9.65F)); + + PartDefinition bone22 = sides.addOrReplaceChild("bone22", CubeListBuilder.create().texOffs(66, 69).addBox(-7.5F, -33.0F, -7.5F, 15.0F, 31.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(95, 98).addBox(-5.0F, -27.0F, -11.0F, 10.0F, 3.0F, 4.0F, new CubeDeformation(0.025F)) + .texOffs(0, 25).addBox(2.5F, -24.0F, -9.5F, 2.0F, 12.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(0, 25).mirror().addBox(-4.5F, -24.0F, -9.5F, 2.0F, 12.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(98, 33).addBox(-5.0F, -12.0F, -11.0F, 10.0F, 12.0F, 4.0F, new CubeDeformation(0.0F)) + .texOffs(9, 32).addBox(-2.0F, -16.0F, -10.0F, 2.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(15, 13).addBox(-0.25F, -15.0F, -9.5F, 1.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(15, 13).addBox(1.0F, -14.25F, -9.75F, 1.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(15, 13).addBox(-1.25F, -13.5F, -10.75F, 1.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(15, 13).addBox(0.5F, -13.5F, -10.5F, 1.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(64, 33).addBox(-4.5F, -11.5F, -10.5F, 9.0F, 9.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.5708F, 0.0F)); + + PartDefinition cube_r6 = bone22.addOrReplaceChild("cube_r6", CubeListBuilder.create().texOffs(99, 69).addBox(-5.0F, -5.0F, 0.0F, 10.0F, 5.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -27.0F, -11.0F, -0.5236F, 0.0F, 0.0F)); + + PartDefinition bone31 = bone22.addOrReplaceChild("bone31", CubeListBuilder.create().texOffs(9, 25).addBox(-1.5F, 0.0F, 1.25F, 3.0F, 5.0F, 1.0F, new CubeDeformation(0.25F)), PartPose.offset(0.0F, -24.0F, -9.75F)); + + PartDefinition bone26 = bone22.addOrReplaceChild("bone26", CubeListBuilder.create().texOffs(13, 0).addBox(-0.5F, -0.5F, -0.075F, 1.0F, 1.0F, 1.0F, new CubeDeformation(-0.1F)) + .texOffs(13, 0).addBox(-0.9F, 0.5F, -0.925F, 1.0F, 1.0F, 1.0F, new CubeDeformation(-0.1F)) + .texOffs(13, 0).addBox(-2.75F, 0.5F, -1.175F, 1.0F, 1.0F, 1.0F, new CubeDeformation(-0.1F)), PartPose.offset(1.5F, -14.25F, -9.65F)); + + PartDefinition bone25 = bone22.addOrReplaceChild("bone25", CubeListBuilder.create().texOffs(13, 0).addBox(-0.5F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(-1.0F, -17.5F, -9.0F)); + + PartDefinition bone24 = bone22.addOrReplaceChild("bone24", CubeListBuilder.create().texOffs(66, 69).addBox(-7.5F, -33.0F, -7.5F, 15.0F, 31.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(95, 98).addBox(-5.0F, -27.0F, -11.0F, 10.0F, 3.0F, 4.0F, new CubeDeformation(0.025F)) + .texOffs(0, 25).addBox(2.5F, -24.0F, -9.5F, 2.0F, 12.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(0, 25).mirror().addBox(-4.5F, -24.0F, -9.5F, 2.0F, 12.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(98, 33).addBox(-5.0F, -12.0F, -11.0F, 10.0F, 12.0F, 4.0F, new CubeDeformation(0.0F)) + .texOffs(9, 32).addBox(-2.0F, -16.0F, -10.0F, 2.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(15, 13).addBox(-0.25F, -15.0F, -9.5F, 1.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(15, 13).addBox(1.0F, -14.25F, -9.75F, 1.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(15, 13).addBox(-1.25F, -13.5F, -10.75F, 1.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(15, 13).addBox(0.5F, -13.5F, -10.5F, 1.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(64, 33).addBox(-4.5F, -11.5F, -10.5F, 9.0F, 9.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.5708F, 0.0F)); + + PartDefinition cube_r7 = bone24.addOrReplaceChild("cube_r7", CubeListBuilder.create().texOffs(99, 69).addBox(-5.0F, -5.0F, 0.0F, 10.0F, 5.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -27.0F, -11.0F, -0.5236F, 0.0F, 0.0F)); + + PartDefinition bone32 = bone24.addOrReplaceChild("bone32", CubeListBuilder.create().texOffs(9, 25).addBox(-1.5F, 0.0F, 1.25F, 3.0F, 5.0F, 1.0F, new CubeDeformation(0.25F)), PartPose.offset(0.0F, -24.0F, -9.75F)); + + PartDefinition bone27 = bone24.addOrReplaceChild("bone27", CubeListBuilder.create().texOffs(13, 0).addBox(-0.5F, -0.5F, -0.075F, 1.0F, 1.0F, 1.0F, new CubeDeformation(-0.1F)) + .texOffs(13, 0).addBox(-0.9F, 0.5F, -0.925F, 1.0F, 1.0F, 1.0F, new CubeDeformation(-0.1F)) + .texOffs(13, 0).addBox(-2.75F, 0.5F, -1.175F, 1.0F, 1.0F, 1.0F, new CubeDeformation(-0.1F)), PartPose.offset(1.5F, -14.25F, -9.65F)); + + PartDefinition bone28 = bone24.addOrReplaceChild("bone28", CubeListBuilder.create().texOffs(13, 0).addBox(-0.5F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(-1.0F, -17.5F, -9.0F)); + + PartDefinition bone6 = partdefinition.addOrReplaceChild("bone6", CubeListBuilder.create().texOffs(0, 40).addBox(1.25F, -40.0F, -8.5F, 6.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(0, 40).mirror().addBox(-7.25F, -40.0F, -8.5F, 6.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(0.0F, 22.0F, 0.0F)); + + PartDefinition bone5 = bone6.addOrReplaceChild("bone5", CubeListBuilder.create(), PartPose.offsetAndRotation(-3.245F, -36.7704F, -8.0F, 0.0F, -0.0044F, 0.0F)); + + PartDefinition cube_r8 = bone5.addOrReplaceChild("cube_r8", CubeListBuilder.create().texOffs(33, 60).mirror().addBox(-0.55F, 0.0F, 0.0F, 8.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-3.755F, -0.2296F, -1.5F, 0.0F, 0.0F, -0.3491F)); + + PartDefinition bone2 = bone6.addOrReplaceChild("bone2", CubeListBuilder.create(), PartPose.offsetAndRotation(3.245F, -36.7704F, -8.0F, 0.0F, 0.0044F, 0.0F)); + + PartDefinition cube_r9 = bone2.addOrReplaceChild("cube_r9", CubeListBuilder.create().texOffs(33, 60).addBox(-7.45F, 0.0F, 0.0F, 8.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(3.755F, -0.2296F, -1.5F, 0.0F, 0.0F, 0.3491F)); + + PartDefinition bone7 = bone6.addOrReplaceChild("bone7", CubeListBuilder.create().texOffs(0, 40).addBox(1.25F, -40.0F, -8.5F, 6.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(0, 40).mirror().addBox(-7.25F, -40.0F, -8.5F, 6.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.5708F, 0.0F)); + + PartDefinition bone8 = bone7.addOrReplaceChild("bone8", CubeListBuilder.create(), PartPose.offsetAndRotation(-3.245F, -36.7704F, -8.0F, 0.0F, -0.0044F, 0.0F)); + + PartDefinition cube_r10 = bone8.addOrReplaceChild("cube_r10", CubeListBuilder.create().texOffs(33, 60).mirror().addBox(-0.55F, 0.0F, 0.0F, 8.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-3.755F, -0.2296F, -1.5F, 0.0F, 0.0F, -0.3491F)); + + PartDefinition bone9 = bone7.addOrReplaceChild("bone9", CubeListBuilder.create(), PartPose.offsetAndRotation(3.245F, -36.7704F, -8.0F, 0.0F, 0.0044F, 0.0F)); + + PartDefinition cube_r11 = bone9.addOrReplaceChild("cube_r11", CubeListBuilder.create().texOffs(33, 60).addBox(-7.45F, 0.0F, 0.0F, 8.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(3.755F, -0.2296F, -1.5F, 0.0F, 0.0F, 0.3491F)); + + PartDefinition bone10 = bone7.addOrReplaceChild("bone10", CubeListBuilder.create().texOffs(0, 40).addBox(1.25F, -40.0F, -8.5F, 6.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(0, 40).mirror().addBox(-7.25F, -40.0F, -8.5F, 6.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.5708F, 0.0F)); + + PartDefinition bone11 = bone10.addOrReplaceChild("bone11", CubeListBuilder.create(), PartPose.offsetAndRotation(-3.245F, -36.7704F, -8.0F, 0.0F, -0.0044F, 0.0F)); + + PartDefinition cube_r12 = bone11.addOrReplaceChild("cube_r12", CubeListBuilder.create().texOffs(33, 60).mirror().addBox(-0.55F, 0.0F, 0.0F, 8.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-3.755F, -0.2296F, -1.5F, 0.0F, 0.0F, -0.3491F)); + + PartDefinition bone12 = bone10.addOrReplaceChild("bone12", CubeListBuilder.create(), PartPose.offsetAndRotation(3.245F, -36.7704F, -8.0F, 0.0F, 0.0044F, 0.0F)); + + PartDefinition cube_r13 = bone12.addOrReplaceChild("cube_r13", CubeListBuilder.create().texOffs(33, 60).addBox(-7.45F, 0.0F, 0.0F, 8.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(3.755F, -0.2296F, -1.5F, 0.0F, 0.0F, 0.3491F)); + + PartDefinition bone13 = bone10.addOrReplaceChild("bone13", CubeListBuilder.create().texOffs(0, 40).addBox(1.25F, -40.0F, -8.5F, 6.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(0, 40).mirror().addBox(-7.25F, -40.0F, -8.5F, 6.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.5708F, 0.0F)); + + PartDefinition bone14 = bone13.addOrReplaceChild("bone14", CubeListBuilder.create(), PartPose.offsetAndRotation(-3.245F, -36.7704F, -8.0F, 0.0F, -0.0044F, 0.0F)); + + PartDefinition cube_r14 = bone14.addOrReplaceChild("cube_r14", CubeListBuilder.create().texOffs(33, 60).mirror().addBox(-0.55F, 0.0F, 0.0F, 8.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-3.755F, -0.2296F, -1.5F, 0.0F, 0.0F, -0.3491F)); + + PartDefinition bone15 = bone13.addOrReplaceChild("bone15", CubeListBuilder.create(), PartPose.offsetAndRotation(3.245F, -36.7704F, -8.0F, 0.0F, 0.0044F, 0.0F)); + + PartDefinition cube_r15 = bone15.addOrReplaceChild("cube_r15", CubeListBuilder.create().texOffs(33, 60).addBox(-7.45F, 0.0F, 0.0F, 8.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(3.755F, -0.2296F, -1.5F, 0.0F, 0.0F, 0.3491F)); + + PartDefinition pillars = partdefinition.addOrReplaceChild("pillars", CubeListBuilder.create(), PartPose.offset(0.0F, 24.0F, 0.0F)); + + PartDefinition bone3 = pillars.addOrReplaceChild("bone3", CubeListBuilder.create().texOffs(0, 0).addBox(6.5F, -10.0F, -10.5F, 4.0F, 8.0F, 4.0F, new CubeDeformation(0.0F)) + .texOffs(0, 95).addBox(7.0F, -41.0F, -10.0F, 3.0F, 31.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 0.0F)); + + PartDefinition bone4 = pillars.addOrReplaceChild("bone4", CubeListBuilder.create().texOffs(0, 0).mirror().addBox(-10.5F, -10.0F, -10.5F, 4.0F, 8.0F, 4.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(0, 95).mirror().addBox(-10.0F, -41.0F, -10.0F, 3.0F, 31.0F, 3.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(0.0F, 0.0F, 0.0F)); + + PartDefinition bone16 = pillars.addOrReplaceChild("bone16", CubeListBuilder.create().texOffs(0, 0).addBox(6.5F, -10.0F, 6.5F, 4.0F, 8.0F, 4.0F, new CubeDeformation(0.0F)) + .texOffs(0, 95).addBox(7.0F, -41.0F, 7.0F, 3.0F, 31.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 0.0F)); + + PartDefinition bone17 = pillars.addOrReplaceChild("bone17", CubeListBuilder.create().texOffs(0, 0).mirror().addBox(-10.5F, -10.0F, 6.5F, 4.0F, 8.0F, 4.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(0, 95).mirror().addBox(-10.0F, -41.0F, 7.0F, 3.0F, 31.0F, 3.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(0.0F, 0.0F, 0.0F)); + + PartDefinition bone18 = partdefinition.addOrReplaceChild("bone18", CubeListBuilder.create().texOffs(98, 50).addBox(-7.5F, -34.0F, -9.5F, 15.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 22.0F, 0.0F)); + + PartDefinition bone19 = bone18.addOrReplaceChild("bone19", CubeListBuilder.create().texOffs(98, 50).addBox(-7.5F, -34.0F, -9.5F, 15.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.5708F, 0.0F)); + + PartDefinition bone20 = bone19.addOrReplaceChild("bone20", CubeListBuilder.create().texOffs(98, 50).addBox(-7.5F, -34.0F, -9.5F, 15.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.5708F, 0.0F)); + + PartDefinition bone21 = bone20.addOrReplaceChild("bone21", CubeListBuilder.create().texOffs(98, 50).addBox(-7.5F, -34.0F, -9.5F, 15.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.5708F, 0.0F)); + + PartDefinition bb_main = partdefinition.addOrReplaceChild("bb_main", CubeListBuilder.create().texOffs(0, 25).addBox(-10.5F, -2.0F, -10.5F, 21.0F, 2.0F, 21.0F, new CubeDeformation(0.0F)) + .texOffs(0, 0).addBox(-10.5F, -39.0F, -10.5F, 21.0F, 3.0F, 21.0F, new CubeDeformation(0.0F)) + .texOffs(58, 49).addBox(-6.5F, -45.0F, -6.5F, 13.0F, 6.0F, 13.0F, new CubeDeformation(0.0F)) + .texOffs(85, 0).addBox(-7.0F, -33.0F, -7.0F, 14.0F, 31.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F)); + addMaterializationPart(partdefinition); + return LayerDefinition.create(meshdefinition, 256, 256); + } + + @Override + public void setDoorPosition(boolean open) { + + } + + @Override + public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + handleAllAnimations(entity, root(), isBaseModel, open, poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + door_open.visible = open; + door_closed.visible = !open; + } + + @Override + public ModelPart root() { + return root; + } + + @Override + public void setupAnim(Entity entity, float f, float g, float h, float i, float j) { + + } +} diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/LiftShellModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/LiftShellModel.java new file mode 100644 index 000000000..6d8381db7 --- /dev/null +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/LiftShellModel.java @@ -0,0 +1,188 @@ +package whocraft.tardis_refined.client.model.blockentity.shell.shells; + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import net.minecraft.client.model.geom.ModelPart; +import net.minecraft.client.model.geom.PartPose; +import net.minecraft.client.model.geom.builders.*; +import net.minecraft.world.entity.Entity; +import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; +import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; + +public class LiftShellModel extends ShellModel { + + + private final ModelPart root; + private final ModelPart doorOpen, doorClosed; + + public LiftShellModel(ModelPart root) { + super(root); + this.root = root; + ModelPart bone28 = root.getChild("bone28"); + this.doorOpen = bone28.getChild("door_open"); + this.doorClosed = bone28.getChild("door_closed"); + } + + public static LayerDefinition createBodyLayer() { + MeshDefinition meshdefinition = new MeshDefinition(); + PartDefinition partdefinition = meshdefinition.getRoot(); + + PartDefinition bone28 = partdefinition.addOrReplaceChild("bone28", CubeListBuilder.create().texOffs(0, 63).addBox(-8.0F, -32.0F, 16.0F, 16.0F, 32.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(0, 21).addBox(-9.0F, -35.0F, -1.0F, 18.0F, 3.0F, 18.0F, new CubeDeformation(0.025F)) + .texOffs(94, 33).addBox(-3.0F, -35.025F, 5.0F, 6.0F, 3.0F, 6.0F, new CubeDeformation(0.025F)) + .texOffs(0, 43).addBox(-9.0F, -1.0F, -1.0F, 18.0F, 1.0F, 18.0F, new CubeDeformation(0.025F)) + .texOffs(0, 0).addBox(-9.5F, -36.0F, -1.5F, 19.0F, 1.0F, 19.0F, new CubeDeformation(0.0F)) + .texOffs(80, 4).addBox(-5.5F, -40.5F, -1.025F, 11.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, -7.0F)); + + PartDefinition door_open = bone28.addOrReplaceChild("door_open", CubeListBuilder.create().texOffs(83, 96).addBox(5.0F, -32.0F, -1.0F, 3.0F, 32.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 0.0F)); + + PartDefinition door_closed = bone28.addOrReplaceChild("door_closed", CubeListBuilder.create().texOffs(92, 80).addBox(-8.0F, -32.0F, -1.0F, 16.0F, 32.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(92, 46).addBox(-8.0F, -32.0F, -0.25F, 16.0F, 32.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 0.0F)); + + PartDefinition bone7 = door_closed.addOrReplaceChild("bone7", CubeListBuilder.create(), PartPose.offset(0.0F, 0.0F, 0.0F)); + + PartDefinition bone6 = bone7.addOrReplaceChild("bone6", CubeListBuilder.create(), PartPose.offset(4.0F, -11.0F, -0.5F)); + + PartDefinition cube_r1 = bone6.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(14, 12).mirror().addBox(0.0F, -5.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(1.0F, -5.5F, 0.0F, 0.0F, 0.0F, 0.4189F)); + + PartDefinition cube_r2 = bone6.addOrReplaceChild("cube_r2", CubeListBuilder.create().texOffs(11, 21).mirror().addBox(0.0F, 0.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(1.0F, -5.5F, 0.0F, 0.0F, 0.0F, -0.4189F)); + + PartDefinition bone5 = bone7.addOrReplaceChild("bone5", CubeListBuilder.create(), PartPose.offset(-4.0F, -11.0F, -0.5F)); + + PartDefinition cube_r3 = bone5.addOrReplaceChild("cube_r3", CubeListBuilder.create().texOffs(14, 12).addBox(-1.0F, -5.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-1.0F, -5.5F, 0.0F, 0.0F, 0.0F, -0.4189F)); + + PartDefinition cube_r4 = bone5.addOrReplaceChild("cube_r4", CubeListBuilder.create().texOffs(11, 21).addBox(-1.0F, 0.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-1.0F, -5.5F, 0.0F, 0.0F, 0.0F, 0.4189F)); + + PartDefinition bone4 = bone7.addOrReplaceChild("bone4", CubeListBuilder.create(), PartPose.offset(-4.0F, -11.0F, -0.5F)); + + PartDefinition cube_r5 = bone4.addOrReplaceChild("cube_r5", CubeListBuilder.create().texOffs(11, 21).mirror().addBox(0.0F, 0.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, -0.4189F)); + + PartDefinition cube_r6 = bone4.addOrReplaceChild("cube_r6", CubeListBuilder.create().texOffs(11, 21).addBox(-1.0F, 0.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-1.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.4189F)); + + PartDefinition bone3 = bone7.addOrReplaceChild("bone3", CubeListBuilder.create(), PartPose.offset(5.0F, -11.0F, -0.5F)); + + PartDefinition cube_r7 = bone3.addOrReplaceChild("cube_r7", CubeListBuilder.create().texOffs(11, 21).mirror().addBox(0.0F, 0.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, -0.4189F)); + + PartDefinition cube_r8 = bone3.addOrReplaceChild("cube_r8", CubeListBuilder.create().texOffs(11, 21).addBox(-1.0F, 0.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-1.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.4189F)); + + PartDefinition bone2 = bone7.addOrReplaceChild("bone2", CubeListBuilder.create(), PartPose.offset(5.0F, -22.0F, -0.5F)); + + PartDefinition cube_r9 = bone2.addOrReplaceChild("cube_r9", CubeListBuilder.create().texOffs(11, 21).mirror().addBox(0.0F, -5.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.4189F)); + + PartDefinition cube_r10 = bone2.addOrReplaceChild("cube_r10", CubeListBuilder.create().texOffs(11, 21).addBox(-1.0F, -5.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-1.0F, 0.0F, 0.0F, 0.0F, 0.0F, -0.4189F)); + + PartDefinition bone = bone7.addOrReplaceChild("bone", CubeListBuilder.create(), PartPose.offset(-4.0F, -22.0F, -0.5F)); + + PartDefinition cube_r11 = bone.addOrReplaceChild("cube_r11", CubeListBuilder.create().texOffs(11, 21).mirror().addBox(0.0F, -5.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.4189F)); + + PartDefinition cube_r12 = bone.addOrReplaceChild("cube_r12", CubeListBuilder.create().texOffs(11, 21).addBox(-1.0F, -5.0F, -0.475F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-1.0F, 0.0F, 0.0F, 0.0F, 0.0F, -0.4189F)); + + PartDefinition bone13 = bone28.addOrReplaceChild("bone13", CubeListBuilder.create().texOffs(49, 91).addBox(-1.25F, -7.9546F, 2.8F, 1.0F, 21.0F, 5.0F, new CubeDeformation(0.0F)) + .texOffs(44, 63).addBox(-2.0F, -11.4546F, 0.75F, 3.0F, 29.0F, 1.0F, new CubeDeformation(-0.025F)) + .texOffs(44, 63).addBox(-2.0F, -11.4546F, -2.0F, 3.0F, 29.0F, 1.0F, new CubeDeformation(-0.025F)) + .texOffs(57, 47).addBox(-1.5F, -12.4546F, -7.0F, 1.0F, 32.0F, 16.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-9.5F, -19.5454F, 9.0F, 0.0F, 3.1416F, 0.0F)); + + PartDefinition bone26 = bone13.addOrReplaceChild("bone26", CubeListBuilder.create(), PartPose.offset(-0.5F, -7.4546F, 5.0F)); + + PartDefinition cube_r13 = bone26.addOrReplaceChild("cube_r13", CubeListBuilder.create().texOffs(0, 21).addBox(-0.25F, -2.0F, -2.0F, 1.0F, 4.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-0.25F, 0.0F, 0.0F, -0.6109F, 0.0F, 0.0F)); + + PartDefinition bone27 = bone13.addOrReplaceChild("bone27", CubeListBuilder.create(), PartPose.offset(-0.5F, 14.5454F, 5.0F)); + + PartDefinition cube_r14 = bone27.addOrReplaceChild("cube_r14", CubeListBuilder.create().texOffs(0, 0).addBox(-0.25F, -3.0F, -3.0F, 1.0F, 6.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-0.25F, 0.0F, 0.0F, -0.6109F, 0.0F, 0.0F)); + + PartDefinition bone24 = bone13.addOrReplaceChild("bone24", CubeListBuilder.create().texOffs(0, 30).addBox(-1.5F, -1.5F, -1.5F, 3.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offset(-0.5F, -9.4546F, -0.5F)); + + PartDefinition bone22 = bone13.addOrReplaceChild("bone22", CubeListBuilder.create(), PartPose.offset(-0.75F, -4.4546F, -4.0F)); + + PartDefinition cube_r15 = bone22.addOrReplaceChild("cube_r15", CubeListBuilder.create().texOffs(0, 0).addBox(-0.5F, -3.0F, -3.0F, 1.0F, 6.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.6109F, 0.0F, 0.0F)); + + PartDefinition bone21 = bone13.addOrReplaceChild("bone21", CubeListBuilder.create(), PartPose.offset(-0.5F, -8.4546F, -6.0F)); + + PartDefinition cube_r16 = bone21.addOrReplaceChild("cube_r16", CubeListBuilder.create().texOffs(0, 21).addBox(-0.25F, -2.0F, -2.0F, 1.0F, 4.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-0.25F, 0.0F, 0.0F, -0.6109F, 0.0F, 0.0F)); + + PartDefinition bone23 = bone13.addOrReplaceChild("bone23", CubeListBuilder.create(), PartPose.offset(-0.5F, -0.4546F, -6.0F)); + + PartDefinition cube_r17 = bone23.addOrReplaceChild("cube_r17", CubeListBuilder.create().texOffs(0, 21).addBox(-0.25F, -2.0F, -2.0F, 1.0F, 4.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-0.25F, 0.0F, 0.0F, -1.3526F, 0.0F, 0.0F)); + + PartDefinition bone25 = bone13.addOrReplaceChild("bone25", CubeListBuilder.create().texOffs(0, 30).addBox(-1.5F, -1.5F, -1.5F, 3.0F, 3.0F, 3.0F, new CubeDeformation(0.25F)), PartPose.offset(-0.5F, 16.7954F, -0.5F)); + + PartDefinition bone12 = bone28.addOrReplaceChild("bone12", CubeListBuilder.create().texOffs(49, 91).addBox(-0.75F, -7.5F, 8.8F, 1.0F, 21.0F, 5.0F, new CubeDeformation(0.0F)) + .texOffs(44, 63).addBox(-1.5F, -11.0F, 6.75F, 3.0F, 29.0F, 1.0F, new CubeDeformation(-0.025F)) + .texOffs(44, 63).addBox(-1.5F, -11.0F, 4.0F, 3.0F, 29.0F, 1.0F, new CubeDeformation(-0.025F)) + .texOffs(57, 47).addBox(-1.0F, -12.0F, -1.0F, 1.0F, 32.0F, 16.0F, new CubeDeformation(0.0F)), PartPose.offset(9.0F, -20.0F, 1.0F)); + + PartDefinition bone20 = bone12.addOrReplaceChild("bone20", CubeListBuilder.create(), PartPose.offset(0.0F, -7.0F, 11.0F)); + + PartDefinition cube_r18 = bone20.addOrReplaceChild("cube_r18", CubeListBuilder.create().texOffs(0, 21).addBox(-0.5F, -2.0F, -2.0F, 1.0F, 4.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.6109F, 0.0F, 0.0F)); + + PartDefinition bone19 = bone12.addOrReplaceChild("bone19", CubeListBuilder.create(), PartPose.offset(0.0F, 15.0F, 11.0F)); + + PartDefinition cube_r19 = bone19.addOrReplaceChild("cube_r19", CubeListBuilder.create().texOffs(0, 0).addBox(-0.5F, -3.0F, -3.0F, 1.0F, 6.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.6109F, 0.0F, 0.0F)); + + PartDefinition bone17 = bone12.addOrReplaceChild("bone17", CubeListBuilder.create().texOffs(0, 30).addBox(-1.5F, -1.5F, -1.5F, 3.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -9.0F, 5.5F)); + + PartDefinition bone15 = bone12.addOrReplaceChild("bone15", CubeListBuilder.create(), PartPose.offset(-0.25F, -4.0F, 2.0F)); + + PartDefinition cube_r20 = bone15.addOrReplaceChild("cube_r20", CubeListBuilder.create().texOffs(0, 0).addBox(-0.75F, -3.0F, -3.0F, 1.0F, 6.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.25F, 0.0F, 0.0F, -0.6109F, 0.0F, 0.0F)); + + PartDefinition bone14 = bone12.addOrReplaceChild("bone14", CubeListBuilder.create(), PartPose.offset(0.0F, -8.0F, 0.0F)); + + PartDefinition cube_r21 = bone14.addOrReplaceChild("cube_r21", CubeListBuilder.create().texOffs(0, 21).addBox(-0.5F, -2.0F, -2.0F, 1.0F, 4.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.6109F, 0.0F, 0.0F)); + + PartDefinition bone16 = bone12.addOrReplaceChild("bone16", CubeListBuilder.create(), PartPose.offset(0.0F, 0.0F, 0.0F)); + + PartDefinition cube_r22 = bone16.addOrReplaceChild("cube_r22", CubeListBuilder.create().texOffs(0, 21).addBox(-0.5F, -2.0F, -2.0F, 1.0F, 4.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -1.3526F, 0.0F, 0.0F)); + + PartDefinition bone18 = bone12.addOrReplaceChild("bone18", CubeListBuilder.create().texOffs(0, 30).addBox(-1.5F, -1.5F, -1.5F, 3.0F, 3.0F, 3.0F, new CubeDeformation(0.25F)), PartPose.offset(0.0F, 17.25F, 5.5F)); + + PartDefinition bone11 = bone28.addOrReplaceChild("bone11", CubeListBuilder.create().texOffs(35, 63).addBox(8.0F, -37.0F, -2.0F, 2.0F, 37.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(35, 63).mirror().addBox(-10.0F, -37.0F, -2.0F, 2.0F, 37.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, 0.0F, 16.0F, 0.0F, 3.1416F, 0.0F)); + + PartDefinition bone10 = bone28.addOrReplaceChild("bone10", CubeListBuilder.create().texOffs(35, 63).addBox(8.0F, -37.0F, -2.0F, 2.0F, 37.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(0, 13).addBox(6.5F, -33.25F, -3.5F, 3.0F, 1.0F, 3.0F, new CubeDeformation(0.0F)) + .texOffs(80, 0).addBox(-7.5F, -33.225F, -2.5F, 16.0F, 1.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(35, 63).mirror().addBox(-10.0F, -37.0F, -2.0F, 2.0F, 37.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(0, 51).addBox(-13.0F, -30.0F, -3.0F, 4.0F, 4.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(0, 43).addBox(-10.5F, -22.0F, -2.5F, 3.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 0.0F)); + + PartDefinition bone9 = bone28.addOrReplaceChild("bone9", CubeListBuilder.create().texOffs(59, 3).addBox(0.0F, -5.433F, -9.0F, 1.0F, 3.0F, 18.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -38.067F, 8.0F, 0.0F, -1.5708F, 0.0F)); + + PartDefinition cube_r23 = bone9.addOrReplaceChild("cube_r23", CubeListBuilder.create().texOffs(55, 25).addBox(0.0F, 0.0F, -9.0F, 10.0F, 2.0F, 18.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-8.65F, 2.067F, 0.0F, 0.0F, 0.0F, -0.5236F)); + + PartDefinition cube_r24 = bone9.addOrReplaceChild("cube_r24", CubeListBuilder.create().texOffs(55, 25).mirror().addBox(-10.0F, 0.0F, -9.0F, 10.0F, 2.0F, 18.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(8.65F, 2.067F, 0.0F, 0.0F, 0.0F, 0.5236F)); + + PartDefinition bone8 = bone28.addOrReplaceChild("bone8", CubeListBuilder.create().texOffs(59, 3).addBox(8.65F, -7.5F, -9.0F, 1.0F, 3.0F, 18.0F, new CubeDeformation(0.0F)), PartPose.offset(-8.65F, -36.0F, 8.0F)); + + PartDefinition cube_r25 = bone8.addOrReplaceChild("cube_r25", CubeListBuilder.create().texOffs(55, 25).addBox(0.0F, 0.0F, -9.0F, 10.0F, 2.0F, 18.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, -0.5236F)); + + PartDefinition cube_r26 = bone8.addOrReplaceChild("cube_r26", CubeListBuilder.create().texOffs(55, 25).mirror().addBox(-10.0F, 0.0F, -9.0F, 10.0F, 2.0F, 18.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(17.3F, 0.0F, 0.0F, 0.0F, 0.0F, 0.5236F)); + + PartDefinition blackface = bone28.addOrReplaceChild("blackface", CubeListBuilder.create().texOffs(0, 97).addBox(-8.0F, -32.0F, -0.75F, 16.0F, 32.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 1.0F)); + + PartDefinition clock_hand = bone28.addOrReplaceChild("clock_hand", CubeListBuilder.create().texOffs(80, 11).addBox(-0.5F, -2.5F, 0.0F, 1.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -37.0F, -1.275F)); + addMaterializationPart(partdefinition); + return LayerDefinition.create(meshdefinition, 256, 256); + } + + @Override + public void setDoorPosition(boolean open) { + + } + + @Override + public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + handleAllAnimations(entity, root(), isBaseModel, open, poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + doorOpen.visible = open; + doorClosed.visible = !open; + } + + @Override + public ModelPart root() { + return root; + } + + @Override + public void setupAnim(Entity entity, float f, float g, float h, float i, float j) { + + } +} diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/MysticShellModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/MysticShellModel.java similarity index 99% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/MysticShellModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/MysticShellModel.java index 131751251..b9fe749f7 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/MysticShellModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/MysticShellModel.java @@ -1,4 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.shell; +package whocraft.tardis_refined.client.model.blockentity.shell.shells; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; @@ -16,6 +16,7 @@ import net.minecraft.world.entity.Entity; import whocraft.tardis_refined.TardisRefined; import whocraft.tardis_refined.client.TardisClientData; +import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; @@ -979,7 +980,7 @@ public static LayerDefinition createBodyLayer() { .texOffs(44, 0).addBox(-6.9F, -35.9F, -7.0F, 14.0F, 1.0F, 8.0F, new CubeDeformation(-0.025F)) .texOffs(44, 0).addBox(-6.9F, -4.1F, -7.0F, 14.0F, 1.0F, 8.0F, new CubeDeformation(-0.025F)), PartPose.offset(0.0F, 24.0F, 0.0F)); - splice(partdefinition); + addMaterializationPart(partdefinition); return LayerDefinition.create(meshdefinition, 256, 256); } @@ -1012,7 +1013,7 @@ public void setupAnim(Entity entity, float limbSwing, float limbSwingAmount, flo } @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { if (open) { this.left_door.yRot = 250f; this.right_door.yRot = -250f; @@ -1027,11 +1028,6 @@ public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isB handleAllAnimations(entity, root(), isBaseModel, open, poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); } - @Override - public boolean isDoorModel() { - return false; - } - @Override public void handleSpecialAnimation(GlobalShellBlockEntity entity, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float baseAlpha) { TardisClientData reactions = TardisClientData.getInstance(entity.getTardisId()); diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/NukaShellModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/NukaShellModel.java similarity index 98% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/NukaShellModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/NukaShellModel.java index fe4d39409..b49baa15b 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/NukaShellModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/NukaShellModel.java @@ -1,4 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.shell; +package whocraft.tardis_refined.client.model.blockentity.shell.shells; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; @@ -16,6 +16,7 @@ import net.minecraft.world.entity.Entity; import whocraft.tardis_refined.TardisRefined; import whocraft.tardis_refined.client.TardisClientData; +import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; public class NukaShellModel extends ShellModel { @@ -79,7 +80,7 @@ public class NukaShellModel extends ShellModel { AnimationChannel.Interpolations.LINEAR))).build(); @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { if (open) { this.left_door.yRot = 250f; this.right_door.yRot = -250f; @@ -174,16 +175,11 @@ public static LayerDefinition createBodyLayer() { PartDefinition cube_r5 = bb_main.addOrReplaceChild("cube_r5", CubeListBuilder.create().texOffs(94, 125).addBox(-1.5F, -36.5F, -1.5F, 3.0F, 38.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(9.5F, -4.5F, -9.5F, 0.0F, -0.7854F, 0.0F)); - ShellModel.splice(partdefinition); + ShellModel.addMaterializationPart(partdefinition); return LayerDefinition.create(meshdefinition, 256, 256); } - @Override - public boolean isDoorModel() { - return false; - } - @Override public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { sign.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/PagodaShellModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/PagodaShellModel.java similarity index 97% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/PagodaShellModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/PagodaShellModel.java index 671fbcbc3..31c6a00d6 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/PagodaShellModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/PagodaShellModel.java @@ -1,6 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.shell;// Made with Blockbench 4.6.4 -// Exported for Minecraft version 1.17 or later with Mojang mappings -// Paste this class into your mod and generate all required imports +package whocraft.tardis_refined.client.model.blockentity.shell.shells; import com.mojang.blaze3d.vertex.PoseStack; @@ -9,6 +7,7 @@ import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; import net.minecraft.world.entity.Entity; +import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; public class PagodaShellModel extends ShellModel { @@ -146,7 +145,7 @@ public static LayerDefinition createBodyLayer() { .texOffs(23, 91).addBox(-9.0F, -33.0F, -9.0F, 18.0F, 1.0F, 18.0F, new CubeDeformation(0.0F)) .texOffs(0, 111).addBox(-8.0F, -0.025F, -8.0F, 16.0F, 1.0F, 16.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F)); - ShellModel.splice(partdefinition); + ShellModel.addMaterializationPart(partdefinition); return LayerDefinition.create(meshdefinition, 128, 128); } @@ -161,7 +160,7 @@ public ModelPart root() { return root; } - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { this.door.yRot = (open) ? -275f : 0; } @@ -171,11 +170,6 @@ public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isB handleAllAnimations(entity, root, isBaseModel, open, poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); } - @Override - public boolean isDoorModel() { - return false; - } - @Override public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/PhoneBoothModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/PhoneBoothModel.java similarity index 96% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/PhoneBoothModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/PhoneBoothModel.java index 1d8b4d566..ded74cf35 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/PhoneBoothModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/PhoneBoothModel.java @@ -1,4 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.shell; +package whocraft.tardis_refined.client.model.blockentity.shell.shells; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; @@ -6,6 +6,7 @@ import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; import net.minecraft.world.entity.Entity; +import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; public class PhoneBoothModel extends ShellModel { @@ -70,7 +71,7 @@ public static LayerDefinition createBodyLayer() { .texOffs(0, 0).addBox(-1.5F, 8.0F, -1.0F, 2.0F, 8.0F, 2.0F, new CubeDeformation(0.25F)) .texOffs(0, 23).addBox(-1.5F, -20.75F, -1.0F, 2.0F, 5.0F, 2.0F, new CubeDeformation(0.25F)), PartPose.offset(-7.5F, -18.0F, -8.0F)); - ShellModel.splice(partdefinition); + ShellModel.addMaterializationPart(partdefinition); return LayerDefinition.create(meshdefinition, 128, 128); @@ -93,12 +94,7 @@ public void setupAnim(Entity entity, float f, float g, float h, float i, float j } @Override - public boolean isDoorModel() { - return false; - } - - @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { this.door.yRot = (open) ? 1.75f : 0; } diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/PoliceBoxModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/PoliceBoxModel.java new file mode 100644 index 000000000..50ed66fdf --- /dev/null +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/PoliceBoxModel.java @@ -0,0 +1,170 @@ +package whocraft.tardis_refined.client.model.blockentity.shell.shells; + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import net.minecraft.client.model.geom.ModelPart; +import net.minecraft.client.model.geom.PartPose; +import net.minecraft.client.model.geom.builders.*; +import net.minecraft.world.entity.Entity; +import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; +import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; + +public class PoliceBoxModel extends ShellModel { + private final ModelPart root; + private final ModelPart left_door; + private final ModelPart right_door; + private final ModelPart frame; + + public PoliceBoxModel(ModelPart root) { + super(root); + this.root = root; + this.frame = root.getChild("tardis_frame"); + this.right_door = root.getChild("right_door"); + this.left_door = root.getChild("left_door"); + } + + public static LayerDefinition createBodyLayer() { + MeshDefinition meshdefinition = new MeshDefinition(); + PartDefinition partdefinition = meshdefinition.getRoot(); + + PartDefinition tardis_frame = partdefinition.addOrReplaceChild("tardis_frame", CubeListBuilder.create(), PartPose.offset(0.0F, 24.0F, 0.0F)); + + PartDefinition bone = tardis_frame.addOrReplaceChild("bone", CubeListBuilder.create(), PartPose.offset(0.0F, 0.0F, 0.0F)); + + PartDefinition frame = bone.addOrReplaceChild("frame", CubeListBuilder.create().texOffs(64, 41).addBox(-9.0F, -36.25F, -11.25F, 18.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(0, 28).addBox(-10.5F, -43.0F, -10.5F, 21.0F, 4.0F, 21.0F, new CubeDeformation(0.0F)) + .texOffs(0, 0).addBox(-3.0F, -45.0F, -3.0F, 6.0F, 2.0F, 6.0F, new CubeDeformation(0.0F)) + .texOffs(0, 16).addBox(-2.0F, -48.0F, -2.0F, 4.0F, 3.0F, 4.0F, new CubeDeformation(0.0F)) + .texOffs(0, 9).addBox(-2.5F, -49.0F, -2.5F, 5.0F, 1.0F, 5.0F, new CubeDeformation(0.0F)) + .texOffs(64, 28).addBox(-10.5F, -39.5F, -12.5F, 21.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(0, 0).addBox(-12.5F, -2.0F, -12.5F, 25.0F, 2.0F, 25.0F, new CubeDeformation(0.0F)) + .texOffs(0, 54).addBox(-9.5F, -33.5F, -1.75F, 19.0F, 32.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(41, 54).addBox(-9.5F, -34.275F, -9.25F, 19.0F, 1.0F, 8.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 0.0F)); + + PartDefinition frame_r1 = frame.addOrReplaceChild("frame_r1", CubeListBuilder.create().texOffs(64, 28).addBox(-10.5F, -39.5F, -12.5F, 21.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 1.5708F, 0.0F)); + + PartDefinition frame_r2 = frame.addOrReplaceChild("frame_r2", CubeListBuilder.create().texOffs(64, 28).addBox(-10.5F, -39.5F, -12.5F, 21.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 3.1416F, 0.0F)); + + PartDefinition frame_r3 = frame.addOrReplaceChild("frame_r3", CubeListBuilder.create().texOffs(64, 28).addBox(-10.5F, -39.5F, -12.5F, 21.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.5708F, 0.0F)); + + PartDefinition bone3 = frame.addOrReplaceChild("bone3", CubeListBuilder.create().texOffs(64, 35).addBox(-9.0F, -36.25F, -11.25F, 18.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.5708F, 0.0F)); + + PartDefinition bone11 = bone3.addOrReplaceChild("bone11", CubeListBuilder.create().texOffs(0, 37).mirror().addBox(-6.5F, -8.5F, 0.25F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(0, 37).addBox(-6.5F, -16.0F, 0.25F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(76, 0).addBox(-6.5F, -23.5F, 0.25F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(19, 88).addBox(-7.5F, -32.0F, 0.75F, 8.0F, 32.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(0, 28).addBox(-6.5F, -31.25F, 0.15F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(13, 16).addBox(-5.5F, -28.75F, 0.075F, 4.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(8.0F, -1.5F, -11.25F)); + + PartDefinition bone12 = bone3.addOrReplaceChild("bone12", CubeListBuilder.create().texOffs(0, 37).addBox(0.5F, -8.5F, 0.25F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(76, 0).addBox(0.5F, -16.0F, 0.25F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(0, 37).addBox(0.5F, -23.5F, 0.25F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(0, 88).addBox(-0.5F, -32.0F, 0.75F, 8.0F, 32.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(38, 107).addBox(7.5F, -32.0F, 0.25F, 1.0F, 32.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(-8.0F, -1.5F, -11.25F)); + + PartDefinition bone4 = bone12.addOrReplaceChild("bone4", CubeListBuilder.create().texOffs(0, 28).mirror().addBox(-3.25F, -8.25F, 0.9F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(13, 16).addBox(-2.25F, -5.75F, 0.825F, 4.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(3.75F, -23.0F, -0.75F)); + + PartDefinition bone6 = frame.addOrReplaceChild("bone6", CubeListBuilder.create().texOffs(64, 35).addBox(-9.0F, -36.25F, -11.25F, 18.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 3.1416F, 0.0F)); + + PartDefinition bone13 = bone6.addOrReplaceChild("bone13", CubeListBuilder.create().texOffs(76, 0).mirror().addBox(-6.5F, -8.5F, 0.25F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(0, 37).addBox(-6.5F, -16.0F, 0.25F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(76, 0).addBox(-6.5F, -23.5F, 0.25F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(19, 88).addBox(-7.5F, -32.0F, 0.75F, 8.0F, 32.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(0, 28).addBox(-6.5F, -31.25F, 0.15F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(13, 16).addBox(-5.5F, -28.75F, 0.075F, 4.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(8.0F, -1.5F, -11.25F)); + + PartDefinition bone14 = bone6.addOrReplaceChild("bone14", CubeListBuilder.create().texOffs(0, 37).addBox(0.5F, -8.5F, 0.25F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(0, 37).addBox(0.5F, -16.0F, 0.25F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(76, 0).addBox(0.5F, -23.5F, 0.25F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(0, 88).addBox(-0.5F, -32.0F, 0.75F, 8.0F, 32.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(38, 107).addBox(7.5F, -32.0F, 0.25F, 1.0F, 32.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(-8.0F, -1.5F, -11.25F)); + + PartDefinition bone7 = bone14.addOrReplaceChild("bone7", CubeListBuilder.create().texOffs(0, 28).mirror().addBox(-3.25F, -8.25F, 0.9F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(13, 16).addBox(-2.25F, -5.75F, 0.825F, 4.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(3.75F, -23.0F, -0.75F)); + + PartDefinition bone8 = frame.addOrReplaceChild("bone8", CubeListBuilder.create().texOffs(64, 35).addBox(-9.0F, -36.25F, -11.25F, 18.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 1.5708F, 0.0F)); + + PartDefinition bone15 = bone8.addOrReplaceChild("bone15", CubeListBuilder.create().texOffs(0, 37).mirror().addBox(-6.5F, -8.5F, 0.25F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(76, 0).addBox(-6.5F, -16.0F, 0.25F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(76, 0).addBox(-6.5F, -23.5F, 0.25F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(19, 88).addBox(-7.5F, -32.0F, 0.75F, 8.0F, 32.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(0, 28).addBox(-6.5F, -31.25F, 0.15F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(13, 16).addBox(-5.5F, -28.75F, 0.075F, 4.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(8.0F, -1.5F, -11.25F)); + + PartDefinition bone16 = bone8.addOrReplaceChild("bone16", CubeListBuilder.create().texOffs(76, 0).addBox(0.5F, -8.5F, 0.25F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(0, 37).addBox(0.5F, -16.0F, 0.25F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(0, 37).addBox(0.5F, -23.5F, 0.25F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(0, 88).addBox(-0.5F, -32.0F, 0.75F, 8.0F, 32.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(38, 107).addBox(7.5F, -32.0F, 0.25F, 1.0F, 32.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(-8.0F, -1.5F, -11.25F)); + + PartDefinition bone9 = bone16.addOrReplaceChild("bone9", CubeListBuilder.create().texOffs(0, 28).mirror().addBox(-3.25F, -8.25F, 0.9F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(13, 16).addBox(-2.25F, -5.75F, 0.825F, 4.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(3.75F, -23.0F, -0.75F)); + + PartDefinition bone2 = frame.addOrReplaceChild("bone2", CubeListBuilder.create().texOffs(80, 64).addBox(8.5F, -41.0F, -11.5F, 3.0F, 39.0F, 3.0F, new CubeDeformation(0.0F)) + .texOffs(67, 64).addBox(-11.5F, -41.0F, -11.5F, 3.0F, 39.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 0.0F)); + + PartDefinition bone10 = frame.addOrReplaceChild("bone10", CubeListBuilder.create().texOffs(54, 64).addBox(8.5F, -41.0F, -11.5F, 3.0F, 39.0F, 3.0F, new CubeDeformation(0.0F)) + .texOffs(41, 64).addBox(-11.5F, -41.0F, -11.5F, 3.0F, 39.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 3.1416F, 0.0F)); + + PartDefinition right_door = partdefinition.addOrReplaceChild("right_door", CubeListBuilder.create().texOffs(0, 37).mirror().addBox(-7.0F, -8.5F, -0.5F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(0, 37).addBox(-7.0F, -16.0F, -0.5F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(76, 0).addBox(-7.0F, -23.5F, -0.5F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(41, 54).addBox(-8.5F, -22.0F, -1.75F, 1.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(88, 47).addBox(-6.5F, -23.0F, -0.525F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(93, 98).addBox(-8.0F, -32.0F, 0.0F, 8.0F, 32.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(76, 9).addBox(-7.0F, -31.25F, -0.6F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(76, 18).addBox(-6.0F, -28.75F, -0.675F, 4.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(8.5F, 22.5F, -10.5F)); + + PartDefinition left_door = partdefinition.addOrReplaceChild("left_door", CubeListBuilder.create().texOffs(0, 37).addBox(1.0F, -8.5F, -0.5F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(0, 37).addBox(1.0F, -16.0F, -0.5F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(0, 37).addBox(1.0F, -23.5F, -0.5F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(90, 17).addBox(1.5F, -23.0F, -0.525F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(0, 0).addBox(5.5F, -21.5F, -1.275F, 1.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(93, 64).addBox(0.0F, -32.0F, 0.0F, 8.0F, 32.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(45, 107).addBox(8.0F, -32.0F, -0.5F, 1.0F, 32.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(-8.5F, 22.5F, -10.5F)); + + PartDefinition bone5 = left_door.addOrReplaceChild("bone5", CubeListBuilder.create().texOffs(76, 9).mirror().addBox(-3.25F, -8.25F, 0.9F, 6.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false) + .texOffs(76, 18).addBox(-2.25F, -5.75F, 0.825F, 4.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(4.25F, -23.0F, -1.5F)); + addMaterializationPart(partdefinition); + return LayerDefinition.create(meshdefinition, 256, 256); + } + + @Override + public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + poseStack.scale(1.05f, 1.05f, 1.05f); + poseStack.translate(0, -0.07, 0); + frame.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + left_door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + right_door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + } + + @Override + public ModelPart root() { + return this.root; + } + + @Override + public void setupAnim(Entity entity, float f, float g, float h, float i, float j) { + + } + + @Override + public void setDoorPosition(boolean open) { + this.right_door.yRot = (open) ? -275f : 0; + } + + @Override + public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + if (isBaseModel) { + poseStack.scale(1.05f, 1.05f, 1.05f); + poseStack.translate(0, -0.07, 0); + } + handleAllAnimations(entity,frame,isBaseModel, open, poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + + frame.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, this.getCurrentAlpha()); + left_door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, this.getCurrentAlpha()); + right_door.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, this.getCurrentAlpha()); + } + +} \ No newline at end of file diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/PortalooShellModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/PortalooShellModel.java similarity index 95% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/PortalooShellModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/PortalooShellModel.java index fa254de98..e78b95f4e 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/PortalooShellModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/PortalooShellModel.java @@ -1,4 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.shell;// Made with Blockbench 4.6.4 +package whocraft.tardis_refined.client.model.blockentity.shell.shells;// Made with Blockbench 4.6.4 // Exported for Minecraft version 1.17 or later with Mojang mappings // Paste this class into your mod and generate all required imports @@ -8,6 +8,7 @@ import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; import net.minecraft.world.entity.Entity; +import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; public class PortalooShellModel extends ShellModel { @@ -63,7 +64,7 @@ public static LayerDefinition createBodyLayer() { .texOffs(44, 25).addBox(1.0F, -10.5F, -1.0F, 12.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)) .texOffs(0, 0).addBox(11.0F, 2.0F, -2.5F, 2.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(-7.0F, 0.5F, -7.0F)); - ShellModel.splice(partdefinition); + ShellModel.addMaterializationPart(partdefinition); return LayerDefinition.create(meshdefinition, 128, 128); } @@ -80,7 +81,7 @@ public ModelPart root() { } @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { this.door.yRot = (open) ? 1.75f : 0; } @@ -89,11 +90,6 @@ public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isB handleAllAnimations(entity, root, isBaseModel, open, poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); } - @Override - public boolean isDoorModel() { - return false; - } - @Override public void setupAnim(Entity entity, float f, float g, float h, float i, float j) { diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/PresentShellModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/PresentShellModel.java similarity index 94% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/PresentShellModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/PresentShellModel.java index 8bb7d0710..3e5ae0fde 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/PresentShellModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/PresentShellModel.java @@ -1,4 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.shell; +package whocraft.tardis_refined.client.model.blockentity.shell.shells; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; @@ -6,6 +6,7 @@ import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; import net.minecraft.world.entity.Entity; +import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; public class PresentShellModel extends ShellModel { @@ -15,7 +16,7 @@ public class PresentShellModel extends ShellModel { private final ModelPart door; @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { this.door.xRot = (open) ? 1.5f :0; } @@ -24,11 +25,6 @@ public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isB handleAllAnimations(entity,root(),isBaseModel, open, poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); } - @Override - public boolean isDoorModel() { - return false; - } - public PresentShellModel(ModelPart root) { super(root); this.root = root; @@ -62,7 +58,7 @@ public static LayerDefinition createBodyLayer() { PartDefinition cube_r3 = bone4.addOrReplaceChild("cube_r3", CubeListBuilder.create().texOffs(81, 12).mirror().addBox(-8.0F, 0.0F, -4.0F, 10.0F, 4.0F, 8.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-1.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.5672F)); PartDefinition cube_r4 = bone4.addOrReplaceChild("cube_r4", CubeListBuilder.create().texOffs(81, 12).addBox(-2.0F, 0.0F, -4.0F, 10.0F, 4.0F, 8.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(1.0F, 0.0F, 0.0F, 0.0F, 0.0F, -0.5672F)); - splice(partdefinition); + addMaterializationPart(partdefinition); return LayerDefinition.create(meshdefinition, 128, 128); } diff --git a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/VendingMachineShellModel.java b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/VendingMachineShellModel.java similarity index 94% rename from common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/VendingMachineShellModel.java rename to common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/VendingMachineShellModel.java index 62bf28d24..705504639 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/VendingMachineShellModel.java +++ b/common/src/main/java/whocraft/tardis_refined/client/model/blockentity/shell/shells/VendingMachineShellModel.java @@ -1,4 +1,4 @@ -package whocraft.tardis_refined.client.model.blockentity.shell; +package whocraft.tardis_refined.client.model.blockentity.shell.shells; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; @@ -6,6 +6,7 @@ import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; import net.minecraft.world.entity.Entity; +import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; public class VendingMachineShellModel extends ShellModel { @@ -31,7 +32,7 @@ public static LayerDefinition createBodyLayer() { PartDefinition bone11 = partdefinition.addOrReplaceChild("bone11", CubeListBuilder.create().texOffs(0, 49).addBox(-7.0F, -35.0F, -1.0F, 14.0F, 6.0F, 14.0F, new CubeDeformation(0.0F)).texOffs(0, 0).addBox(-10.0F, -32.0F, 2.0F, 20.0F, 36.0F, 12.0F, new CubeDeformation(0.0F)).texOffs(91, 0).addBox(-4.0F, -23.0F, 14.0F, 8.0F, 15.0F, 1.0F, new CubeDeformation(0.0F)).texOffs(91, 17).addBox(-4.0F, -6.0F, 14.0F, 8.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)).texOffs(91, 23).addBox(-3.0F, -8.0F, 14.5F, 6.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)).texOffs(76, 10).addBox(10.0F, -26.0F, 5.0F, 1.0F, 19.0F, 6.0F, new CubeDeformation(0.0F)).texOffs(76, 10).mirror().addBox(-11.0F, -26.0F, 5.0F, 1.0F, 19.0F, 6.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(0.0F, 20.0F, -7.0F)); - ShellModel.splice(partdefinition); + ShellModel.addMaterializationPart(partdefinition); return LayerDefinition.create(meshdefinition, 128, 128); } @@ -42,15 +43,10 @@ public ModelPart root() { } @Override - public void setDoorOpen(boolean open) { + public void setDoorPosition(boolean open) { this.door.xRot = (open) ? 1.6f : 0; } - @Override - public boolean isDoorModel() { - return false; - } - @Override public void renderShell(GlobalShellBlockEntity entity, boolean open, boolean isBaseModel, PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { handleAllAnimations(entity, root(), isBaseModel, open, poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); diff --git a/common/src/main/java/whocraft/tardis_refined/client/renderer/blockentity/console/GlobalConsoleRenderer.java b/common/src/main/java/whocraft/tardis_refined/client/renderer/blockentity/console/GlobalConsoleRenderer.java index ce2cdc050..1b9ba18c6 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/renderer/blockentity/console/GlobalConsoleRenderer.java +++ b/common/src/main/java/whocraft/tardis_refined/client/renderer/blockentity/console/GlobalConsoleRenderer.java @@ -8,16 +8,16 @@ import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; import net.minecraft.client.renderer.texture.OverlayTexture; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.Vec3; import whocraft.tardis_refined.client.TardisClientData; import whocraft.tardis_refined.client.model.blockentity.console.ConsoleModelCollection; import whocraft.tardis_refined.client.model.blockentity.console.ConsoleUnit; import whocraft.tardis_refined.client.model.blockentity.shell.ShellModelCollection; -import whocraft.tardis_refined.common.block.console.GlobalConsoleBlock; +import whocraft.tardis_refined.client.screen.selections.ShellSelectionScreen; import whocraft.tardis_refined.common.blockentity.console.GlobalConsoleBlockEntity; import whocraft.tardis_refined.common.tardis.themes.ConsoleTheme; import whocraft.tardis_refined.patterns.ShellPattern; +import whocraft.tardis_refined.patterns.ShellPatterns; import java.util.Objects; @@ -48,11 +48,11 @@ public void render(GlobalConsoleBlockEntity blockEntity, float partialTick, Pose } poseStack.popPose(); - if (theme == ConsoleTheme.CRYSTAL.getId()) { + if (theme.toString().equals(ConsoleTheme.CRYSTAL.getId().toString())) { renderHoloShell(crystalHolo,270, blockEntity, poseStack, bufferSource, packedLight, crystalHoloColor); } - if (theme == ConsoleTheme.INITIATIVE.getId()) { + if (theme.toString().equals(ConsoleTheme.INITIATIVE.getId().toString())) { renderHoloShell(initiativeHolo, -30 + 180, blockEntity, poseStack, bufferSource, packedLight, initiativeHoloColor); } } @@ -61,8 +61,11 @@ private void renderHoloShell(Vec3 offset, int rotation, GlobalConsoleBlockEntity if (blockEntity.getLevel().random.nextInt(20) != 0) { poseStack.pushPose(); TardisClientData reactions = TardisClientData.getInstance(blockEntity.getLevel().dimension()); - var model = ShellModelCollection.getInstance().getShellModel(reactions.getShellTheme()); - model.setDoorOpen(false); + ResourceLocation shellTheme = reactions.getShellTheme(); + ResourceLocation shellPattern = reactions.getShellPattern(); + + var model = ShellModelCollection.getInstance().getShellEntry(shellTheme).getShellModel(); + model.setDoorPosition(false); poseStack.mulPose(Axis.ZP.rotationDegrees(180F)); poseStack.translate(offset.x, offset.y, offset.z); @@ -74,8 +77,12 @@ private void renderHoloShell(Vec3 offset, int rotation, GlobalConsoleBlockEntity poseStack.mulPose(Axis.YP.rotationDegrees(rotation % 360)); } - ShellPattern pattern = reactions.shellPattern(); - model.renderToBuffer(poseStack, bufferSource.getBuffer(RenderType.entityTranslucent(pattern.exteriorDoorTexture().texture())), packedLight, OverlayTexture.NO_OVERLAY, (float) color.x, (float) color.y, (float) color.z, 0.25f); + if (ShellSelectionScreen.globalShellBlockEntity == null) { + ShellSelectionScreen.generateDummyGlobalShell(); + } + + ShellPattern pattern = ShellPatterns.getPatternOrDefault(shellTheme, shellPattern); + model.renderShell(ShellSelectionScreen.globalShellBlockEntity, false, true, poseStack, bufferSource.getBuffer(RenderType.entityTranslucent(pattern.exteriorDoorTexture().texture())), packedLight, OverlayTexture.NO_OVERLAY, (float) color.x, (float) color.y, (float) color.z, 0.25f); poseStack.popPose(); } } diff --git a/common/src/main/java/whocraft/tardis_refined/client/renderer/blockentity/door/BulkHeadDoorRenderer.java b/common/src/main/java/whocraft/tardis_refined/client/renderer/blockentity/door/BulkHeadDoorRenderer.java index 988f76edb..099fc5e7d 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/renderer/blockentity/door/BulkHeadDoorRenderer.java +++ b/common/src/main/java/whocraft/tardis_refined/client/renderer/blockentity/door/BulkHeadDoorRenderer.java @@ -11,7 +11,7 @@ import net.minecraft.world.level.block.state.BlockState; import whocraft.tardis_refined.TardisRefined; import whocraft.tardis_refined.client.ModelRegistry; -import whocraft.tardis_refined.client.model.blockentity.door.BulkHeadDoorModel; +import whocraft.tardis_refined.client.model.blockentity.door.interior.BulkHeadDoorModel; import whocraft.tardis_refined.common.block.door.GlobalDoorBlock; import whocraft.tardis_refined.common.blockentity.door.BulkHeadDoorBlockEntity; diff --git a/common/src/main/java/whocraft/tardis_refined/client/renderer/blockentity/door/GlobalDoorRenderer.java b/common/src/main/java/whocraft/tardis_refined/client/renderer/blockentity/door/GlobalDoorRenderer.java index 758b344b5..2f25e2342 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/renderer/blockentity/door/GlobalDoorRenderer.java +++ b/common/src/main/java/whocraft/tardis_refined/client/renderer/blockentity/door/GlobalDoorRenderer.java @@ -9,65 +9,22 @@ import net.minecraft.client.renderer.texture.OverlayTexture; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.block.state.BlockState; -import whocraft.tardis_refined.client.ModelRegistry; -import whocraft.tardis_refined.client.TardisClientData; -import whocraft.tardis_refined.client.model.blockentity.door.*; -import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; +import whocraft.tardis_refined.client.model.blockentity.door.interior.ShellDoorModel; +import whocraft.tardis_refined.client.model.blockentity.shell.ShellModelCollection; import whocraft.tardis_refined.common.block.door.GlobalDoorBlock; import whocraft.tardis_refined.common.blockentity.door.GlobalDoorBlockEntity; import whocraft.tardis_refined.common.tardis.themes.ShellTheme; -import whocraft.tardis_refined.patterns.ShellPattern; - -import java.util.HashMap; -import java.util.Map; public class GlobalDoorRenderer implements BlockEntityRenderer, BlockEntityRendererProvider { - protected static ShellModel currentModel; - private static ShellModel factoryDoorModel, policeBoxModel, phoneBoothDoorModel, mysticDoorModel, drifterModel, presentModel, vendingModel, briefcaseModel, - groeningModel, bigBenModel, nukaModel, growthModel, portalooModel, pagodaModel; - - public static Map DOOR_MODELS = new HashMap<>(); - + protected static ShellDoorModel currentModel; public GlobalDoorRenderer(BlockEntityRendererProvider.Context context) { - this.registerModels(context); - } - public void registerModels(BlockEntityRendererProvider.Context context){ - factoryDoorModel = new FactoryDoorModel(context.bakeLayer((ModelRegistry.FACTORY_DOOR))); - policeBoxModel = new PoliceBoxDoorModel(context.bakeLayer((ModelRegistry.POLICE_BOX_DOOR))); - phoneBoothDoorModel = new PhoneBoothDoorModel(context.bakeLayer((ModelRegistry.PHONE_BOOTH_DOOR))); - mysticDoorModel = new MysticDoorModel(context.bakeLayer((ModelRegistry.MYSTIC_DOOR))); - drifterModel = new DrifterDoorModel(context.bakeLayer((ModelRegistry.DRIFTER_DOOR))); - presentModel = new PresentDoorModel(context.bakeLayer((ModelRegistry.PRESENT_DOOR))); - vendingModel = new VendingMachineDoorModel(context.bakeLayer((ModelRegistry.VENDING_DOOR))); - briefcaseModel = new BriefcaseDoorModel(context.bakeLayer((ModelRegistry.BRIEFCASE_DOOR))); - groeningModel = new GroeningDoorModel(context.bakeLayer((ModelRegistry.GROENING_DOOR))); - bigBenModel = new BigBenDoorModel(context.bakeLayer((ModelRegistry.BIG_BEN_DOOR))); - nukaModel = new NukaDoorModel(context.bakeLayer((ModelRegistry.NUKA_DOOR))); - growthModel = new GrowthDoorModel(context.bakeLayer((ModelRegistry.GROWTH_DOOR))); - portalooModel = new PortalooDoorModel(context.bakeLayer((ModelRegistry.PORTALOO_DOOR))); - pagodaModel = new PagodaDoorModel(context.bakeLayer((ModelRegistry.PAGODA_DOOR))); - - DOOR_MODELS.put(ShellTheme.FACTORY.getId(), factoryDoorModel); - DOOR_MODELS.put(ShellTheme.POLICE_BOX.getId(), policeBoxModel); - DOOR_MODELS.put(ShellTheme.PHONE_BOOTH.getId(), phoneBoothDoorModel); - DOOR_MODELS.put(ShellTheme.MYSTIC.getId(), mysticDoorModel); - DOOR_MODELS.put(ShellTheme.DRIFTER.getId(), drifterModel); - DOOR_MODELS.put(ShellTheme.PRESENT.getId(), presentModel); - DOOR_MODELS.put(ShellTheme.VENDING.getId(), vendingModel); - DOOR_MODELS.put(ShellTheme.BRIEFCASE.getId(), briefcaseModel); - DOOR_MODELS.put(ShellTheme.GROENING.getId(), groeningModel); - DOOR_MODELS.put(ShellTheme.BIG_BEN.getId(), bigBenModel); - DOOR_MODELS.put(ShellTheme.NUKA.getId(), nukaModel); - DOOR_MODELS.put(ShellTheme.GROWTH.getId(), growthModel); - DOOR_MODELS.put(ShellTheme.PORTALOO.getId(), portalooModel); - DOOR_MODELS.put(ShellTheme.PAGODA.getId(), pagodaModel); - } + @Override public void render(GlobalDoorBlockEntity blockEntity, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource, int packedLight, int packedOverlay) { poseStack.pushPose(); @@ -81,8 +38,7 @@ public void render(GlobalDoorBlockEntity blockEntity, float partialTick, PoseSta // Render slightly off the wall to prevent z-fighting. poseStack.translate(0, 0, -0.01); - - currentModel = DOOR_MODELS.get(theme); + currentModel = ShellModelCollection.getInstance().getShellEntry(theme).getShellDoorModel(); if(theme == ShellTheme.POLICE_BOX.getId()){ poseStack.scale(1.05f, 1.05f, 1.05f); @@ -90,11 +46,8 @@ public void render(GlobalDoorBlockEntity blockEntity, float partialTick, PoseSta } - TardisClientData reactions = TardisClientData.getInstance(blockEntity.getLevel().dimension()); - ShellPattern shellPattern = reactions.shellPattern(); - - currentModel.setDoorOpen(isOpen); - currentModel.renderToBuffer(poseStack, bufferSource.getBuffer(RenderType.entityTranslucent(currentModel.texture(shellPattern, false))), packedLight, OverlayTexture.NO_OVERLAY, 1f, 1f, 1f, 1f); + currentModel.setDoorPosition(isOpen); + currentModel.renderInteriorDoor(blockEntity, isOpen, true, poseStack, bufferSource.getBuffer(RenderType.entityTranslucent(currentModel.getInteriorDoorTexture(blockEntity))), packedLight, OverlayTexture.NO_OVERLAY, 1f, 1f, 1f, 1f); poseStack.popPose(); } diff --git a/common/src/main/java/whocraft/tardis_refined/client/renderer/blockentity/life/ArsEggRenderer.java b/common/src/main/java/whocraft/tardis_refined/client/renderer/blockentity/life/ArsEggRenderer.java index f998afdd6..6157a8d62 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/renderer/blockentity/life/ArsEggRenderer.java +++ b/common/src/main/java/whocraft/tardis_refined/client/renderer/blockentity/life/ArsEggRenderer.java @@ -2,17 +2,25 @@ import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Axis; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.geom.ModelPart; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; import net.minecraft.client.renderer.texture.OverlayTexture; import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.level.block.state.BlockState; import whocraft.tardis_refined.TardisRefined; import whocraft.tardis_refined.client.ModelRegistry; +import whocraft.tardis_refined.client.TardisClientData; import whocraft.tardis_refined.client.model.blockentity.life.ArsEggModel; +import whocraft.tardis_refined.common.block.life.ArsEggBlock; import whocraft.tardis_refined.common.blockentity.life.ArsEggBlockEntity; +import static whocraft.tardis_refined.client.model.blockentity.life.ArsEggModel.CRASHING; +import static whocraft.tardis_refined.client.model.blockentity.life.ArsEggModel.SWINGING; + public class ArsEggRenderer implements BlockEntityRenderer, BlockEntityRendererProvider { private final ArsEggModel arsEggModel; @@ -23,18 +31,41 @@ public ArsEggRenderer(BlockEntityRendererProvider.Context context) { this.arsEggModel = new ArsEggModel(context.bakeLayer(ModelRegistry.ARS_EGG)); } - @Override public void render(ArsEggBlockEntity blockEntity, float f, PoseStack poseStack, MultiBufferSource multiBufferSource, int i, int j) { poseStack.pushPose(); poseStack.translate(0.5F, 1.475F, 0.5F); + poseStack.translate(0, 0.3, 0); + + BlockState blockState = blockEntity.getBlockState(); + + if(!blockState.getValue(ArsEggBlock.HANGING)){ + poseStack.translate(0, -0.3, 0); + } + poseStack.mulPose(Axis.ZP.rotationDegrees(180F)); - arsEggModel.renderToBuffer(poseStack, multiBufferSource.getBuffer(RenderType.entityTranslucent(arsEggTexture)), + arsEggModel.root().getAllParts().forEach(ModelPart::resetPose); + + + if(!blockEntity.getLiveliness().isStarted()) { + blockEntity.getLiveliness().start(12); + } + + if(blockState.getValue(ArsEggBlock.HANGING)){ + TardisClientData tardisClientData = TardisClientData.getInstance(Minecraft.getInstance().level.dimension()); + boolean crashingOrDanger = tardisClientData.isCrashing() || tardisClientData.isInDangerZone(); + int animationCounter = Minecraft.getInstance().player.tickCount; + arsEggModel.doAnimation(blockEntity.getLiveliness(), crashingOrDanger ? CRASHING : SWINGING, animationCounter); + } + + arsEggModel.renderToBuffer(blockEntity, poseStack, multiBufferSource.getBuffer(RenderType.entityTranslucent(arsEggTexture)), i, OverlayTexture.NO_OVERLAY, 1f, 1f, 1f, 1f); - arsEggModel.renderToBuffer(poseStack, multiBufferSource.getBuffer(RenderType.eyes(arsEggTextureEmissive)), - i, OverlayTexture.NO_OVERLAY, 1f, 1f, 1f, 0.1f); + if(blockState.getValue(ArsEggBlock.ALIVE)) { + arsEggModel.renderToBuffer(blockEntity, poseStack, multiBufferSource.getBuffer(RenderType.entityTranslucentEmissive(arsEggTextureEmissive)), + i, OverlayTexture.NO_OVERLAY, 1f, 1f, 1f, 1F); + } poseStack.popPose(); } diff --git a/common/src/main/java/whocraft/tardis_refined/client/renderer/blockentity/shell/GlobalShellRenderer.java b/common/src/main/java/whocraft/tardis_refined/client/renderer/blockentity/shell/GlobalShellRenderer.java index 8bb35dbc9..ecc3e5acc 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/renderer/blockentity/shell/GlobalShellRenderer.java +++ b/common/src/main/java/whocraft/tardis_refined/client/renderer/blockentity/shell/GlobalShellRenderer.java @@ -7,20 +7,14 @@ import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; import net.minecraft.client.renderer.texture.OverlayTexture; -import net.minecraft.core.Registry; -import net.minecraft.core.registries.Registries; -import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.Vec3; -import whocraft.tardis_refined.TardisRefined; -import whocraft.tardis_refined.client.TardisClientData; import whocraft.tardis_refined.client.model.blockentity.shell.ShellModelCollection; import whocraft.tardis_refined.common.block.shell.GlobalShellBlock; import whocraft.tardis_refined.common.block.shell.RootedShellBlock; import whocraft.tardis_refined.common.block.shell.ShellBaseBlock; import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; -import whocraft.tardis_refined.common.tardis.themes.ShellTheme; import whocraft.tardis_refined.patterns.ShellPattern; public class GlobalShellRenderer implements BlockEntityRenderer, BlockEntityRendererProvider { @@ -51,20 +45,19 @@ public void render(GlobalShellBlockEntity blockEntity, float partialTick, PoseSt } } - var currentModel = ShellModelCollection.getInstance().getShellModel(theme); - TardisClientData reactions = TardisClientData.getInstance(blockEntity.getTardisId()); - ShellPattern pattern = reactions.shellPattern(); + var currentModel = ShellModelCollection.getInstance().getShellEntry(theme).getShellModel(); + ShellPattern pattern = blockEntity.pattern(); - currentModel.renderShell(blockEntity, isOpen, true, poseStack, bufferSource.getBuffer(RenderType.entityTranslucent(currentModel.texture(pattern, false))), packedLight, OverlayTexture.NO_OVERLAY, 1f, 1f, 1f, 1f); + currentModel.renderShell(blockEntity, isOpen, true, poseStack, bufferSource.getBuffer(RenderType.entityTranslucent(currentModel.getShellTexture(pattern, false))), packedLight, OverlayTexture.NO_OVERLAY, 1f, 1f, 1f, 1f); /*Emmissive*/ Boolean isRegenerating = blockstate.getValue(ShellBaseBlock.REGEN); if (pattern.exteriorDoorTexture().emissive()) { - currentModel.renderShell(blockEntity, isOpen, false, poseStack, bufferSource.getBuffer(RenderType.entityTranslucentEmissive(currentModel.texture(pattern, true))), 15728640, OverlayTexture.NO_OVERLAY, 1f, 1f, 1f, (isRegenerating) ? sine : 1f); + currentModel.renderShell(blockEntity, isOpen, false, poseStack, bufferSource.getBuffer(RenderType.entityTranslucentEmissive(currentModel.getShellTexture(pattern, true))), 15728640, OverlayTexture.NO_OVERLAY, 1f, 1f, 1f, (isRegenerating) ? sine : 1f); } else { if (isRegenerating) { - currentModel.renderShell(blockEntity, isOpen, false, poseStack, bufferSource.getBuffer(RenderType.entityTranslucentEmissive(currentModel.texture(pattern, false))), 15728640, OverlayTexture.NO_OVERLAY, 1f, 1f, 1f, sine); + currentModel.renderShell(blockEntity, isOpen, false, poseStack, bufferSource.getBuffer(RenderType.entityTranslucentEmissive(currentModel.getShellTexture(pattern, false))), 15728640, OverlayTexture.NO_OVERLAY, 1f, 1f, 1f, sine); } } diff --git a/common/src/main/java/whocraft/tardis_refined/client/screen/selections/ShellSelectionScreen.java b/common/src/main/java/whocraft/tardis_refined/client/screen/selections/ShellSelectionScreen.java index 312e42f0e..a9fc7ac24 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/screen/selections/ShellSelectionScreen.java +++ b/common/src/main/java/whocraft/tardis_refined/client/screen/selections/ShellSelectionScreen.java @@ -12,26 +12,30 @@ import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.client.renderer.GameRenderer; import net.minecraft.client.renderer.texture.OverlayTexture; +import net.minecraft.core.BlockPos; import net.minecraft.core.Holder; +import net.minecraft.core.registries.Registries; import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; -import net.minecraft.server.packs.resources.Resource; import net.minecraft.util.RandomSource; +import net.minecraft.world.level.Level; import whocraft.tardis_refined.TardisRefined; import whocraft.tardis_refined.client.TardisClientData; import whocraft.tardis_refined.client.model.blockentity.shell.ShellModel; import whocraft.tardis_refined.client.model.blockentity.shell.ShellModelCollection; import whocraft.tardis_refined.client.screen.components.GenericMonitorSelectionList; import whocraft.tardis_refined.client.screen.components.SelectionListEntry; +import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; import whocraft.tardis_refined.common.network.messages.ChangeShellMessage; import whocraft.tardis_refined.common.tardis.themes.ShellTheme; import whocraft.tardis_refined.constants.ModMessages; import whocraft.tardis_refined.patterns.ShellPattern; -import whocraft.tardis_refined.patterns.ShellPatternCollection; import whocraft.tardis_refined.patterns.ShellPatterns; +import whocraft.tardis_refined.registry.BlockRegistry; import java.util.List; -import java.util.Set; +import java.util.UUID; public class ShellSelectionScreen extends SelectionScreen { @@ -49,10 +53,21 @@ public class ShellSelectionScreen extends SelectionScreen { private List patternCollection; private Button patternButton; + public static GlobalShellBlockEntity globalShellBlockEntity; public ShellSelectionScreen() { super(Component.translatable(ModMessages.UI_SHELL_SELECTION)); this.themeList = ShellTheme.SHELL_THEME_REGISTRY.keySet().stream().toList(); + generateDummyGlobalShell(); + + } + + public static void generateDummyGlobalShell() { + globalShellBlockEntity = new GlobalShellBlockEntity(BlockPos.ZERO, BlockRegistry.GLOBAL_SHELL_BLOCK.get().defaultBlockState()); + assert Minecraft.getInstance().level != null; + globalShellBlockEntity.setLevel(Minecraft.getInstance().level); + ResourceKey generatedLevelKey = ResourceKey.create(Registries.DIMENSION, new ResourceLocation(TardisRefined.MODID, UUID.randomUUID().toString())); + globalShellBlockEntity.setTardisId(generatedLevelKey); } @Override @@ -121,6 +136,7 @@ public void render(GuiGraphics guiGraphics, int i, int j, float f) { /*Model*/ renderShell(guiGraphics, width / 2- 75, height / 2 - 20, 25F); + //renderShell(guiGraphics, width / 2, height / 2, 25F); double alpha = (100.0D - this.age * 3.0D) / 100.0D; @@ -135,21 +151,22 @@ public void render(GuiGraphics guiGraphics, int i, int j, float f) { @Override public void renderBackground(GuiGraphics guiGraphics, int i, int j, float f) { - // super.renderBackground(guiGraphics, i, j, f); + // super.renderBackground(guiGraphics, i, j, f); } private void renderShell(GuiGraphics guiGraphics, int x, int y, float scale) { - ShellModel model = ShellModelCollection.getInstance().getShellModel(this.currentShellTheme); - model.setDoorOpen(false); + ShellModel model = ShellModelCollection.getInstance().getShellEntry(this.currentShellTheme).getShellModel(); + model.setDoorPosition(false); Lighting.setupForEntityInInventory(); PoseStack pose = guiGraphics.pose(); pose.pushPose(); pose.translate((float) x, y, 100.0F); pose.scale(-scale, scale, scale); pose.mulPose(Axis.XP.rotationDegrees(-15F)); - pose.mulPose(Axis.YP.rotationDegrees(System.currentTimeMillis() % 5400L / 15L)); - VertexConsumer vertexConsumer = guiGraphics.bufferSource().getBuffer(model.renderType(model.texture(pattern, false))); - model.renderToBuffer(pose, vertexConsumer, 15728880, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); + pose.mulPose(Axis.YP.rotationDegrees((float) (System.currentTimeMillis() % 5400L) / 15L)); + + VertexConsumer vertexConsumer = guiGraphics.bufferSource().getBuffer(model.renderType(model.getShellTexture(pattern, false))); + model.renderShell(globalShellBlockEntity, false, false, pose, vertexConsumer, 15728880, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); guiGraphics.flush(); pose.popPose(); Lighting.setupFor3DItems(); diff --git a/common/src/main/java/whocraft/tardis_refined/client/screen/upgrades/BuyUpgradeScreen.java b/common/src/main/java/whocraft/tardis_refined/client/screen/upgrades/BuyUpgradeScreen.java index 98d9bb57b..1532c4e7e 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/screen/upgrades/BuyUpgradeScreen.java +++ b/common/src/main/java/whocraft/tardis_refined/client/screen/upgrades/BuyUpgradeScreen.java @@ -14,6 +14,7 @@ import whocraft.tardis_refined.common.capability.upgrades.Upgrade; import whocraft.tardis_refined.common.network.messages.upgrades.C2SDisplayUpgradeScreen; import whocraft.tardis_refined.common.network.messages.upgrades.UnlockUpgradeMessage; +import whocraft.tardis_refined.constants.ModMessages; import java.util.List; import java.util.Objects; @@ -32,7 +33,7 @@ public BuyUpgradeScreen(Upgrade upgrade, boolean available, UpgradesScreen paren this.upgrade = upgrade; this.available = available; this.parentScreen = parentScreen; - this.text = Component.translatable("gui.tardis_refined.buy_ability"); + this.text = Component.translatable(ModMessages.UI_UPGRADES_BUY); } @Override @@ -67,7 +68,7 @@ public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partia for (int k = 0; k < lines.size(); k++) { FormattedCharSequence text = lines.get(k); int width = this.font.width(text); - guiGraphics.drawString(font, text, (int) (guiLeft + GUI_WIDTH / 2F - width / 2F), guiTop + 9 + k * 10, ChatFormatting.GOLD.getColor(), false); + guiGraphics.drawString(font, text, (int) (guiLeft + GUI_WIDTH / 2F - width / 2F), guiTop + 9 + k * 10, ChatFormatting.BLACK.getColor(), false); } super.render(guiGraphics, mouseX, mouseY, partialTick); diff --git a/common/src/main/java/whocraft/tardis_refined/client/screen/upgrades/UpgradeTab.java b/common/src/main/java/whocraft/tardis_refined/client/screen/upgrades/UpgradeTab.java index 4b998faaa..cc00b2e60 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/screen/upgrades/UpgradeTab.java +++ b/common/src/main/java/whocraft/tardis_refined/client/screen/upgrades/UpgradeTab.java @@ -48,18 +48,18 @@ public UpgradeTab(Minecraft minecraft, UpgradesScreen UpgradesScreen, UpgradeTab this.index = i; this.upgradeHandler = powerHolder; this.icon = new ItemStack(Items.COOKED_PORKCHOP); - this.title = Component.literal("its shy"); - this.populate(); + this.title = Component.literal(""); + this.populate(powerHolder); } - public void populate() { + public void populate(UpgradeHandler upgradeHandlerClient) { this.entries.clear(); this.connections.clear(); List root = new LinkedList<>(); // Create entry for each ability for (Upgrade upgrade : Upgrades.UPGRADE_REGISTRY.stream().toList()) { - var widget = new UpgradeWidget(this, this.minecraft, this.upgradeHandler, upgrade).setPosition(0, 0); + var widget = new UpgradeWidget(this, this.minecraft, upgradeHandlerClient, upgrade).setPosition(0, 0); this.entries.add(widget); var pos = upgrade.getScreenPosition(); diff --git a/common/src/main/java/whocraft/tardis_refined/client/screen/upgrades/UpgradeWidget.java b/common/src/main/java/whocraft/tardis_refined/client/screen/upgrades/UpgradeWidget.java index 1deff2bc4..2df5d34a0 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/screen/upgrades/UpgradeWidget.java +++ b/common/src/main/java/whocraft/tardis_refined/client/screen/upgrades/UpgradeWidget.java @@ -2,7 +2,6 @@ import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.ChatFormatting; -import net.minecraft.advancements.FrameType; import net.minecraft.client.Minecraft; import net.minecraft.client.StringSplitter; import net.minecraft.client.gui.Font; @@ -16,8 +15,6 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.util.FormattedCharSequence; import net.minecraft.util.Mth; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; import whocraft.tardis_refined.common.capability.upgrades.Upgrade; import whocraft.tardis_refined.common.capability.upgrades.UpgradeHandler; @@ -142,13 +139,15 @@ public void drawDisplayIcon(Minecraft mc, GuiGraphics guiGraphics, int x, int y) guiGraphics.renderFakeItem(this.upgradeEntry.getIcon(), x, y); } else { RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); - guiGraphics.blit(UpgradesScreen.WIDGETS, x, y, 90, 133, 16, 16); + + //Display Lock6, + guiGraphics.blitSprite(UpgradesScreen.LOCKED, x - 5, y - 5, 26, 26); } } public void drawIcon(Minecraft mc, GuiGraphics guiGraphics, int x, int y) { RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); - guiGraphics.blit(UpgradesScreen.WIDGETS, x - 13, y - 13, 0, this.upgradeEntry.isUnlocked(upgradeHandler) ? 128 : 154, 26, 26); + guiGraphics.blitSprite(UpgradesScreen.getFrame(upgradeEntry.getUpgradeType(), this.upgradeEntry.isUnlocked(upgradeHandler)), x - 13, y - 13, 26, 26); this.drawDisplayIcon(mc, guiGraphics, x - 8, y - 8); } @@ -213,9 +212,9 @@ public void drawHover(GuiGraphics guiGraphics, int i, int j, float f, int k, int } } - guiGraphics.blitSprite(advancementWidgetType.boxSprite(), 200, 26, 0, 0, q, p, n, 26); - guiGraphics.blitSprite(advancementWidgetType2.boxSprite(), 200, 26, 200 - o, 0, q + n, p, o, 26); - guiGraphics.blitSprite(advancementWidgetType3.frameSprite(FrameType.TASK), i + this.x + 3, j + this.y, 26, 26); + guiGraphics.blitSprite(UpgradesScreen.getBox(upgradeEntry.isUnlocked(upgradeHandler)), 200, 26, 0, 0, q, p, n, 26); + guiGraphics.blitSprite(UpgradesScreen.getBox(upgradeEntry.isUnlocked(upgradeHandler)), 200, 26, 200 - o, 0, q + n, p, o, 26); + guiGraphics.blitSprite(UpgradesScreen.getFrame(upgradeEntry.getUpgradeType(), upgradeEntry.isUnlocked(upgradeHandler)), i + this.x + 3, j + this.y, 26, 26); if (bl) { guiGraphics.drawString(this.minecraft.font, this.title, q + 5, j + this.y + 9, -1); if (component != null) { diff --git a/common/src/main/java/whocraft/tardis_refined/client/screen/upgrades/UpgradesScreen.java b/common/src/main/java/whocraft/tardis_refined/client/screen/upgrades/UpgradesScreen.java index f73089a72..43e5d2b85 100644 --- a/common/src/main/java/whocraft/tardis_refined/client/screen/upgrades/UpgradesScreen.java +++ b/common/src/main/java/whocraft/tardis_refined/client/screen/upgrades/UpgradesScreen.java @@ -12,6 +12,7 @@ import whocraft.tardis_refined.TardisRefined; import whocraft.tardis_refined.common.capability.upgrades.Upgrade; import whocraft.tardis_refined.common.capability.upgrades.UpgradeHandler; +import whocraft.tardis_refined.constants.ModMessages; import java.util.ArrayList; import java.util.List; @@ -20,16 +21,24 @@ public class UpgradesScreen extends Screen { public static final ResourceLocation WINDOW = new ResourceLocation(TardisRefined.MODID, "textures/gui/upgrades/window.png"); public static final ResourceLocation TABS = new ResourceLocation(TardisRefined.MODID, "textures/gui/upgrades/tabs.png"); - public static final ResourceLocation WIDGETS = new ResourceLocation(TardisRefined.MODID, "textures/gui/upgrades/widgets.png"); public static final ResourceLocation BACKDROP = new ResourceLocation(TardisRefined.MODID, "textures/gui/upgrades/upgrades.png"); + public static final ResourceLocation MAIN_UPGRADE_LOCKED = new ResourceLocation(TardisRefined.MODID, "upgrades/gallifreyan_frame_unobtained"); + public static final ResourceLocation SUB_UPGRADE_LOCKED = new ResourceLocation(TardisRefined.MODID, "upgrades/upgrade_frame_unobtained"); + public static final ResourceLocation SUB_UPGRADE = new ResourceLocation(TardisRefined.MODID, "upgrades/upgrade_frame_obtained"); + public static final ResourceLocation MAIN_UPGRADE = new ResourceLocation(TardisRefined.MODID, "upgrades/gallifreyan_frame_obtained"); + public static final ResourceLocation LOCKED = new ResourceLocation(TardisRefined.MODID, "upgrades/lock"); + public static final ResourceLocation UNOBTAINED_BOX = new ResourceLocation(TardisRefined.MODID, "upgrades/box_unobtained"); + public static final ResourceLocation OBTAINED_BOX = new ResourceLocation(TardisRefined.MODID, "upgrades/box_obtained"); + + public static final int WINDOW_WIDTH = 256; public static final int WINDOW_HEIGHT = 173; private static final int WINDOW_INSIDE_X = 10; private static final int WINDOW_INSIDE_Y = 18; public static final int WINDOW_INSIDE_WIDTH = 234 - 10; public static final int WINDOW_INSIDE_HEIGHT = 169 - 46; - private static final Component TITLE = Component.translatable("gui.tardis_refined.upgrades"); + private static final Component TITLE = Component.translatable(ModMessages.UI_UPGRADES); private final List tabs = new ArrayList<>(); private final UpgradeHandler upgradeHandler; @Nullable @@ -231,4 +240,17 @@ public boolean isOverOverlayScreen(double mouseX, double mouseY) { } + public static ResourceLocation getFrame(Upgrade.UpgradeType upgradeType, boolean isUnlocked) { + if (isUnlocked) { + return upgradeType == Upgrade.UpgradeType.MAIN_UPGRADE ? MAIN_UPGRADE : SUB_UPGRADE; + } + return upgradeType == Upgrade.UpgradeType.MAIN_UPGRADE ? MAIN_UPGRADE_LOCKED : SUB_UPGRADE_LOCKED; + } + + public static ResourceLocation getBox(boolean isUnlocked) { + return isUnlocked ? OBTAINED_BOX : UNOBTAINED_BOX; + } + + + } diff --git a/common/src/main/java/whocraft/tardis_refined/client/sounds/LoopingSound.java b/common/src/main/java/whocraft/tardis_refined/client/sounds/LoopingSound.java new file mode 100644 index 000000000..599d98f3b --- /dev/null +++ b/common/src/main/java/whocraft/tardis_refined/client/sounds/LoopingSound.java @@ -0,0 +1,108 @@ +package whocraft.tardis_refined.client.sounds; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.player.LocalPlayer; +import net.minecraft.client.resources.sounds.AbstractTickableSoundInstance; +import net.minecraft.client.resources.sounds.SoundInstance; +import net.minecraft.client.sounds.SoundManager; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.sounds.SoundSource; +import net.minecraft.world.phys.Vec3; +import org.jetbrains.annotations.NotNull; +import whocraft.tardis_refined.client.TardisClientData; +import whocraft.tardis_refined.common.util.TardisHelper; +import whocraft.tardis_refined.registry.DimensionTypes; +import whocraft.tardis_refined.registry.SoundRegistry; + +public class LoopingSound extends AbstractTickableSoundInstance { + + public static LoopingSound ARS_HUMMING = null; + public static LoopingSound FLIGHT_LOOP = null; + public static LoopingSound HUM_TEST = null; + + public LoopingSound(@NotNull SoundEvent soundEvent, SoundSource soundSource) { + super(soundEvent, soundSource, SoundInstance.createUnseededRandom()); + attenuation = Attenuation.NONE; + looping = true; + delay = 0; + volume = 0.5f; + } + + public void setVolume(float volume) { + this.volume = volume; + } + + @Override + public float getVolume() { + return volume; + } + + public void setPitch(float pitch) { + this.pitch = pitch; + } + + @Override + public float getPitch() { + return pitch; + } + + public void setLocation(Vec3 location) { + x = location.x; + y = location.y; + z = location.z; + } + + public void stopSound() { + Minecraft.getInstance() + .getSoundManager() + .stop(this); + } + + @Override + public void tick() { + LocalPlayer player = Minecraft.getInstance().player; + if(player == null) return; + + TardisClientData tardisClientData = TardisClientData.getInstance(Minecraft.getInstance().level.dimension()); + + if(this == LoopingSound.ARS_HUMMING) { + Vec3 playerVec = player.position(); + double distance = playerVec.distanceTo(new Vec3(x, y, z)); + double maxDistance = 11.0; + double fadeFactor = Math.max(1.0 - distance / maxDistance, 0.0); + float defaultVolume = 1.0f; + volume = (float) (fadeFactor * defaultVolume); + } + + if(this == LoopingSound.FLIGHT_LOOP){ + if (tardisClientData.isFlying() && !tardisClientData.isCrashing()) { + LoopingSound.FLIGHT_LOOP.setLocation(player.position()); + volume = 0.5F; + } else { + volume = 0F; + } + } + + if(this == LoopingSound.HUM_TEST){ + delay = 40; + volume = TardisHelper.isInArsArea(player.blockPosition()) ? 0 : 0.2F; + if(DimensionTypes.TARDIS == player.level().dimensionTypeId()){ + volume = 0.2F; + } else { + volume = 0.0F; + } + } + } + + + public static boolean shouldMinecraftMusicStop(SoundManager soundManager){ + return soundManager.isActive(FLIGHT_LOOP) || soundManager.isActive(ARS_HUMMING) || soundManager.isActive(HUM_TEST); + } + + public static void setupSounds(){ + LoopingSound.ARS_HUMMING = new LoopingSound(SoundRegistry.ARS_HUM.get(), SoundSource.AMBIENT); + LoopingSound.FLIGHT_LOOP = new LoopingSound(SoundRegistry.TARDIS_SINGLE_FLY.get(), SoundSource.AMBIENT); + LoopingSound.HUM_TEST = new LoopingSound(SoundRegistry.TEST_HUM.get(), SoundSource.AMBIENT); + } + +} diff --git a/common/src/main/java/whocraft/tardis_refined/command/TardisRefinedCommand.java b/common/src/main/java/whocraft/tardis_refined/command/TardisRefinedCommand.java index 622548f5e..4fd1cd489 100644 --- a/common/src/main/java/whocraft/tardis_refined/command/TardisRefinedCommand.java +++ b/common/src/main/java/whocraft/tardis_refined/command/TardisRefinedCommand.java @@ -4,8 +4,10 @@ import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.Commands; import whocraft.tardis_refined.TardisRefined; -import whocraft.tardis_refined.command.sub.export.ExportDesktopCommand; import whocraft.tardis_refined.command.sub.InteriorCommand; +import whocraft.tardis_refined.command.sub.LevelCommand; +import whocraft.tardis_refined.command.sub.UpgradesCommand; +import whocraft.tardis_refined.command.sub.export.ExportDesktopCommand; import whocraft.tardis_refined.common.util.Platform; public class TardisRefinedCommand { @@ -13,10 +15,9 @@ public class TardisRefinedCommand { public static void register(CommandDispatcher dispatcher) { dispatcher.register(Commands.literal(TardisRefined.MODID).requires(commandSource -> commandSource.hasPermission(Platform.getServer().getOperatorUserPermissionLevel())) .then(InteriorCommand.register(dispatcher)) + .then(UpgradesCommand.register(dispatcher)) .then(Commands.literal("data").then(Commands.literal("export").then(ExportDesktopCommand.register(dispatcher)))) - - ); - + .then(Commands.literal("level").then(LevelCommand.register(dispatcher)))); } } diff --git a/common/src/main/java/whocraft/tardis_refined/command/arguments/UpgradeArgumentType.java b/common/src/main/java/whocraft/tardis_refined/command/arguments/UpgradeArgumentType.java new file mode 100644 index 000000000..c35e4147b --- /dev/null +++ b/common/src/main/java/whocraft/tardis_refined/command/arguments/UpgradeArgumentType.java @@ -0,0 +1,45 @@ +package whocraft.tardis_refined.command.arguments; + +import com.mojang.brigadier.StringReader; +import com.mojang.brigadier.arguments.ArgumentType; +import com.mojang.brigadier.context.CommandContext; +import com.mojang.brigadier.exceptions.CommandSyntaxException; +import com.mojang.brigadier.exceptions.DynamicCommandExceptionType; +import com.mojang.brigadier.suggestion.Suggestions; +import com.mojang.brigadier.suggestion.SuggestionsBuilder; +import net.minecraft.commands.SharedSuggestionProvider; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import whocraft.tardis_refined.common.capability.upgrades.Upgrade; +import whocraft.tardis_refined.common.capability.upgrades.Upgrades; + +import java.util.Collection; +import java.util.concurrent.CompletableFuture; + +public class UpgradeArgumentType implements ArgumentType { + + public static final DynamicCommandExceptionType INVALID_UPGRADE_EXCEPTION = new DynamicCommandExceptionType((UPGRADE) -> Component.translatable("argument.regeneration.upgrade.invalid", UPGRADE)); + + public static UpgradeArgumentType upgradeArgumentType() { + return new UpgradeArgumentType(); + } + + @Override + public Upgrade parse(StringReader reader) throws CommandSyntaxException { + ResourceLocation location = ResourceLocation.read(reader); + Upgrade upgrade = Upgrades.UPGRADE_DEFERRED_REGISTRY.getRegistry().get(location); + if (upgrade != null) { + return upgrade; + } + throw INVALID_UPGRADE_EXCEPTION.create(location); } + + @Override + public CompletableFuture listSuggestions(CommandContext context, SuggestionsBuilder builder) { + return SharedSuggestionProvider.suggestResource(Upgrades.UPGRADE_REGISTRY.keySet(), builder); + } + + @Override + public Collection getExamples() { + return ArgumentType.super.getExamples(); + } +} \ No newline at end of file diff --git a/common/src/main/java/whocraft/tardis_refined/command/sub/LevelCommand.java b/common/src/main/java/whocraft/tardis_refined/command/sub/LevelCommand.java new file mode 100644 index 000000000..62a1b481d --- /dev/null +++ b/common/src/main/java/whocraft/tardis_refined/command/sub/LevelCommand.java @@ -0,0 +1,102 @@ +package whocraft.tardis_refined.command.sub; + +import com.mojang.brigadier.Command; +import com.mojang.brigadier.CommandDispatcher; +import com.mojang.brigadier.arguments.IntegerArgumentType; +import com.mojang.brigadier.builder.ArgumentBuilder; +import com.mojang.brigadier.context.CommandContext; +import com.mojang.brigadier.exceptions.CommandSyntaxException; +import net.minecraft.commands.CommandSourceStack; +import net.minecraft.commands.Commands; +import net.minecraft.commands.arguments.DimensionArgument; +import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerLevel; +import whocraft.tardis_refined.common.capability.TardisLevelOperator; +import whocraft.tardis_refined.common.capability.upgrades.UpgradeHandler; +import whocraft.tardis_refined.common.util.CommandHelper; + +public class LevelCommand { + + public static ArgumentBuilder register(CommandDispatcher dispatcher) { + return Commands.argument("dimension", DimensionArgument.dimension()).suggests(CommandHelper.SUGGEST_TARDISES) + .then(Commands.literal("get-points").executes(LevelCommand::getDimensionPoints)) + .then(Commands.literal("set-points").then(Commands.argument("points", IntegerArgumentType.integer()).executes(LevelCommand::setDimensionPoints))) + .then(Commands.literal("add-points").then(Commands.argument("points", IntegerArgumentType.integer()).executes(LevelCommand::addDimensionPoints))) + .then(Commands.literal("get-xp").executes(LevelCommand::getDimensionXp)) + .then(Commands.literal("set-xp").then(Commands.argument("xp", IntegerArgumentType.integer()).executes(LevelCommand::setDimensionXp))) + .then(Commands.literal("add-xp").then(Commands.argument("xp", IntegerArgumentType.integer()).executes(LevelCommand::addDimensionXp))); + + } + + private static int getDimensionPoints(CommandContext context) throws CommandSyntaxException { + ServerLevel dimension = DimensionArgument.getDimension(context, "dimension"); + + TardisLevelOperator.get(dimension).ifPresent(tardisLevelOperator -> { + int points = tardisLevelOperator.getUpgradeHandler().getUpgradePoints(); + context.getSource().sendSystemMessage(Component.literal("Tardis: " + dimension.toString().split(":")[1] + " levels: " + points)); + }); + + return Command.SINGLE_SUCCESS; + } + + private static int setDimensionPoints(CommandContext context) throws CommandSyntaxException { + ServerLevel dimension = DimensionArgument.getDimension(context, "dimension"); + int points = IntegerArgumentType.getInteger(context, "points"); + + TardisLevelOperator.get(dimension).ifPresent(tardisLevelOperator -> { + tardisLevelOperator.getUpgradeHandler().setUpgradePoints(points); + context.getSource().sendSystemMessage(Component.literal("Tardis: " + dimension.toString().split(":")[1] + " points set to " + points)); + }); + + return Command.SINGLE_SUCCESS; + } + + private static int addDimensionPoints(CommandContext context) throws CommandSyntaxException { + ServerLevel dimension = DimensionArgument.getDimension(context, "dimension"); + int points = IntegerArgumentType.getInteger(context, "points"); + + TardisLevelOperator.get(dimension).ifPresent(tardisLevelOperator -> { + UpgradeHandler upgradeHandler = tardisLevelOperator.getUpgradeHandler(); + upgradeHandler.setUpgradePoints(upgradeHandler.getUpgradePoints() + points); + context.getSource().sendSystemMessage(Component.literal("Tardis: " + dimension.toString().split(":")[1] + " points set to " + upgradeHandler.getUpgradePoints())); + }); + + return Command.SINGLE_SUCCESS; + } + + private static int addDimensionXp(CommandContext context) throws CommandSyntaxException { + ServerLevel dimension = DimensionArgument.getDimension(context, "dimension"); + int points = IntegerArgumentType.getInteger(context, "points"); + + TardisLevelOperator.get(dimension).ifPresent(tardisLevelOperator -> { + UpgradeHandler upgradeHandler = tardisLevelOperator.getUpgradeHandler(); + upgradeHandler.setUpgradeXP(upgradeHandler.getUpgradeXP() + points); + context.getSource().sendSystemMessage(Component.literal("Tardis: " + dimension.toString().split(":")[1] + " points set to " + upgradeHandler.getUpgradeXP())); + }); + + return Command.SINGLE_SUCCESS; + } + + private static int getDimensionXp(CommandContext context) throws CommandSyntaxException { + ServerLevel dimension = DimensionArgument.getDimension(context, "dimension"); + + TardisLevelOperator.get(dimension).ifPresent(tardisLevelOperator -> { + int xp = tardisLevelOperator.getUpgradeHandler().getUpgradeXP(); + context.getSource().sendSystemMessage(Component.literal("Tardis: " + dimension.toString().split(":")[1] + " xp: " + xp)); + }); + + return Command.SINGLE_SUCCESS; + } + + private static int setDimensionXp(CommandContext context) throws CommandSyntaxException { + ServerLevel dimension = DimensionArgument.getDimension(context, "dimension"); + int points = IntegerArgumentType.getInteger(context, "xp"); + + TardisLevelOperator.get(dimension).ifPresent(tardisLevelOperator -> { + tardisLevelOperator.getUpgradeHandler().setUpgradePoints(points); + context.getSource().sendSystemMessage(Component.literal("Tardis: " + dimension.toString().split(":")[1] + " xp set to " + points)); + }); + + return Command.SINGLE_SUCCESS; + } +} diff --git a/common/src/main/java/whocraft/tardis_refined/command/sub/UpgradesCommand.java b/common/src/main/java/whocraft/tardis_refined/command/sub/UpgradesCommand.java new file mode 100644 index 000000000..450da8364 --- /dev/null +++ b/common/src/main/java/whocraft/tardis_refined/command/sub/UpgradesCommand.java @@ -0,0 +1,55 @@ +package whocraft.tardis_refined.command.sub; + +import com.mojang.brigadier.Command; +import com.mojang.brigadier.CommandDispatcher; +import com.mojang.brigadier.builder.ArgumentBuilder; +import com.mojang.brigadier.context.CommandContext; +import com.mojang.brigadier.exceptions.CommandSyntaxException; +import net.minecraft.commands.CommandSourceStack; +import net.minecraft.commands.Commands; +import net.minecraft.commands.arguments.DimensionArgument; +import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerLevel; +import whocraft.tardis_refined.command.arguments.UpgradeArgumentType; +import whocraft.tardis_refined.common.capability.TardisLevelOperator; +import whocraft.tardis_refined.common.capability.upgrades.Upgrade; +import whocraft.tardis_refined.common.util.CommandHelper; + +public class UpgradesCommand { + + public static ArgumentBuilder register(CommandDispatcher dispatcher) { + return Commands.literal("upgrades") + .then(Commands.literal("lock") + .then(Commands.argument("dimension", DimensionArgument.dimension()).suggests(CommandHelper.SUGGEST_TARDISES) + .then(Commands.argument("upgrade", UpgradeArgumentType.upgradeArgumentType()) + .executes(UpgradesCommand::setUpgradeLocked)))) + .then(Commands.literal("unlock") + .then(Commands.argument("dimension", DimensionArgument.dimension()).suggests(CommandHelper.SUGGEST_TARDISES) + .then(Commands.argument("upgrade", UpgradeArgumentType.upgradeArgumentType()) + .executes(UpgradesCommand::setUpgradeUnlocked)))); + } + + private static int setUpgradeLocked(CommandContext context) throws CommandSyntaxException { + ServerLevel dimension = DimensionArgument.getDimension(context, "dimension"); + Upgrade upgrade = context.getArgument("upgrade", Upgrade.class); + + TardisLevelOperator.get(dimension).ifPresent(tardisLevelOperator -> { + tardisLevelOperator.getUpgradeHandler().lockUpgrade(upgrade); + context.getSource().sendSystemMessage(Component.literal("Tardis: " + dimension.toString().split(":")[1] + " locked " + upgrade.getDisplayName())); + }); + + return Command.SINGLE_SUCCESS; + } + + private static int setUpgradeUnlocked(CommandContext context) throws CommandSyntaxException { + ServerLevel dimension = DimensionArgument.getDimension(context, "dimension"); + Upgrade upgrade = context.getArgument("upgrade", Upgrade.class); + + TardisLevelOperator.get(dimension).ifPresent(tardisLevelOperator -> { + tardisLevelOperator.getUpgradeHandler().unlockUpgrade(upgrade); + context.getSource().sendSystemMessage(Component.literal("Tardis: " + dimension.toString().split(":")[1] + " unlocked " + upgrade.getDisplayName())); + }); + + return Command.SINGLE_SUCCESS; + } +} diff --git a/common/src/main/java/whocraft/tardis_refined/common/block/RootPlantBlock.java b/common/src/main/java/whocraft/tardis_refined/common/block/RootPlantBlock.java index 7debd3a00..535eae0db 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/block/RootPlantBlock.java +++ b/common/src/main/java/whocraft/tardis_refined/common/block/RootPlantBlock.java @@ -1,7 +1,9 @@ package whocraft.tardis_refined.common.block; +import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.particles.ParticleTypes; import net.minecraft.server.level.ServerLevel; import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; @@ -23,6 +25,7 @@ import net.minecraft.world.level.block.state.properties.IntegerProperty; import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.Fluids; +import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; import org.jetbrains.annotations.NotNull; @@ -30,7 +33,7 @@ import whocraft.tardis_refined.common.block.shell.RootedShellBlock; import whocraft.tardis_refined.common.blockentity.shell.RootPlantBlockEntity; import whocraft.tardis_refined.common.capability.TardisLevelOperator; -import whocraft.tardis_refined.common.tardis.manager.TardisFlightEventManager; +import whocraft.tardis_refined.common.util.ClientHelper; import whocraft.tardis_refined.common.util.TardisHelper; import whocraft.tardis_refined.registry.BlockRegistry; import whocraft.tardis_refined.registry.DimensionTypes; @@ -87,12 +90,23 @@ public boolean isRandomlyTicking(BlockState blockState) { return !this.isMaxAge(blockState); } + @Override + public void animateTick(BlockState blockState, Level level, BlockPos blockPos, RandomSource randomSource) { + super.animateTick(blockState, level, blockPos, randomSource); + if (level.getBlockState(blockPos.below()).getBlock() == Blocks.MAGMA_BLOCK) { + ClientHelper.playParticle((ClientLevel) level, ParticleTypes.REVERSE_PORTAL, new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5), 0.0D, 0.1D, 0.0D); + } + } + @Override public void randomTick(BlockState blockState, ServerLevel serverLevel, BlockPos blockPos, RandomSource randomSource) { + int age = this.getAge(blockState); Direction facing = blockState.getValue(FACING); if (age < this.getMaxAge()) { + + if (serverLevel.getBlockState(blockPos.below()).getBlock() == Blocks.MAGMA_BLOCK) { if (randomSource.nextInt(6) == 0) { FluidState fluidState = serverLevel.getFluidState(blockPos); @@ -103,6 +117,15 @@ public void randomTick(BlockState blockState, ServerLevel serverLevel, BlockPos } else { serverLevel.removeBlock(blockPos, waterlogged); //Use removeBlock to allow us to keep any water source blocks since root block is now waterloggable. serverLevel.setBlock(blockPos, this.getStateForAging(age + 1, facing).setValue(WATERLOGGED, waterlogged), 3); + double d = blockState.getShape(serverLevel, blockPos).max(Direction.Axis.Y, 0.5, 0.5) + 0.03125; + + double g = randomSource.nextGaussian() * 0.02; + double h = randomSource.nextGaussian() * 0.02; + double j = randomSource.nextGaussian() * 0.02; + + for (int i = 0; i < 10; ++i) { + serverLevel.sendParticles(ParticleTypes.COMPOSTER, (double)blockPos.getX() + (double)0.13125f + (double)0.7375f * (double)randomSource.nextFloat(), (double)blockPos.getY() + d + (double)randomSource.nextFloat() * (1.0), (double)blockPos.getZ() + (double)0.13125f + (double)0.7375f * (double)randomSource.nextFloat(), 120, g,h,j, 0.005); + } } serverLevel.playSound(null, blockPos, SoundEvents.GROWING_PLANT_CROP, SoundSource.BLOCKS, 1, 1); diff --git a/common/src/main/java/whocraft/tardis_refined/common/block/console/GlobalConsoleBlock.java b/common/src/main/java/whocraft/tardis_refined/common/block/console/GlobalConsoleBlock.java index d328259d4..c39dd9f5d 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/block/console/GlobalConsoleBlock.java +++ b/common/src/main/java/whocraft/tardis_refined/common/block/console/GlobalConsoleBlock.java @@ -30,8 +30,6 @@ import whocraft.tardis_refined.common.capability.TardisLevelOperator; import whocraft.tardis_refined.common.tardis.manager.TardisPilotingManager; import whocraft.tardis_refined.common.util.ClientHelper; -import whocraft.tardis_refined.constants.ResourceConstants; -import whocraft.tardis_refined.patterns.ConsolePattern; import whocraft.tardis_refined.patterns.ConsolePatterns; @@ -137,8 +135,11 @@ public InteractionResult use(BlockState blockState, Level level, BlockPos blockP if (operatorOptional.isPresent()) { var operator = operatorOptional.get(); TardisPilotingManager pilotManager = operator.getPilotingManager(); + if (pilotManager.isOnCooldown()) { pilotManager.endCoolDown(); + + return InteractionResult.CONSUME_PARTIAL; } } diff --git a/common/src/main/java/whocraft/tardis_refined/common/block/device/ConsoleConfigurationBlock.java b/common/src/main/java/whocraft/tardis_refined/common/block/device/ConsoleConfigurationBlock.java index d9ef7ba11..1fac4025e 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/block/device/ConsoleConfigurationBlock.java +++ b/common/src/main/java/whocraft/tardis_refined/common/block/device/ConsoleConfigurationBlock.java @@ -89,6 +89,7 @@ public InteractionResult use(BlockState blockState, Level level, BlockPos blockP return InteractionResult.PASS; } + var offset = blockState.getValue(FACING).getNormal(); BlockPos consolePos = blockPos.offset(offset); BlockState consoleBlock = level.getBlockState(consolePos); diff --git a/common/src/main/java/whocraft/tardis_refined/common/block/door/BulkHeadDoorBlock.java b/common/src/main/java/whocraft/tardis_refined/common/block/door/BulkHeadDoorBlock.java index 3901f49c9..a6b6bbc0d 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/block/door/BulkHeadDoorBlock.java +++ b/common/src/main/java/whocraft/tardis_refined/common/block/door/BulkHeadDoorBlock.java @@ -2,10 +2,14 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelAccessor; +import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.*; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityTicker; @@ -40,8 +44,12 @@ protected void createBlockStateDefinition(StateDefinition.Builder { + BlockEntity block = level.getBlockEntity(blockPos); + AestheticHandler aesthetics = tardisLevelOperator.getAestheticHandler(); + if(block instanceof GlobalDoorBlockEntity globalDoorBlockEntity){ + globalDoorBlockEntity.setShellTheme(aesthetics.getShellTheme()); + globalDoorBlockEntity.setPattern(aesthetics.shellPattern()); + globalDoorBlockEntity.sendUpdates(); + } + }); + } + } + @Override protected void createBlockStateDefinition(StateDefinition.Builder builder) { super.createBlockStateDefinition(builder); diff --git a/common/src/main/java/whocraft/tardis_refined/common/block/life/ArsEggBlock.java b/common/src/main/java/whocraft/tardis_refined/common/block/life/ArsEggBlock.java index cd990288a..a23131e55 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/block/life/ArsEggBlock.java +++ b/common/src/main/java/whocraft/tardis_refined/common/block/life/ArsEggBlock.java @@ -1,24 +1,116 @@ package whocraft.tardis_refined.common.block.life; import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelAccessor; +import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.BaseEntityBlock; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.material.FluidState; +import net.minecraft.world.level.material.Fluids; +import net.minecraft.world.level.pathfinder.PathComputationType; import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.phys.shapes.BooleanOp; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.Shapes; +import net.minecraft.world.phys.shapes.VoxelShape; import org.jetbrains.annotations.Nullable; import whocraft.tardis_refined.common.blockentity.life.ArsEggBlockEntity; import whocraft.tardis_refined.common.capability.TardisLevelOperator; import whocraft.tardis_refined.common.network.messages.upgrades.S2CDisplayUpgradeScreen; +import whocraft.tardis_refined.common.util.TardisHelper; + +import java.util.stream.Stream; public class ArsEggBlock extends BaseEntityBlock { + + public static final BooleanProperty HANGING = BlockStateProperties.HANGING; + public static final BooleanProperty ALIVE = BooleanProperty.create("alive");; + public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + protected static final VoxelShape AABB = Shapes.join(Stream.of( + Block.box(4, 9, 7, 12, 10, 9), + Block.box(4, 9, 7, 12, 10, 9), + Block.box(5, 9, 5, 11, 11, 11), + Block.box(6, 11, 6, 10, 13, 10) + ).reduce((v1, v2) -> Shapes.join(v1, v2, BooleanOp.OR)).get(), Block.box(4, 0, 4, 12, 9, 12), BooleanOp.OR); + + private static final VoxelShape NO_CLAMP_AABB = Block.box(4, 0, 4, 12, 9, 12); + + @Override + public VoxelShape getShape(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos, CollisionContext collisionContext) { + return blockState.getValue(HANGING) ? AABB.move(0,0.3,0) : (blockState.getValue(ALIVE) ? AABB : NO_CLAMP_AABB); + } + + @Override + @Nullable + public BlockState getStateForPlacement(BlockPlaceContext blockPlaceContext) { + FluidState fluidState = blockPlaceContext.getLevel().getFluidState(blockPlaceContext.getClickedPos()); + Direction[] var3 = blockPlaceContext.getNearestLookingDirections(); + + for (Direction direction : var3) { + if (direction.getAxis() == Direction.Axis.Y) { + BlockState blockState = this.defaultBlockState().setValue(HANGING, direction == Direction.UP); + if (blockState.canSurvive(blockPlaceContext.getLevel(), blockPlaceContext.getClickedPos())) { + return blockState.setValue(WATERLOGGED, fluidState.getType() == Fluids.WATER).setValue(ALIVE, TardisHelper.isInArsArea(blockPlaceContext.getClickedPos())); + } + } + } + + return null; + } + public ArsEggBlock(Properties properties) { super(properties); + this.registerDefaultState(this.stateDefinition.any().setValue(HANGING, false).setValue(WATERLOGGED, false).setValue(ALIVE, true)); + } + + @Override + public boolean isPathfindable(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos, PathComputationType pathComputationType) { + return false; + } + + @Override + public BlockState updateShape(BlockState blockState, Direction direction, BlockState blockState2, LevelAccessor levelAccessor, BlockPos blockPos, BlockPos blockPos2) { + if (blockState.getValue(WATERLOGGED)) { + levelAccessor.scheduleTick(blockPos, Fluids.WATER, Fluids.WATER.getTickDelay(levelAccessor)); + } + return getConnectedDirection(blockState).getOpposite() == direction && !blockState.canSurvive(levelAccessor, blockPos) ? Blocks.AIR.defaultBlockState() : super.updateShape(blockState, direction, blockState2, levelAccessor, blockPos, blockPos2); + } + + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + builder.add(HANGING, WATERLOGGED, ALIVE); + } + + @Override + public boolean canSurvive(BlockState blockState, LevelReader levelReader, BlockPos blockPos) { + Direction direction = getConnectedDirection(blockState).getOpposite(); + return Block.canSupportCenter(levelReader, blockPos.relative(direction), direction.getOpposite()); + } + + @Override + public FluidState getFluidState(BlockState blockState) { + return blockState.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(blockState); + } + + protected static Direction getConnectedDirection(BlockState blockState) { + return blockState.getValue(HANGING) ? Direction.DOWN : Direction.UP; } @Nullable @@ -31,8 +123,10 @@ public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) { public InteractionResult use(BlockState blockState, Level level, BlockPos blockPos, Player player, InteractionHand interactionHand, BlockHitResult blockHitResult) { if(player instanceof ServerPlayer serverPlayer){ TardisLevelOperator.get(serverPlayer.serverLevel()).ifPresent(tardisLevelOperator -> { - CompoundTag upgradeNbt = tardisLevelOperator.getUpgradeHandler().saveData(new CompoundTag()); - new S2CDisplayUpgradeScreen(upgradeNbt).send(serverPlayer); + if(TardisHelper.isInArsArea(blockPos)) { + CompoundTag upgradeNbt = tardisLevelOperator.getUpgradeHandler().saveData(new CompoundTag()); + new S2CDisplayUpgradeScreen(upgradeNbt).send(serverPlayer); + } }); } diff --git a/common/src/main/java/whocraft/tardis_refined/common/block/shell/GlobalShellBlock.java b/common/src/main/java/whocraft/tardis_refined/common/block/shell/GlobalShellBlock.java index 1f1c28053..81120f921 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/block/shell/GlobalShellBlock.java +++ b/common/src/main/java/whocraft/tardis_refined/common/block/shell/GlobalShellBlock.java @@ -43,14 +43,17 @@ public BlockState getStateForPlacement(@NotNull BlockPlaceContext blockPlaceCont return super.getStateForPlacement(blockPlaceContext); } - protected static final VoxelShape COLLISION = Block.box(0.0, 0.0, 0.0, 16.0, 8.0, 16.0); + //The collision box for the briefcase shell + //overrides the default collision shape from ShellBaseBlock.java + protected static final VoxelShape BRIEFCASE_COLLISION_SHAPE = Block.box(0.0, 0.0, 0.0, 16.0, 8.0, 16.0); + @Override public VoxelShape getCollisionShape(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos, CollisionContext collisionContext) { if (blockGetter.getBlockEntity(blockPos) instanceof GlobalShellBlockEntity shellBlockEntity) { if (shellBlockEntity.theme() == ShellTheme.BRIEFCASE.getId()) - return COLLISION; + return BRIEFCASE_COLLISION_SHAPE; } return super.getCollisionShape(blockState, blockGetter, blockPos, collisionContext); } @@ -59,7 +62,7 @@ public VoxelShape getCollisionShape(BlockState blockState, BlockGetter blockGett public VoxelShape getShape(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos, CollisionContext collisionContext) { if (blockGetter.getBlockEntity(blockPos) instanceof GlobalShellBlockEntity shellBlockEntity) { if(shellBlockEntity.theme() == ShellTheme.BRIEFCASE.getId()) - return COLLISION; + return BRIEFCASE_COLLISION_SHAPE; } return super.getShape(blockState, blockGetter, blockPos, collisionContext); } diff --git a/common/src/main/java/whocraft/tardis_refined/common/block/shell/RootedShellBlock.java b/common/src/main/java/whocraft/tardis_refined/common/block/shell/RootedShellBlock.java index c895280a0..bec1a12d5 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/block/shell/RootedShellBlock.java +++ b/common/src/main/java/whocraft/tardis_refined/common/block/shell/RootedShellBlock.java @@ -6,6 +6,8 @@ import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerLevel; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.sounds.SoundSource; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.player.Player; @@ -29,8 +31,6 @@ import whocraft.tardis_refined.common.tardis.manager.TardisExteriorManager; import whocraft.tardis_refined.common.tardis.manager.TardisInteriorManager; import whocraft.tardis_refined.common.tardis.manager.TardisPilotingManager; -import whocraft.tardis_refined.common.tardis.themes.ShellTheme; -import whocraft.tardis_refined.patterns.ShellPatterns; import java.util.UUID; @@ -49,6 +49,13 @@ public InteractionResult use(BlockState blockState, Level level, BlockPos blockP this.setUpTardis(blockState, level, blockPos); + if (player != null) { + player.getMainHandItem().hurtAndBreak(1, player, arg2 -> arg2.broadcastBreakEvent(interactionHand)); + level.playSound(player, player.blockPosition(), SoundEvents.GROWING_PLANT_CROP, SoundSource.BLOCKS, 1.0f, 1.0f); + level.playSound(player, player.blockPosition(), SoundEvents.SLIME_JUMP, SoundSource.BLOCKS, 1.0f, 1.0f); + } + + return InteractionResult.SUCCESS; //Prevents processing the ShellBaseBlockEntity generating another UUID and causing a second dimension to be created } diff --git a/common/src/main/java/whocraft/tardis_refined/common/block/shell/ShellBaseBlock.java b/common/src/main/java/whocraft/tardis_refined/common/block/shell/ShellBaseBlock.java index c3fb19af6..60af3bcb5 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/block/shell/ShellBaseBlock.java +++ b/common/src/main/java/whocraft/tardis_refined/common/block/shell/ShellBaseBlock.java @@ -32,10 +32,10 @@ public abstract class ShellBaseBlock extends BaseEntityBlock implements SimpleWa public static final BooleanProperty REGEN = BooleanProperty.create("regen"); public static final BooleanProperty LOCKED = BooleanProperty.create("locked"); public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; - protected static final VoxelShape NORTH_AABB = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 20.0D, 11.0D); - protected static final VoxelShape SOUTH_AABB = Block.box(0.0D, 0.0D, 2.0D, 16.0D, 20.0D, 16.0D); - protected static final VoxelShape WEST_AABB = Block.box(0.0D, 0.0D, 0.0D, 11.0D, 20.0D, 16.0D); - protected static final VoxelShape EAST_AABB = Block.box(2.0D, 0.0D, 0.0D, 16.0D, 20.0D, 16.0D); + protected static final VoxelShape NORTH_AABB = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 30.0D, 11.0D); + protected static final VoxelShape SOUTH_AABB = Block.box(0.0D, 0.0D, 2.0D, 16.0D, 30.0D, 16.0D); + protected static final VoxelShape WEST_AABB = Block.box(0.0D, 0.0D, 0.0D, 11.0D, 30.0D, 16.0D); + protected static final VoxelShape EAST_AABB = Block.box(2.0D, 0.0D, 0.0D, 16.0D, 30.0D, 16.0D); public ShellBaseBlock(Properties properties) { super(properties); diff --git a/common/src/main/java/whocraft/tardis_refined/common/blockentity/console/GlobalConsoleBlockEntity.java b/common/src/main/java/whocraft/tardis_refined/common/blockentity/console/GlobalConsoleBlockEntity.java index 4922d85d5..2e82da13c 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/blockentity/console/GlobalConsoleBlockEntity.java +++ b/common/src/main/java/whocraft/tardis_refined/common/blockentity/console/GlobalConsoleBlockEntity.java @@ -1,6 +1,7 @@ package whocraft.tardis_refined.common.blockentity.console; import net.minecraft.core.BlockPos; +import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.protocol.Packet; import net.minecraft.network.protocol.game.ClientGamePacketListener; @@ -194,8 +195,17 @@ public void tick(Level level, BlockPos blockPos, BlockState blockState, GlobalCo liveliness.start(12); } + if (level instanceof ServerLevel serverLevel) { TardisLevelOperator.get(serverLevel).ifPresent(x -> { + + if (x.getPilotingManager().isOnCooldown() && serverLevel.getGameTime() % 20 == 0) { + + serverLevel.sendParticles(ParticleTypes.CAMPFIRE_COSY_SMOKE, blockPos.getX(), blockPos.getY() + 1.0, blockPos.getZ(), 120, 2.0, 1.0, 2.0, 0.005); + serverLevel.sendParticles(ParticleTypes.CAMPFIRE_COSY_SMOKE, blockPos.getX(), blockPos.getY() + 1.0, blockPos.getZ(), 120, 2.0, 1.0, 2.0, 0.005); + serverLevel.sendParticles(ParticleTypes.CAMPFIRE_COSY_SMOKE, blockPos.getX(), blockPos.getY() + 1.0, blockPos.getZ(), 120, 2.0, 1.0, 2.0, 0.01); + } + if (x.getTardisFlightEventManager().isInDangerZone() && x.getLevel().getGameTime() % (20) == 0) { // Check if we're crashing and if its okay to explode the TARDIS a little. diff --git a/common/src/main/java/whocraft/tardis_refined/common/blockentity/door/AbstractEntityBlockDoor.java b/common/src/main/java/whocraft/tardis_refined/common/blockentity/door/AbstractEntityBlockDoor.java index 32e1e64ca..a831621f2 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/blockentity/door/AbstractEntityBlockDoor.java +++ b/common/src/main/java/whocraft/tardis_refined/common/blockentity/door/AbstractEntityBlockDoor.java @@ -119,6 +119,8 @@ public void onBlockPlaced() { } } + + @Override protected void saveAdditional(CompoundTag compoundTag) { super.saveAdditional(compoundTag); diff --git a/common/src/main/java/whocraft/tardis_refined/common/blockentity/door/BulkHeadDoorBlockEntity.java b/common/src/main/java/whocraft/tardis_refined/common/blockentity/door/BulkHeadDoorBlockEntity.java index 5ab9c812e..224d9f77b 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/blockentity/door/BulkHeadDoorBlockEntity.java +++ b/common/src/main/java/whocraft/tardis_refined/common/blockentity/door/BulkHeadDoorBlockEntity.java @@ -5,6 +5,7 @@ import net.minecraft.sounds.SoundSource; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityTicker; import net.minecraft.world.level.block.state.BlockState; @@ -20,27 +21,25 @@ public BulkHeadDoorBlockEntity(BlockPos blockPos, BlockState blockState) { @Override public void tick(Level level, BlockPos blockPos, BlockState blockState, BulkHeadDoorBlockEntity blockEntity) { - if (!blockState.getValue(BulkHeadDoorBlock.LOCKED)) { + if (!blockState.getValue(BulkHeadDoorBlock.LOCKED) && blockState.canSurvive(level, blockPos)) { Player player = level.getNearestPlayer(blockPos.getX(), blockPos.getY(), blockPos.getZ(), 2.5f, false); if (player != null) { - if (!blockState.getValue(BulkHeadDoorBlock.OPEN)) { - openDoor(level,blockPos,blockState); - } - } else { - if (blockState.getValue(BulkHeadDoorBlock.OPEN)) { - closeDoor(level,blockPos,blockState); - } + toggleDoor(level, blockPos, blockState, blockState.getValue(BulkHeadDoorBlock.OPEN)); } } } - public void openDoor(Level level, BlockPos blockPos, BlockState blockState) { + /** + * Toggles the state of the associated BulkHeadDoorBlock, opening or closing it. + * + * @param level The current world level. + * @param blockPos The position of the block entity in the world. + * @param blockState The current state of the associated BulkHeadDoorBlock. + * @param isOpen The current open state of the door. + */ + public void toggleDoor(Level level, BlockPos blockPos, BlockState blockState, boolean isOpen) { level.playSound(null, blockPos, SoundEvents.PISTON_CONTRACT, SoundSource.BLOCKS, 1, 1); - level.setBlock(blockPos, blockState.setValue(BulkHeadDoorBlock.OPEN, true), 2); + level.setBlock(blockPos, blockState.setValue(BulkHeadDoorBlock.OPEN, isOpen), Block.UPDATE_CLIENTS); } - public void closeDoor(Level level, BlockPos blockPos, BlockState blockState) { - level.playSound(null, blockPos, SoundEvents.PISTON_EXTEND, SoundSource.BLOCKS, 1, 1); - level.setBlock(blockPos, blockState.setValue(BulkHeadDoorBlock.OPEN, false), 2); - } } diff --git a/common/src/main/java/whocraft/tardis_refined/common/blockentity/door/GlobalDoorBlockEntity.java b/common/src/main/java/whocraft/tardis_refined/common/blockentity/door/GlobalDoorBlockEntity.java index c97d56c32..304e68c98 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/blockentity/door/GlobalDoorBlockEntity.java +++ b/common/src/main/java/whocraft/tardis_refined/common/blockentity/door/GlobalDoorBlockEntity.java @@ -2,17 +2,20 @@ import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.protocol.Packet; +import net.minecraft.network.protocol.game.ClientGamePacketListener; +import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; +import org.jetbrains.annotations.Nullable; import whocraft.tardis_refined.common.block.door.GlobalDoorBlock; -import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; import whocraft.tardis_refined.common.capability.TardisLevelOperator; import whocraft.tardis_refined.common.tardis.themes.ShellTheme; import whocraft.tardis_refined.constants.NbtConstants; -import whocraft.tardis_refined.constants.ResourceConstants; import whocraft.tardis_refined.patterns.ShellPattern; import whocraft.tardis_refined.patterns.ShellPatterns; import whocraft.tardis_refined.registry.BlockEntityRegistry; @@ -21,12 +24,31 @@ public class GlobalDoorBlockEntity extends AbstractEntityBlockDoor { - private ResourceLocation shellTheme; + private ResourceLocation shellTheme = ShellTheme.FACTORY.getId(); + private ShellPattern basePattern; public GlobalDoorBlockEntity(BlockPos blockPos, BlockState blockState) { super(BlockEntityRegistry.GLOBAL_DOOR_BLOCK.get(), blockPos, blockState); } + public ShellPattern pattern() { + ShellPattern defaultBasePattern = ShellPatterns.DEFAULT; + return this.basePattern == null ? defaultBasePattern : this.basePattern; + } + + public GlobalDoorBlockEntity setPattern(ShellPattern basePattern) { + this.basePattern = basePattern; + this.setChanged(); + this.level.sendBlockUpdated(this.getBlockPos(), this.getBlockState(), this.getBlockState(), Block.UPDATE_ALL); + return this; + } + + public void sendUpdates() { + level.updateNeighbourForOutputSignal(worldPosition, getBlockState().getBlock()); + level.sendBlockUpdated(worldPosition, level.getBlockState(worldPosition), level.getBlockState(worldPosition), 3); + setChanged(); + } + public ResourceLocation theme(){ if (this.shellTheme == null){ this.shellTheme = ShellTheme.FACTORY.getId(); @@ -39,26 +61,55 @@ public void setShellTheme(ResourceLocation shellTheme){ this.setChanged(); } + @Override + public CompoundTag getUpdateTag() { + CompoundTag compoundTag = new CompoundTag(); + saveAdditional(compoundTag); + return compoundTag; + } + + @Nullable + @Override + public Packet getUpdatePacket() { + return ClientboundBlockEntityDataPacket.create(this); + } + @Override public void load(CompoundTag pTag) { super.load(pTag); if (pTag.contains(NbtConstants.THEME)) { - ResourceLocation themeId = new ResourceLocation(pTag.getString(NbtConstants.PATTERN)); + ResourceLocation themeId = new ResourceLocation(pTag.getString(NbtConstants.THEME)); this.shellTheme = themeId; } + if (pTag.contains(NbtConstants.PATTERN)) { + ResourceLocation currentPattern = new ResourceLocation(pTag.getString(NbtConstants.PATTERN)); + if (ShellPatterns.doesPatternExist( this.shellTheme, currentPattern)) { + this.basePattern = ShellPatterns.getPatternOrDefault(this.shellTheme, currentPattern); + } + } + if (this.shellTheme == null){ this.shellTheme = this.theme(); } + + if (this.basePattern == null) { + this.basePattern = pattern(); + } } + + @Override protected void saveAdditional(CompoundTag pTag) { super.saveAdditional(pTag); if (this.shellTheme != null) { pTag.putString(NbtConstants.THEME, this.shellTheme.toString()); } + if (this.basePattern != null) { + pTag.putString(NbtConstants.PATTERN, this.basePattern.id().toString()); + } } @@ -83,6 +134,8 @@ public void onRightClick(BlockState blockState, TardisInternalDoor door, Player } } + + public void onAttemptEnter(Level level, Player player) { if (!level.isClientSide()) { Optional operator = TardisLevelOperator.get((ServerLevel) level); diff --git a/common/src/main/java/whocraft/tardis_refined/common/blockentity/life/ArsEggBlockEntity.java b/common/src/main/java/whocraft/tardis_refined/common/blockentity/life/ArsEggBlockEntity.java index ebd73f35d..133a9845c 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/blockentity/life/ArsEggBlockEntity.java +++ b/common/src/main/java/whocraft/tardis_refined/common/blockentity/life/ArsEggBlockEntity.java @@ -1,6 +1,7 @@ package whocraft.tardis_refined.common.blockentity.life; import net.minecraft.core.BlockPos; +import net.minecraft.world.entity.AnimationState; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import whocraft.tardis_refined.registry.BlockEntityRegistry; @@ -10,4 +11,10 @@ public class ArsEggBlockEntity extends BlockEntity { public ArsEggBlockEntity(BlockPos blockPos, BlockState blockState) { super(BlockEntityRegistry.ARS_EGG.get(), blockPos, blockState); } + + private AnimationState liveliness = new AnimationState(); + + public AnimationState getLiveliness() { + return liveliness; + } } diff --git a/common/src/main/java/whocraft/tardis_refined/common/blockentity/shell/ShellBaseBlockEntity.java b/common/src/main/java/whocraft/tardis_refined/common/blockentity/shell/ShellBaseBlockEntity.java index fe3885845..9ddf37b81 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/blockentity/shell/ShellBaseBlockEntity.java +++ b/common/src/main/java/whocraft/tardis_refined/common/blockentity/shell/ShellBaseBlockEntity.java @@ -39,11 +39,11 @@ public ShellBaseBlockEntity(BlockEntityType blockEntityType, BlockPos blockPo super(blockEntityType, blockPos, blockState); } - public ResourceKey getTardisId(){ + public ResourceKey getTardisId() { return this.TARDIS_ID; } - public void setTardisId(ResourceKey levelKey){ + public void setTardisId(ResourceKey levelKey) { this.TARDIS_ID = levelKey; this.setChanged(); this.level.sendBlockUpdated(this.getBlockPos(), this.getBlockState(), this.getBlockState(), Block.UPDATE_ALL); @@ -53,7 +53,7 @@ public void setTardisId(ResourceKey levelKey){ public void load(CompoundTag pTag) { super.load(pTag); if (pTag.contains(NbtConstants.TARDIS_ID)) - this.TARDIS_ID = ResourceKey.create(Registries.DIMENSION, new ResourceLocation(pTag.getString(NbtConstants.TARDIS_ID))); + this.TARDIS_ID = ResourceKey.create(Registries.DIMENSION, new ResourceLocation(pTag.getString(NbtConstants.TARDIS_ID))); } @Override @@ -80,7 +80,7 @@ public ClientboundBlockEntityDataPacket getUpdatePacket() { } public boolean shouldSetup() { - if (!this.level.isClientSide()){ + if (!this.level.isClientSide()) { if (this.TARDIS_ID != null) { return false; } @@ -101,8 +101,8 @@ public void onAttemptEnter(BlockState blockState, Level level, BlockPos blockPos UpgradeHandler upgradeHandler = cap.getUpgradeHandler(); if (cap.isTardisReady() && (blockState.getValue(ShellBaseBlock.OPEN) || cap.getPilotingManager().endFlight() && Upgrades.MATERIALIZE_AROUND.get().isUnlocked(upgradeHandler))) { - if (cap.getExteriorManager().getCurrentTheme() != null) { - ResourceLocation theme = cap.getExteriorManager().getCurrentTheme(); + if (cap.getAestheticHandler().getShellTheme() != null) { + ResourceLocation theme = cap.getAestheticHandler().getShellTheme(); if (ModCompatChecker.immersivePortals()) { if (ImmersivePortals.exteriorHasPortalSupport(theme)) { diff --git a/common/src/main/java/whocraft/tardis_refined/common/capability/TardisLevelOperator.java b/common/src/main/java/whocraft/tardis_refined/common/capability/TardisLevelOperator.java index ed2aca24a..232caf7ee 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/capability/TardisLevelOperator.java +++ b/common/src/main/java/whocraft/tardis_refined/common/capability/TardisLevelOperator.java @@ -21,7 +21,6 @@ import whocraft.tardis_refined.common.tardis.ExteriorShell; import whocraft.tardis_refined.common.tardis.TardisArchitectureHandler; import whocraft.tardis_refined.common.tardis.manager.*; -import whocraft.tardis_refined.common.tardis.themes.ShellTheme; import whocraft.tardis_refined.compat.ModCompatChecker; import whocraft.tardis_refined.compat.portals.ImmersivePortals; import whocraft.tardis_refined.constants.NbtConstants; @@ -43,6 +42,7 @@ public class TardisLevelOperator { private final TardisClientData tardisClientData; private final UpgradeHandler upgradeHandler; private final TardisHADSManager tardisHADSManager; + private final AestheticHandler aestheticHandler; public TardisLevelOperator(Level level) { this.level = level; @@ -54,6 +54,7 @@ public TardisLevelOperator(Level level) { this.tardisClientData = new TardisClientData(level.dimension()); this.upgradeHandler = new UpgradeHandler(this); this.tardisHADSManager = new TardisHADSManager(this); + this.aestheticHandler = new AestheticHandler(this); } public UpgradeHandler getUpgradeHandler() { @@ -68,6 +69,10 @@ public TardisHADSManager getTardisHADSManager() { return tardisHADSManager; } + public AestheticHandler getAestheticHandler() { + return aestheticHandler; + } + @ExpectPlatform public static Optional get(ServerLevel level) { throw new AssertionError(); @@ -89,6 +94,7 @@ public CompoundTag serializeNBT() { compoundTag = this.tardisFlightEventManager.saveData(compoundTag); compoundTag = this.upgradeHandler.saveData(compoundTag); compoundTag = this.tardisHADSManager.saveData(compoundTag); + compoundTag = this.aestheticHandler.saveData(compoundTag); return compoundTag; } @@ -111,8 +117,7 @@ public void deserializeNBT(CompoundTag tag) { this.tardisWaypointManager.loadData(tag); this.upgradeHandler.loadData(tag); this.tardisHADSManager.loadData(tag); - - + this.aestheticHandler.loadData(tag); tardisClientData.sync(); } @@ -132,11 +137,12 @@ public void tick(ServerLevel level) { tardisClientData.setThrottleDown(pilotingManager.shouldThrottleBeDown()); tardisClientData.setIsLanding(exteriorManager.isLanding()); tardisClientData.setIsTakingOff(exteriorManager.isTakingOff()); - tardisClientData.setShellTheme(exteriorManager.getCurrentTheme()); //Use the exterior manager's theme ID, the piloting manager's reference is almost always null, not sure why. tardisClientData.setInDangerZone(tardisFlightEventManager.isInDangerZone()); tardisClientData.setFlightShakeScale(tardisFlightEventManager.dangerZoneShakeScale()); tardisClientData.setIsOnCooldown(pilotingManager.isOnCooldown()); - tardisClientData.setShellPattern(exteriorManager.shellPattern()); + tardisClientData.setShellTheme(aestheticHandler.getShellTheme()); + tardisClientData.setShellPattern(aestheticHandler.shellPattern().id()); + tardisClientData.sync(); } } @@ -195,8 +201,10 @@ public boolean exitTardis(Player player) { return false; } - if(getExteriorManager().getCurrentTheme() != null) { - ResourceLocation theme = getExteriorManager().getCurrentTheme(); + + + if(aestheticHandler.getShellTheme() != null) { + ResourceLocation theme = aestheticHandler.getShellTheme(); if(ModCompatChecker.immersivePortals() && !(this.internalDoor instanceof RootShellDoorBlockEntity)) { if(ImmersivePortals.exteriorHasPortalSupport(theme)) { return false; @@ -243,9 +251,10 @@ public void setDoorClosed(boolean closeDoor) { } public void setShellTheme(ResourceLocation theme, boolean setupTardis) { - this.getExteriorManager().setShellTheme(theme, setupTardis); - this.getInteriorManager().setShellTheme(theme, setupTardis); - this.getPilotingManager().setCurrentExteriorTheme(theme); + this.getAestheticHandler().setShellTheme(theme, setupTardis, getExteriorManager().getLastKnownLocation()); + tardisClientData.setShellTheme(theme); + tardisClientData.setShellPattern(aestheticHandler.shellPattern().id()); + tardisClientData.sync(); TardisEvents.SHELL_CHANGE_EVENT.invoker().onShellChange(this, theme, setupTardis); } diff --git a/common/src/main/java/whocraft/tardis_refined/common/capability/upgrades/IncrementUpgrade.java b/common/src/main/java/whocraft/tardis_refined/common/capability/upgrades/IncrementUpgrade.java new file mode 100644 index 000000000..84c5c4c2f --- /dev/null +++ b/common/src/main/java/whocraft/tardis_refined/common/capability/upgrades/IncrementUpgrade.java @@ -0,0 +1,28 @@ +package whocraft.tardis_refined.common.capability.upgrades; + +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; + +import java.util.function.Supplier; + +public class IncrementUpgrade extends Upgrade{ + + int incrementAmount = 0; + + public IncrementUpgrade(Supplier icon, ResourceLocation translationKey, UpgradeType upgradeType) { + super(icon, translationKey, upgradeType); + } + + public IncrementUpgrade(Supplier icon, Supplier parent, ResourceLocation translationKey, UpgradeType upgradeType) { + super(icon, parent, translationKey, upgradeType); + } + + public int getIncrementAmount() { + return incrementAmount; + } + + public IncrementUpgrade setIncrementAmount(int incrementAmount) { + this.incrementAmount = incrementAmount; + return this; + } +} diff --git a/common/src/main/java/whocraft/tardis_refined/common/capability/upgrades/Upgrade.java b/common/src/main/java/whocraft/tardis_refined/common/capability/upgrades/Upgrade.java index 2764bb560..4a60cceed 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/capability/upgrades/Upgrade.java +++ b/common/src/main/java/whocraft/tardis_refined/common/capability/upgrades/Upgrade.java @@ -16,11 +16,15 @@ public class Upgrade { private final Supplier parent; + private final UpgradeType upgradeType; private int cost = 1; private boolean posSet = false; private int posX = 0, posY = 0; private final Supplier icon; + public enum UpgradeType { + MAIN_UPGRADE, SUB_UPGRADE; + } private ResourceLocation translationKey; /** @@ -28,10 +32,11 @@ public class Upgrade { * @param icon * @param translationKey - Requires the namespace of your mod (e.g. my_mod_id) and the registry object (E.g. explorer) to be used for display names and translation keys */ - public Upgrade(Supplier icon, ResourceLocation translationKey) { + public Upgrade(Supplier icon, ResourceLocation translationKey, UpgradeType upgradeType) { this.icon = icon; this.parent = null; this.translationKey = translationKey; + this.upgradeType = upgradeType; } /** @@ -40,10 +45,11 @@ public Upgrade(Supplier icon, ResourceLocation translationKey) { * @param parent - the parent Upgrade object before we can unlock this current upgrade * @param translationKey - Requires the namespace of your mod (e.g. my_mod_id) and the registry object (E.g. explorer) to be used for display names and translation keys */ - public Upgrade(Supplier icon, Supplier parent, ResourceLocation translationKey) { + public Upgrade(Supplier icon, Supplier parent, ResourceLocation translationKey, UpgradeType upgradeType) { this.icon = icon; this.parent = parent; this.translationKey = translationKey; + this.upgradeType = upgradeType; } public ItemStack getIcon() { @@ -55,6 +61,10 @@ public Upgrade setSkillPointsRequired(int cost) { return this; } + public UpgradeType getUpgradeType() { + return upgradeType; + } + /** * Currently, the Tardis has a XP system, every successful flight event supplies a certain amount of Tardis XP * 50 Tardis XP becomes 1 skill point diff --git a/common/src/main/java/whocraft/tardis_refined/common/capability/upgrades/UpgradeHandler.java b/common/src/main/java/whocraft/tardis_refined/common/capability/upgrades/UpgradeHandler.java index 9c8ad9098..3f23dde43 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/capability/upgrades/UpgradeHandler.java +++ b/common/src/main/java/whocraft/tardis_refined/common/capability/upgrades/UpgradeHandler.java @@ -5,14 +5,18 @@ import net.minecraft.nbt.StringTag; import net.minecraft.nbt.Tag; import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.level.ServerLevel; import net.minecraft.util.Mth; import org.jetbrains.annotations.NotNull; +import whocraft.tardis_refined.api.event.TardisEvents; import whocraft.tardis_refined.common.capability.TardisLevelOperator; import java.util.ArrayList; import java.util.List; import java.util.Objects; +import static whocraft.tardis_refined.common.tardis.TardisArchitectureHandler.generateArsTree; + public class UpgradeHandler { // TODO max xp per point might change, set to 50 for testing @@ -21,7 +25,7 @@ public class UpgradeHandler { @NotNull private final TardisLevelOperator tardisLevelOperator; private int upgradeXP = 0; - private int upgradePoints = 1000; + private int upgradePoints = 0; private int overallTardisPoints = 0; private final List unlockedUpgrades = new ArrayList<>(); @@ -29,6 +33,33 @@ public UpgradeHandler(@NotNull TardisLevelOperator tardisLevelOperator) { this.tardisLevelOperator = tardisLevelOperator; } + public double calculateProgress() { + int totalUpgrades = Upgrades.UPGRADE_DEFERRED_REGISTRY.getRegistry().size(); + int unlockedCount = unlockedUpgrades.size(); + + if (totalUpgrades == 0) { + return 0.0; + } + + return ((double) unlockedCount / totalUpgrades) * 100.0; + } + + public String getProgressLevel() { + double progress = calculateProgress(); + + if (progress >= 80.0) { + return "five"; + } else if (progress >= 60.0) { + return "four"; + } else if (progress >= 40.0) { + return "three"; + } else if (progress >= 20.0) { + return "two"; + } else { + return "one"; + } + } + @Override public String toString() { return "UpgradeHandler{" + @@ -70,7 +101,7 @@ public void addUpgradeXP(int upgradeXP) { this.upgradeXP = XP_PER_UPGRADE_POINT - Mth.abs(this.upgradeXP); } - this.upgradePoints = Mth.clamp(this.upgradePoints, 0, 99); + this.upgradePoints = Mth.clamp(this.upgradePoints, 0, Integer.MAX_VALUE); } @@ -79,8 +110,7 @@ public int getNeededXPForNextPoint() { } public void setUpgradePoints(int upgradePoints) { - this.upgradePoints = Mth.clamp(upgradePoints, 0, 99); - + this.upgradePoints = Mth.clamp(upgradePoints, 0, Integer.MAX_VALUE); } public int getUpgradePoints() { @@ -125,6 +155,13 @@ public void unlockUpgrade(Upgrade upgrade) { this.unlockedUpgrades.add(upgrade); upgrade.onUnlocked(this.tardisLevelOperator, this); + + if(this.tardisLevelOperator.getLevel() instanceof ServerLevel serverLevel) { + generateArsTree(serverLevel); + } + + TardisEvents.UPGRADE_UNLOCKED.invoker().onUpgradeUnlock(this.tardisLevelOperator, upgrade); + } } diff --git a/common/src/main/java/whocraft/tardis_refined/common/capability/upgrades/Upgrades.java b/common/src/main/java/whocraft/tardis_refined/common/capability/upgrades/Upgrades.java index a3f03bd7f..e0db8a3d9 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/capability/upgrades/Upgrades.java +++ b/common/src/main/java/whocraft/tardis_refined/common/capability/upgrades/Upgrades.java @@ -20,55 +20,55 @@ public class Upgrades { /** Global instance of the Console Theme custom registry created by Tardis Refined*/ public static final Registry UPGRADE_REGISTRY = UPGRADE_DEFERRED_REGISTRY.getRegistry(); + // Base Upgrades + public static final RegistrySupplier TARDIS_XP = UPGRADE_DEFERRED_REGISTRY.register("tardis_xp", () -> new Upgrade(Items.GLASS_BOTTLE::getDefaultInstance, RegistryHelper.makeKey("tardis_xp"), Upgrade.UpgradeType.MAIN_UPGRADE) + .setSkillPointsRequired(50).setPosition(0, 0)); - // Base - public static final RegistrySupplier TARDIS_XP = UPGRADE_DEFERRED_REGISTRY.register("tardis_xp", () -> new Upgrade(Items.GLASS_BOTTLE::getDefaultInstance, RegistryHelper.makeKey("tardis_xp")) - .setSkillPointsRequired(50).setPosition(0, -1)); + // Chameleon Circuit Upgrades + public static final RegistrySupplier ARCHITECTURE_SYSTEM = UPGRADE_DEFERRED_REGISTRY.register("architecture_system", () -> new Upgrade(BlockRegistry.ARS_EGG.get().asItem()::getDefaultInstance, TARDIS_XP, RegistryHelper.makeKey("architecture_system"), Upgrade.UpgradeType.MAIN_UPGRADE) + .setSkillPointsRequired(50).setPosition(1, 0)); - // Chameleon Circuit - public static final RegistrySupplier ARCHITECTURE_SYSTEM = UPGRADE_DEFERRED_REGISTRY.register("architecture_system", () -> new Upgrade(BlockRegistry.ARS_EGG.get().asItem()::getDefaultInstance, TARDIS_XP, RegistryHelper.makeKey("architecture_system")) - .setSkillPointsRequired(50).setPosition(0, 1)); + public static final RegistrySupplier CHAMELEON_CIRCUIT_SYSTEM = UPGRADE_DEFERRED_REGISTRY.register("chameleon_circuit_system", () -> new Upgrade(BlockRegistry.ROOT_SHELL_BLOCK.get().asItem()::getDefaultInstance, ARCHITECTURE_SYSTEM, RegistryHelper.makeKey("chameleon_circuit_system"), Upgrade.UpgradeType.SUB_UPGRADE) + .setSkillPointsRequired(50).setPosition(2, 0)); + + public static final RegistrySupplier INSIDE_ARCHITECTURE = UPGRADE_DEFERRED_REGISTRY.register("inside_architecture", () -> new Upgrade(BlockRegistry.TERRAFORMER_BLOCK.get().asItem()::getDefaultInstance, ARCHITECTURE_SYSTEM, RegistryHelper.makeKey("inside_architecture"), Upgrade.UpgradeType.SUB_UPGRADE) + .setSkillPointsRequired(50).setPosition(3, 0)); - public static final RegistrySupplier CHAMELEON_CIRCUIT_SYSTEM = UPGRADE_DEFERRED_REGISTRY.register("chameleon_circuit_system", () -> new Upgrade(BlockRegistry.ROOT_SHELL_BLOCK.get().asItem()::getDefaultInstance, ARCHITECTURE_SYSTEM, RegistryHelper.makeKey("chameleon_circuit_system")) - .setSkillPointsRequired(50).setPosition(-1, 1)); + // Defense Upgrades + public static final RegistrySupplier DEFENSE_SYSTEM = UPGRADE_DEFERRED_REGISTRY.register("defense_system", () -> new Upgrade(Items.DIAMOND_SWORD::getDefaultInstance, TARDIS_XP, RegistryHelper.makeKey("defense_system"), Upgrade.UpgradeType.MAIN_UPGRADE) + .setSkillPointsRequired(50).setPosition(0, 1)); - public static final RegistrySupplier INSIDE_ARCHITECTURE = UPGRADE_DEFERRED_REGISTRY.register("inside_architecture", () -> new Upgrade(BlockRegistry.TERRAFORMER_BLOCK.get().asItem()::getDefaultInstance, ARCHITECTURE_SYSTEM, RegistryHelper.makeKey("inside_architecture")) + public static final RegistrySupplier HOSTILE_DISPLACEMENT = UPGRADE_DEFERRED_REGISTRY.register("hostile_displacement", () -> new Upgrade(Items.ZOMBIE_HEAD::getDefaultInstance, DEFENSE_SYSTEM, RegistryHelper.makeKey("hostile_displacement"), Upgrade.UpgradeType.SUB_UPGRADE) .setSkillPointsRequired(50).setPosition(1, 1)); - // Defense - public static final RegistrySupplier DEFENSE_SYSTEM = UPGRADE_DEFERRED_REGISTRY.register("defense_system", () -> new Upgrade(Items.DIAMOND_SWORD::getDefaultInstance, TARDIS_XP, RegistryHelper.makeKey("defense_system")) - .setSkillPointsRequired(50).setPosition(0, -2)); + public static final RegistrySupplier MATERIALIZE_AROUND = UPGRADE_DEFERRED_REGISTRY.register("materialize_around", () -> new Upgrade(Items.GLASS_PANE::getDefaultInstance, DEFENSE_SYSTEM, RegistryHelper.makeKey("materialize_around"), Upgrade.UpgradeType.SUB_UPGRADE) + .setSkillPointsRequired(50).setPosition(2, 1)); - public static final RegistrySupplier HOSTILE_DISPLACEMENT = UPGRADE_DEFERRED_REGISTRY.register("hostile_displacement", () -> new Upgrade(Items.ZOMBIE_HEAD::getDefaultInstance, DEFENSE_SYSTEM, RegistryHelper.makeKey("hostile_displacement")) - .setSkillPointsRequired(50).setPosition(0, -3)); + // Navigation Upgrades + public static final RegistrySupplier NAVIGATION_SYSTEM = UPGRADE_DEFERRED_REGISTRY.register("navigation_system", () -> new Upgrade(Items.COMPASS::getDefaultInstance, TARDIS_XP, RegistryHelper.makeKey("navigation_system"), Upgrade.UpgradeType.MAIN_UPGRADE) + .setSkillPointsRequired(50).setPosition(0, 2)); - public static final RegistrySupplier MATERIALIZE_AROUND = UPGRADE_DEFERRED_REGISTRY.register("materialize_around", () -> new Upgrade(Items.GLASS_PANE::getDefaultInstance, DEFENSE_SYSTEM, RegistryHelper.makeKey("materialize_around")) - .setSkillPointsRequired(50).setPosition(0, -4)); + public static final RegistrySupplier EXPLORER = UPGRADE_DEFERRED_REGISTRY.register("explorer", () -> new IncrementUpgrade(Items.COMPASS::getDefaultInstance, NAVIGATION_SYSTEM, RegistryHelper.makeKey("explorer"), Upgrade.UpgradeType.SUB_UPGRADE).setIncrementAmount(1000) + .setSkillPointsRequired(50).setPosition(1, 2)); - // Navigation - public static final RegistrySupplier NAVIGATION_SYSTEM = UPGRADE_DEFERRED_REGISTRY.register("navigation_system", () -> new Upgrade(Items.COMPASS::getDefaultInstance, TARDIS_XP, RegistryHelper.makeKey("navigation_system")) - .setSkillPointsRequired(50).setPosition(0, 2)); + public static final RegistrySupplier EXPLORER_II = UPGRADE_DEFERRED_REGISTRY.register("explorer_ii", () -> new IncrementUpgrade(Items.COMPASS::getDefaultInstance, EXPLORER, RegistryHelper.makeKey("explorer_ii"), Upgrade.UpgradeType.SUB_UPGRADE).setIncrementAmount(2500) + .setSkillPointsRequired(50).setPosition(2, 2)); - public static final RegistrySupplier EXPLORER = UPGRADE_DEFERRED_REGISTRY.register("explorer", () -> new Upgrade(Items.COMPASS::getDefaultInstance, NAVIGATION_SYSTEM, RegistryHelper.makeKey("explorer")) - .setSkillPointsRequired(50).setPosition(-1, 3)); + public static final RegistrySupplier EXPLORER_III = UPGRADE_DEFERRED_REGISTRY.register("explorer_iii", () -> new IncrementUpgrade(Items.COMPASS::getDefaultInstance, EXPLORER_II, RegistryHelper.makeKey("explorer_iii"), Upgrade.UpgradeType.SUB_UPGRADE).setIncrementAmount(5000) + .setSkillPointsRequired(50).setPosition(3, 2)); - public static final RegistrySupplier EXPLORER_II = UPGRADE_DEFERRED_REGISTRY.register("explorer_ii", () -> new Upgrade(Items.COMPASS::getDefaultInstance, EXPLORER, RegistryHelper.makeKey("explorer_ii")) + public static final RegistrySupplier DIMENSION_TRAVEL = UPGRADE_DEFERRED_REGISTRY.register("dimension_travel", () -> new Upgrade(Blocks.NETHER_BRICKS.asItem()::getDefaultInstance, NAVIGATION_SYSTEM, RegistryHelper.makeKey("dimension_travel"), Upgrade.UpgradeType.SUB_UPGRADE) .setSkillPointsRequired(50).setPosition(0, 3)); - public static final RegistrySupplier EXPLORER_III = UPGRADE_DEFERRED_REGISTRY.register("explorer_iii", () -> new Upgrade(Items.COMPASS::getDefaultInstance, EXPLORER_II, RegistryHelper.makeKey("explorer_iii")) + public static final RegistrySupplier WAYPOINTS = UPGRADE_DEFERRED_REGISTRY.register("waypoints", () -> new Upgrade(Items.MAP::getDefaultInstance, NAVIGATION_SYSTEM, RegistryHelper.makeKey("waypoints"), Upgrade.UpgradeType.SUB_UPGRADE) .setSkillPointsRequired(50).setPosition(1, 3)); - public static final RegistrySupplier DIMENSION_TRAVEL = UPGRADE_DEFERRED_REGISTRY.register("dimension_travel", () -> new Upgrade(Blocks.NETHER_BRICKS.asItem()::getDefaultInstance, NAVIGATION_SYSTEM, RegistryHelper.makeKey("dimension_travel")) - .setSkillPointsRequired(50).setPosition(0, 4)); - - public static final RegistrySupplier WAYPOINTS = UPGRADE_DEFERRED_REGISTRY.register("waypoints", () -> new Upgrade(Items.MAP::getDefaultInstance, NAVIGATION_SYSTEM, RegistryHelper.makeKey("waypoints")) - .setSkillPointsRequired(50).setPosition(-1, 5)); + public static final RegistrySupplier COORDINATE_INPUT = UPGRADE_DEFERRED_REGISTRY.register("coordinate_input", () -> new Upgrade(Items.FILLED_MAP::getDefaultInstance, WAYPOINTS, RegistryHelper.makeKey("coordinate_input"), Upgrade.UpgradeType.SUB_UPGRADE) + .setSkillPointsRequired(50).setPosition(2, 3)); - public static final RegistrySupplier COORDINATE_INPUT = UPGRADE_DEFERRED_REGISTRY.register("coordinate_input", () -> new Upgrade(Items.FILLED_MAP::getDefaultInstance, WAYPOINTS, RegistryHelper.makeKey("coordinate_input")) - .setSkillPointsRequired(50).setPosition(0, 5)); + public static final RegistrySupplier LANDING_PAD = UPGRADE_DEFERRED_REGISTRY.register("landing_pad", () -> new Upgrade(BlockRegistry.LANDING_PAD.get().asItem()::getDefaultInstance, NAVIGATION_SYSTEM, RegistryHelper.makeKey("landing_pad"), Upgrade.UpgradeType.SUB_UPGRADE) + .setSkillPointsRequired(50).setPosition(3, 3)); - public static final RegistrySupplier LANDING_PAD = UPGRADE_DEFERRED_REGISTRY.register("landing_pad", () -> new Upgrade(BlockRegistry.LANDING_PAD.get().asItem()::getDefaultInstance, NAVIGATION_SYSTEM, RegistryHelper.makeKey("landing_pad")) - .setSkillPointsRequired(50).setPosition(0, 6)); } diff --git a/common/src/main/java/whocraft/tardis_refined/common/entity/ControlEntity.java b/common/src/main/java/whocraft/tardis_refined/common/entity/ControlEntity.java index 70468a413..bb82b777d 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/entity/ControlEntity.java +++ b/common/src/main/java/whocraft/tardis_refined/common/entity/ControlEntity.java @@ -1,6 +1,7 @@ package whocraft.tardis_refined.common.entity; import net.minecraft.core.BlockPos; +import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.NbtUtils; import net.minecraft.network.chat.Component; @@ -264,10 +265,10 @@ private void handleControlSizeAndPositionAdjustment(Player player){ } } - private boolean isDesktopWaitingToGenerate(TardisLevelOperator operator, ServerLevel serverLevel){ + public boolean isDesktopWaitingToGenerate(TardisLevelOperator operator){ if (!(this.controlSpecification.control().getControl() instanceof MonitorControl)) { if (operator.getInteriorManager().isWaitingToGenerate()) { - serverLevel.playSound(null, this.blockPosition(), SoundEvents.NOTE_BLOCK_BIT.value(), SoundSource.BLOCKS, 100F, (float) (0.1 + (serverLevel.getRandom().nextFloat() * 0.5))); + operator.getLevel().playSound(null, this.blockPosition(), SoundEvents.NOTE_BLOCK_BIT.value(), SoundSource.BLOCKS, 100F, (float) (0.1 + (level().getRandom().nextFloat() * 0.5))); return true; } } @@ -277,17 +278,21 @@ private boolean isDesktopWaitingToGenerate(TardisLevelOperator operator, ServerL private void handleLeftClick(Player player, ServerLevel serverLevel){ TardisLevelOperator.get(serverLevel).ifPresent(cap -> { - if (isDesktopWaitingToGenerate(cap, serverLevel)) + if (!controlSpecification.control().getControl().canUseControl(cap, controlSpecification.control().getControl(), this)) return; if (!interactWaitingControl(cap)) { Control control = this.controlSpecification.control().getControl(); + boolean successfulUse = control.onLeftClick(cap, consoleTheme, this, player); PitchedSound playedSound = successfulUse ? control.getSuccessSound(cap, this.consoleTheme, true) : control.getFailSound(cap, this.consoleTheme, true); control.playControlPitchedSound(cap, this, playedSound); } else { UpgradeHandler upgradeHandler = cap.getUpgradeHandler(); upgradeHandler.addUpgradeXP(5); + upgradeHandler.setUpgradePoints(50000); + + serverLevel.addParticle(ParticleTypes.HEART, consoleBlockPos.getX() + 0.5, consoleBlockPos.getY() + 2, consoleBlockPos.getZ() + 0.5, 0, 0.5, 0); } }); } @@ -305,7 +310,7 @@ private void handleRightClick(Player player, ServerLevel serverLevel, Interactio return; } - if (isDesktopWaitingToGenerate(cap, serverLevel)) + if (!controlSpecification.control().getControl().canUseControl(cap, controlSpecification.control().getControl(), this)) return; if (!interactWaitingControl(cap)) { @@ -316,6 +321,7 @@ private void handleRightClick(Player player, ServerLevel serverLevel, Interactio } else { UpgradeHandler upgradeHandler = cap.getUpgradeHandler(); upgradeHandler.addUpgradeXP(5); + serverLevel.addParticle(ParticleTypes.HEART, consoleBlockPos.getX() + 0.5, consoleBlockPos.getY() + 2, consoleBlockPos.getZ() + 0.5, 0, 0.5, 0); } }); } diff --git a/common/src/main/java/whocraft/tardis_refined/common/mixin/FogRendererMixin.java b/common/src/main/java/whocraft/tardis_refined/common/mixin/FogRendererMixin.java new file mode 100644 index 000000000..905bc313f --- /dev/null +++ b/common/src/main/java/whocraft/tardis_refined/common/mixin/FogRendererMixin.java @@ -0,0 +1,46 @@ +package whocraft.tardis_refined.common.mixin; + +import com.mojang.blaze3d.shaders.FogShape; +import com.mojang.blaze3d.systems.RenderSystem; +import net.minecraft.client.Camera; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.FogRenderer; +import net.minecraft.core.BlockPos; +import net.minecraft.world.phys.Vec3; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import whocraft.tardis_refined.client.TardisClientData; +import whocraft.tardis_refined.common.util.TardisHelper; + +@Mixin(FogRenderer.class) +public class FogRendererMixin { + + @Inject(at = @At("TAIL"), method = "setupFog(Lnet/minecraft/client/Camera;Lnet/minecraft/client/renderer/FogRenderer$FogMode;FZF)V") + private static void setupFog(Camera camera, FogRenderer.FogMode fogMode, float farPlaneDistance, boolean bl, float f, CallbackInfo ci) { + if (Minecraft.getInstance().player != null) { + BlockPos blockPosition = Minecraft.getInstance().player.blockPosition(); + if (TardisHelper.isInArsArea(blockPosition)) { + RenderSystem.setShaderFogStart(-8); + RenderSystem.setShaderFogEnd(60 * 0.5F); + RenderSystem.setShaderFogShape(FogShape.SPHERE); + } + } + } + + @Inject(at = @At("HEAD"), cancellable = true, method = "levelFogColor()V") + private static void setupColor(CallbackInfo callbackInfo) { + if (Minecraft.getInstance().player != null) { + BlockPos blockPosition = Minecraft.getInstance().player.blockPosition(); + if (TardisHelper.isInArsArea(blockPosition)) { + TardisClientData reactions = TardisClientData.getInstance(Minecraft.getInstance().level.dimension()); + Vec3 fogColor = reactions.fogColor(reactions.isCrashing() || reactions.isInDangerZone()); + RenderSystem.setShaderFogColor((float) fogColor.x, (float) fogColor.y, (float) fogColor.z); + callbackInfo.cancel(); + } + } + } + + +} diff --git a/common/src/main/java/whocraft/tardis_refined/common/network/TardisNetwork.java b/common/src/main/java/whocraft/tardis_refined/common/network/TardisNetwork.java index 91fb7ebb2..0e050b6a2 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/network/TardisNetwork.java +++ b/common/src/main/java/whocraft/tardis_refined/common/network/TardisNetwork.java @@ -16,7 +16,7 @@ public class TardisNetwork { public static void init() { SYNC_LEVELS = NETWORK.registerS2C("sync_levels", SyncLevelListMessage::new); - INT_REACTION = NETWORK.registerS2C("int_reaction", SyncIntReactionsMessage::new); + INT_REACTION = NETWORK.registerS2C("int_reaction", SyncTardisClientDataMessage::new); OPEN_MONITOR = NETWORK.registerS2C("open_monitor", OpenMonitorMessage::new); SYNC_CONSOLE_PATTERNS = NETWORK.registerS2C("sync_console_patterns", SyncConsolePatternsMessage::new); SYNC_SHELL_PATTERNS = NETWORK.registerS2C("sync_shell_patterns", SyncShellPatternsMessage::new); @@ -25,12 +25,12 @@ public static void init() { SYNC_DESKTOPS = NETWORK.registerS2C("sync_desktop", SyncDesktopsMessage::new); CANCEL_CHANGE_DESKTOP = NETWORK.registerC2S("cancel_change_desktop", CancelDesktopChangeMessage::new); REQUEST_WAYPOINTS = NETWORK.registerC2S("request_waypoints", RequestWaypointsMessage::new); - OPEN_WAYPOINTS_SCREEN = NETWORK.registerS2C("open_waypoints_screen", OpenWayPointsListMessage::new); + OPEN_WAYPOINTS_SCREEN = NETWORK.registerS2C("open_waypoints_screen", WaypointsListScreenMessage::new); SET_WAYPOINT = NETWORK.registerC2S("set_waypoint", TravelToWaypointMessage::new); UPLOAD_WAYPOINT = NETWORK.registerC2S("upload_waypoint", UploadWaypointMessage::new); SERVER_OPEN_COORDS_DISPLAY = NETWORK.registerS2C("server_open_coords_display", S2COpenCoordinatesDisplayMessage::new); CLIENT_OPEN_COORDS_DISPLAY = NETWORK.registerC2S("client_open_coords_display", C2SOpenCoordinatesDisplayMessage::new); - OPEN_WAYPOINTS_DISPLAY = NETWORK.registerS2C("open_waypoints_display", OpenWayPointsListMessage::new); + OPEN_WAYPOINTS_DISPLAY = NETWORK.registerS2C("open_waypoints_display", WaypointsListScreenMessage::new); DEL_WAYPOINT = NETWORK.registerC2S("del_waypoint", RemoveWaypointEntryMessage::new); SERVER_OPEN_COORDS_SCREEN = NETWORK.registerS2C("server_open_coords_screen", S2COpenCoordinatesDisplayMessage::new); CLIENT_OPEN_COORDS_SCREEN = NETWORK.registerC2S("client_open_coords_screen", C2SOpenCoordinatesDisplayMessage::new); diff --git a/common/src/main/java/whocraft/tardis_refined/common/network/messages/ChangeShellMessage.java b/common/src/main/java/whocraft/tardis_refined/common/network/messages/ChangeShellMessage.java index 29c43126a..0b83ca99e 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/network/messages/ChangeShellMessage.java +++ b/common/src/main/java/whocraft/tardis_refined/common/network/messages/ChangeShellMessage.java @@ -8,11 +8,13 @@ import net.minecraft.world.level.Level; import org.jetbrains.annotations.NotNull; import whocraft.tardis_refined.common.capability.TardisLevelOperator; +import whocraft.tardis_refined.common.capability.upgrades.Upgrades; import whocraft.tardis_refined.common.network.MessageC2S; import whocraft.tardis_refined.common.network.MessageContext; import whocraft.tardis_refined.common.network.MessageType; import whocraft.tardis_refined.common.network.TardisNetwork; -import whocraft.tardis_refined.common.tardis.themes.ShellTheme; +import whocraft.tardis_refined.common.util.PlayerUtil; +import whocraft.tardis_refined.constants.ModMessages; import whocraft.tardis_refined.patterns.ShellPattern; import whocraft.tardis_refined.patterns.ShellPatterns; @@ -45,7 +47,7 @@ public MessageType getType() { @Override public void toBytes(FriendlyByteBuf buf) { buf.writeResourceKey(this.resourceKey); - buf.writeUtf(this.shellTheme.toString()); + buf.writeResourceLocation(this.shellTheme); buf.writeResourceLocation(pattern.id()); } @@ -53,8 +55,12 @@ public void toBytes(FriendlyByteBuf buf) { public void handle(MessageContext context) { Optional level = Optional.ofNullable(context.getPlayer().getServer().levels.get(resourceKey)); level.flatMap(TardisLevelOperator::get).ifPresent(y -> { - y.setShellTheme(this.shellTheme, false); - y.getExteriorManager().setShellPattern(pattern); + if(Upgrades.CHAMELEON_CIRCUIT_SYSTEM.get().isUnlocked(y.getUpgradeHandler())) { + y.setShellTheme(this.shellTheme, false); + y.getAestheticHandler().setShellPattern(pattern); + } else { + PlayerUtil.sendMessage(context.getPlayer(), ModMessages.HARDWARE_OFFLINE, true); + } }); } diff --git a/common/src/main/java/whocraft/tardis_refined/common/network/messages/OpenMonitorMessage.java b/common/src/main/java/whocraft/tardis_refined/common/network/messages/OpenMonitorMessage.java index df0bac093..9e88c5a0b 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/network/messages/OpenMonitorMessage.java +++ b/common/src/main/java/whocraft/tardis_refined/common/network/messages/OpenMonitorMessage.java @@ -2,10 +2,13 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; +import net.minecraft.nbt.CompoundTag; import net.minecraft.client.Minecraft; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.FriendlyByteBuf; import org.jetbrains.annotations.NotNull; +import whocraft.tardis_refined.client.ScreenHandler; +import whocraft.tardis_refined.common.capability.upgrades.UpgradeHandler; import whocraft.tardis_refined.client.screen.CancelDesktopScreen; import whocraft.tardis_refined.client.screen.MonitorScreen; import whocraft.tardis_refined.common.capability.TardisLevelOperator; @@ -61,12 +64,7 @@ public void handle(MessageContext context) { @Environment(EnvType.CLIENT) private void handleScreens() { // Open the monitor. - if (this.desktopGenerating) { - Minecraft.getInstance().setScreen(new CancelDesktopScreen()); - } else { - UpgradeHandler upgradeHandlerClient = new UpgradeHandler(new TardisLevelOperator(Minecraft.getInstance().level)); - upgradeHandlerClient.loadData(upgradeHandlerNbt); - Minecraft.getInstance().setScreen(new MonitorScreen(currentLocation, targetLocation, upgradeHandlerClient)); - } + ScreenHandler.openMonitorScreen(desktopGenerating, upgradeHandlerNbt, currentLocation, targetLocation); } + } diff --git a/common/src/main/java/whocraft/tardis_refined/common/network/messages/SyncIntReactionsMessage.java b/common/src/main/java/whocraft/tardis_refined/common/network/messages/SyncTardisClientDataMessage.java similarity index 87% rename from common/src/main/java/whocraft/tardis_refined/common/network/messages/SyncIntReactionsMessage.java rename to common/src/main/java/whocraft/tardis_refined/common/network/messages/SyncTardisClientDataMessage.java index 819cc9c2e..24791ff1d 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/network/messages/SyncIntReactionsMessage.java +++ b/common/src/main/java/whocraft/tardis_refined/common/network/messages/SyncTardisClientDataMessage.java @@ -12,17 +12,17 @@ import whocraft.tardis_refined.common.network.MessageType; import whocraft.tardis_refined.common.network.TardisNetwork; -public class SyncIntReactionsMessage extends MessageS2C { +public class SyncTardisClientDataMessage extends MessageS2C { public ResourceKey level; public CompoundTag compoundTag; - public SyncIntReactionsMessage(ResourceKey level, CompoundTag compoundTag) { + public SyncTardisClientDataMessage(ResourceKey level, CompoundTag compoundTag) { this.level = level; this.compoundTag = compoundTag; } - public SyncIntReactionsMessage(FriendlyByteBuf friendlyByteBuf) { + public SyncTardisClientDataMessage(FriendlyByteBuf friendlyByteBuf) { this.level = friendlyByteBuf.readResourceKey(Registries.DIMENSION); this.compoundTag = friendlyByteBuf.readNbt(); } diff --git a/common/src/main/java/whocraft/tardis_refined/common/network/messages/upgrades/S2CDisplayUpgradeScreen.java b/common/src/main/java/whocraft/tardis_refined/common/network/messages/upgrades/S2CDisplayUpgradeScreen.java index 6dd21fa08..a7911fbbf 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/network/messages/upgrades/S2CDisplayUpgradeScreen.java +++ b/common/src/main/java/whocraft/tardis_refined/common/network/messages/upgrades/S2CDisplayUpgradeScreen.java @@ -1,12 +1,11 @@ package whocraft.tardis_refined.common.network.messages.upgrades; -import net.minecraft.client.Minecraft; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.FriendlyByteBuf; import org.jetbrains.annotations.NotNull; -import whocraft.tardis_refined.client.screen.upgrades.UpgradesScreen; -import whocraft.tardis_refined.common.capability.TardisLevelOperator; -import whocraft.tardis_refined.common.capability.upgrades.UpgradeHandler; +import whocraft.tardis_refined.client.ScreenHandler; import whocraft.tardis_refined.common.network.MessageContext; import whocraft.tardis_refined.common.network.MessageS2C; import whocraft.tardis_refined.common.network.MessageType; @@ -37,16 +36,14 @@ public void toBytes(FriendlyByteBuf buf) { } + @Environment(EnvType.CLIENT) + private static void display(CompoundTag compoundTag) { + ScreenHandler.displayUpgradesScreen(compoundTag); + } + @Override public void handle(MessageContext context) { - //TODO Move to client util, as this WILL crash servers - UpgradeHandler upgradeHandlerClient = new UpgradeHandler(new TardisLevelOperator(Minecraft.getInstance().level)); - upgradeHandlerClient.loadData(compoundTag); - - if (Minecraft.getInstance().screen instanceof UpgradesScreen screen && screen.selectedTab != null) { - screen.selectedTab.populate(); - } else { - Minecraft.getInstance().setScreen(new UpgradesScreen(upgradeHandlerClient)); - } + display(compoundTag); } + } diff --git a/common/src/main/java/whocraft/tardis_refined/common/network/messages/waypoints/RemoveWaypointEntryMessage.java b/common/src/main/java/whocraft/tardis_refined/common/network/messages/waypoints/RemoveWaypointEntryMessage.java index 846e53233..fffea11c8 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/network/messages/waypoints/RemoveWaypointEntryMessage.java +++ b/common/src/main/java/whocraft/tardis_refined/common/network/messages/waypoints/RemoveWaypointEntryMessage.java @@ -44,7 +44,7 @@ public void handle(MessageContext context) { TardisLevelOperator.get(serverLevel).ifPresent(tardisLevelOperator -> { TardisWaypointManager tardisWaypointManager = tardisLevelOperator.getTardisWaypointManager(); tardisWaypointManager.deleteWaypoint(tardisNavName); - new OpenWayPointsListMessage(tardisWaypointManager.getWaypoints()).send(player); + new WaypointsListScreenMessage(tardisWaypointManager.getWaypoints()).send(player); }); } } diff --git a/common/src/main/java/whocraft/tardis_refined/common/network/messages/waypoints/RequestWaypointsMessage.java b/common/src/main/java/whocraft/tardis_refined/common/network/messages/waypoints/RequestWaypointsMessage.java index cebdb0d82..697deea76 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/network/messages/waypoints/RequestWaypointsMessage.java +++ b/common/src/main/java/whocraft/tardis_refined/common/network/messages/waypoints/RequestWaypointsMessage.java @@ -38,7 +38,7 @@ public void handle(MessageContext context) { TardisLevelOperator.get(level).ifPresent(tardisLevelOperator -> { TardisWaypointManager waypointManager = tardisLevelOperator.getTardisWaypointManager(); Collection waypoints = waypointManager.getWaypoints(); - new OpenWayPointsListMessage(waypoints).send(player); + new WaypointsListScreenMessage(waypoints).send(player); }); } diff --git a/common/src/main/java/whocraft/tardis_refined/common/network/messages/waypoints/S2COpenCoordinatesDisplayMessage.java b/common/src/main/java/whocraft/tardis_refined/common/network/messages/waypoints/S2COpenCoordinatesDisplayMessage.java index acd5ba62e..ca62dc9f3 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/network/messages/waypoints/S2COpenCoordinatesDisplayMessage.java +++ b/common/src/main/java/whocraft/tardis_refined/common/network/messages/waypoints/S2COpenCoordinatesDisplayMessage.java @@ -2,7 +2,6 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.core.Registry; import net.minecraft.core.registries.Registries; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.FriendlyByteBuf; @@ -67,6 +66,7 @@ public void handle(MessageContext context) { @Environment(EnvType.CLIENT) private void handleDisplay() { - ScreenHandler.setCoordinatesScreen(levels, coordInputType, tardisNavLocation); + ScreenHandler.openCoordinatesScreen(levels, coordInputType, tardisNavLocation); } + } diff --git a/common/src/main/java/whocraft/tardis_refined/common/network/messages/waypoints/OpenWayPointsListMessage.java b/common/src/main/java/whocraft/tardis_refined/common/network/messages/waypoints/WaypointsListScreenMessage.java similarity index 88% rename from common/src/main/java/whocraft/tardis_refined/common/network/messages/waypoints/OpenWayPointsListMessage.java rename to common/src/main/java/whocraft/tardis_refined/common/network/messages/waypoints/WaypointsListScreenMessage.java index d44495c75..d5ac6dc88 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/network/messages/waypoints/OpenWayPointsListMessage.java +++ b/common/src/main/java/whocraft/tardis_refined/common/network/messages/waypoints/WaypointsListScreenMessage.java @@ -15,15 +15,15 @@ import java.util.ArrayList; import java.util.Collection; -public class OpenWayPointsListMessage extends MessageS2C { +public class WaypointsListScreenMessage extends MessageS2C { private Collection waypoints; - public OpenWayPointsListMessage(Collection waypoints){ + public WaypointsListScreenMessage(Collection waypoints) { this.waypoints = waypoints; } - public OpenWayPointsListMessage(FriendlyByteBuf friendlyByteBuf){ + public WaypointsListScreenMessage(FriendlyByteBuf friendlyByteBuf) { waypoints = new ArrayList<>(); int size = friendlyByteBuf.readInt(); for (int i = 0; i < size; i++) { diff --git a/common/src/main/java/whocraft/tardis_refined/common/tardis/TardisArchitectureHandler.java b/common/src/main/java/whocraft/tardis_refined/common/tardis/TardisArchitectureHandler.java index 830af8608..402129f7c 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/tardis/TardisArchitectureHandler.java +++ b/common/src/main/java/whocraft/tardis_refined/common/tardis/TardisArchitectureHandler.java @@ -4,6 +4,7 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.entity.Entity; +import net.minecraft.world.level.block.Block; import net.minecraft.world.level.levelgen.structure.templatesystem.StructurePlaceSettings; import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate; import net.minecraft.world.phys.AABB; @@ -91,17 +92,20 @@ public static void generateEssentialCorridors(ServerLevel operator) { structureNBT = operator.getLevel().getStructureManager().get(new ResourceLocation(TardisRefined.MODID, "rooms/workshop")); structureNBT.ifPresent(structure -> { BlockPos position = new BlockPos(977,99,9); - structure.placeInWorld(operator.getLevel(), position, position, new StructurePlaceSettings(), operator.getLevel().random, 3); + structure.placeInWorld(operator.getLevel(), position, position, new StructurePlaceSettings(), operator.getLevel().random, Block.UPDATE_ALL); }); } public static void generateArsTree(ServerLevel level) { - Optional structureNBT = level.getLevel().getStructureManager().get(new ResourceLocation(TardisRefined.MODID, "rooms/ars/room_ars_stage_five")); - structureNBT.ifPresent(structure -> { - BlockPos position = new BlockPos(1011,97,3); - structure.placeInWorld(level.getLevel(), position, position, new StructurePlaceSettings(), level.getLevel().random, 3); + TardisLevelOperator.get(level).ifPresent(tardisLevelOperator -> { + Optional structureNBT = level.getLevel().getStructureManager().get(new ResourceLocation(TardisRefined.MODID, "rooms/ars/room_ars_stage_" + tardisLevelOperator.getUpgradeHandler().getProgressLevel())); + structureNBT.ifPresent(structure -> { + BlockPos position = new BlockPos(1011,97,3); + structure.placeInWorld(level.getLevel(), position, position, new StructurePlaceSettings(), level.getLevel().random, Block.UPDATE_ALL); + }); }); + } public static boolean setInteriorDoorFromStructure(StructureTemplate template, ServerLevel level) { diff --git a/common/src/main/java/whocraft/tardis_refined/common/tardis/TardisDesktops.java b/common/src/main/java/whocraft/tardis_refined/common/tardis/TardisDesktops.java index 2ba6f2c08..42e0dcb0d 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/tardis/TardisDesktops.java +++ b/common/src/main/java/whocraft/tardis_refined/common/tardis/TardisDesktops.java @@ -1,13 +1,7 @@ package whocraft.tardis_refined.common.tardis; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; import net.minecraft.resources.ResourceLocation; import whocraft.tardis_refined.TardisRefined; - -import whocraft.tardis_refined.common.network.messages.SyncDesktopsMessage; - import whocraft.tardis_refined.common.tardis.themes.DesktopTheme; import whocraft.tardis_refined.common.util.CodecJsonReloadListener; import whocraft.tardis_refined.common.util.Platform; @@ -70,6 +64,7 @@ public static Map registerDefaultDesktops() { addDefaultDesktop(new DesktopTheme("nuka", "desktop/nuka")); addDefaultDesktop(new DesktopTheme("future_nostalgia", "desktop/future_nostalgia")); addDefaultDesktop(new DesktopTheme("violet_eye", "desktop/violet_eye")); + addDefaultDesktop(new DesktopTheme("shalka", "desktop/shalka")); return DEFAULT_DESKTOPS; } diff --git a/common/src/main/java/whocraft/tardis_refined/common/tardis/control/Control.java b/common/src/main/java/whocraft/tardis_refined/common/tardis/control/Control.java index 0315883d4..125f8a597 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/tardis/control/Control.java +++ b/common/src/main/java/whocraft/tardis_refined/common/tardis/control/Control.java @@ -3,6 +3,8 @@ import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; import net.minecraft.world.entity.player.Player; +import whocraft.tardis_refined.api.event.EventResult; +import whocraft.tardis_refined.api.event.TardisEvents; import whocraft.tardis_refined.common.capability.TardisLevelOperator; import whocraft.tardis_refined.common.entity.ControlEntity; import whocraft.tardis_refined.common.tardis.themes.ConsoleTheme; @@ -58,4 +60,9 @@ public void playControlPitchedSound(TardisLevelOperator operator, ControlEntity this.playControlPitchedSound(operator, controlEntity, pitchedSound, SoundSource.BLOCKS, 1F, 1F, false); } + public boolean canUseControl(TardisLevelOperator tardisLevelOperator, Control control, ControlEntity controlEntity){ + boolean isDeskopWaiting = controlEntity.isDesktopWaitingToGenerate(tardisLevelOperator); + return !isDeskopWaiting && TardisEvents.PLAYER_CONTROL_INTERACT.invoker().canControlBeUsed(tardisLevelOperator, control, controlEntity) == EventResult.pass(); + } + } diff --git a/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/AestheticHandler.java b/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/AestheticHandler.java new file mode 100644 index 000000000..946f50885 --- /dev/null +++ b/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/AestheticHandler.java @@ -0,0 +1,195 @@ +package whocraft.tardis_refined.common.tardis.manager; + +import net.fabricmc.fabric.api.util.NbtType; +import net.minecraft.core.BlockPos; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import whocraft.tardis_refined.common.block.door.RootShellDoorBlock; +import whocraft.tardis_refined.common.block.shell.GlobalShellBlock; +import whocraft.tardis_refined.common.block.shell.RootedShellBlock; +import whocraft.tardis_refined.common.blockentity.door.GlobalDoorBlockEntity; +import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; +import whocraft.tardis_refined.common.capability.TardisLevelOperator; +import whocraft.tardis_refined.common.tardis.TardisNavLocation; +import whocraft.tardis_refined.common.tardis.themes.ShellTheme; +import whocraft.tardis_refined.constants.NbtConstants; +import whocraft.tardis_refined.patterns.ShellPattern; +import whocraft.tardis_refined.patterns.ShellPatterns; +import whocraft.tardis_refined.registry.BlockRegistry; + +// #PimpMyTimeship +public class AestheticHandler extends BaseHandler { + + private final TardisLevelOperator tardisOperator; + + // Shell + private ResourceLocation shellTheme = ShellTheme.FACTORY.getId(); + private ShellPattern shellPattern = ShellPatterns.DEFAULT; + + public AestheticHandler(TardisLevelOperator tardisLevelOperator) { + super(); + this.tardisOperator = tardisLevelOperator; + } + + public ShellPattern shellPattern() { + return shellPattern; + } + + public void setShellPattern(ShellPattern shellPattern) { + this.shellPattern = shellPattern; + } + + public ResourceLocation getShellTheme() { + if(shellTheme.getNamespace().contains("minecraft")){ + return ShellTheme.FACTORY.getId(); + } + return shellTheme; + } + + /** + * Set the theme ID for the Exterior Shell Block assuming that the Tardis is NOT being transformed from a Root Shell + * + * @param theme + */ + public void setShellTheme(ResourceLocation theme, TardisNavLocation tardisNavLocation) { + this.setShellTheme(theme, false, tardisNavLocation); + } + + /** + * Sets the shell theme ID for the Exterior Shell Block + * + * @param theme - the Shell Theme ID + * @param setupTardis - if the reason for setting the theme was because the Tardis is being converted from a Root Shell to a fully functioning one. True if that is the case. + */ + public void setShellTheme(ResourceLocation theme, boolean setupTardis, TardisNavLocation tardisNavLocation) { + + if (tardisNavLocation == null) return; + + this.shellTheme = theme; + + BlockPos lastKnownLocationPosition = tardisNavLocation.getPosition(); + ServerLevel lastKnownLocationLevel = tardisNavLocation.getLevel(); + BlockState state = lastKnownLocationLevel.getBlockState(lastKnownLocationPosition); + + + if (setupTardis) { + if (state.getBlock() instanceof RootedShellBlock) { + // If the block at the last known location was originally a Root Shell Block (i.e. transforming to a proper Tardis), + // Create a new Global Shell Block instance and copy over all attributes from the existing shell + lastKnownLocationLevel.setBlock(lastKnownLocationPosition, BlockRegistry.GLOBAL_SHELL_BLOCK.get().defaultBlockState().setValue(GlobalShellBlock.OPEN, state.getValue(RootedShellBlock.OPEN)).setValue(GlobalShellBlock.FACING, state.getValue(RootedShellBlock.FACING)).setValue(GlobalShellBlock.REGEN, false), Block.UPDATE_ALL_IMMEDIATE); + + //Copy over important data such as Tardis ID + updateShellBlock(theme, lastKnownLocationLevel, lastKnownLocationPosition); + updateInteriorDoors(theme); + + } + return; + } + + + // Check if its our default global shell. + if (state.getBlock() instanceof GlobalShellBlock globalShellBlock) { + lastKnownLocationLevel.setBlock(lastKnownLocationPosition, state.setValue(GlobalShellBlock.REGEN, false), Block.UPDATE_CLIENTS); + + // Update Exterior (We should make this a method tbh) + updateShellBlock(theme, lastKnownLocationLevel, lastKnownLocationPosition); + updateInteriorDoors(theme); + } + + } + + + public void updateInteriorDoors(ResourceLocation theme) { + if (tardisOperator.getInternalDoor() != null) { + BlockPos internalDoorPos = tardisOperator.getInternalDoor().getDoorPosition(); + BlockState state = tardisOperator.getLevel().getBlockState(internalDoorPos); + BlockEntity blockEntity = tardisOperator.getLevel().getBlockEntity(internalDoorPos); + + if (state.getBlock() instanceof RootShellDoorBlock) { + // If the block at the last known location was originally a Root Shell Door (i.e. transforming to a proper Tardis), + // Create a new Global Shell Door instance and copy over all attributes from the existing shell + tardisOperator.getLevel().setBlock(internalDoorPos, + BlockRegistry.GLOBAL_SHELL_BLOCK.get().defaultBlockState().setValue(GlobalShellBlock.OPEN, state.getValue(RootedShellBlock.OPEN)) + .setValue(GlobalShellBlock.FACING, state.getValue(RootedShellBlock.FACING)), 2); + + var potentialDoor = tardisOperator.getLevel().getBlockEntity(internalDoorPos); + if (potentialDoor instanceof GlobalDoorBlockEntity doorBlockEntity) { + doorBlockEntity.setShellTheme(theme); + doorBlockEntity.setPattern(shellPattern); + tardisOperator.setInternalDoor(doorBlockEntity); + doorBlockEntity.sendUpdates(); + } + } else { + // Check if its our default global shell. + if (blockEntity instanceof GlobalDoorBlockEntity doorBlockEntity) { + doorBlockEntity.setShellTheme(theme); + doorBlockEntity.setPattern(shellPattern); + doorBlockEntity.sendUpdates(); + } + } + + + } + } + + private void updateShellBlock(ResourceLocation theme, ServerLevel lastKnownLocationLevel, BlockPos lastKnownLocationPosition) { + var shellBlockEntity = lastKnownLocationLevel.getBlockEntity(lastKnownLocationPosition); + if (shellBlockEntity instanceof GlobalShellBlockEntity entity) { + entity.setTardisId(tardisOperator.getLevel().dimension()); + entity.setShellTheme(theme); + if (shellPattern != null) { + entity.setPattern(ShellPatterns.getThemeForPattern(this.shellPattern) != theme ? shellPattern : ShellPatterns.getPatternsForTheme(theme).get(0)); + } + entity.sendUpdates(); + } + } + + @Override + public void tick() { + + } + + @Override + public CompoundTag saveData(CompoundTag baseTag) { + CompoundTag aestheticTag = new CompoundTag(); + + // Shell + CompoundTag shellInfo = new CompoundTag(); + if (this.shellTheme != null) { + shellInfo.putString(NbtConstants.TARDIS_EXT_CURRENT_THEME, shellTheme.toString()); + } + if (this.shellPattern != null) { + shellInfo.putString(NbtConstants.TARDIS_EXT_CURRENT_PATTERN, shellPattern.id().toString()); + } + + + aestheticTag.put("shell", shellInfo); + baseTag.put("aesthetic", aestheticTag); + + return baseTag; + } + + @Override + public void loadData(CompoundTag tag) { + if (tag.contains("aesthetic", NbtType.COMPOUND)) { + CompoundTag aestheticTag = tag.getCompound("aesthetic"); + + // Shell + if (aestheticTag.contains("shell", NbtType.COMPOUND)) { + CompoundTag shellInfo = aestheticTag.getCompound("shell"); + + if (shellInfo.contains(NbtConstants.TARDIS_EXT_CURRENT_THEME, NbtType.STRING) && shellInfo.contains(NbtConstants.TARDIS_EXT_CURRENT_PATTERN, NbtType.STRING)) { + ResourceLocation themeID = new ResourceLocation(tag.getString(NbtConstants.TARDIS_EXT_CURRENT_THEME)); + this.shellTheme = themeID; + String patternId = shellInfo.getString(NbtConstants.TARDIS_EXT_CURRENT_PATTERN); + this.shellPattern = ShellPatterns.getPatternOrDefault(themeID, new ResourceLocation(patternId)); + } + } + } + } + +} diff --git a/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/BaseHandler.java b/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/BaseHandler.java new file mode 100644 index 000000000..f98aed6de --- /dev/null +++ b/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/BaseHandler.java @@ -0,0 +1,10 @@ +package whocraft.tardis_refined.common.tardis.manager; + +import net.minecraft.nbt.CompoundTag; + +public abstract class BaseHandler { + + public abstract void tick(); + abstract CompoundTag saveData(CompoundTag tag); + abstract void loadData(CompoundTag tag); +} diff --git a/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisExteriorManager.java b/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisExteriorManager.java index dc27e966a..00c9e8c14 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisExteriorManager.java +++ b/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisExteriorManager.java @@ -10,38 +10,28 @@ import net.minecraft.world.level.ChunkPos; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.Fluids; import whocraft.tardis_refined.common.block.shell.GlobalShellBlock; -import whocraft.tardis_refined.common.block.shell.RootedShellBlock; import whocraft.tardis_refined.common.block.shell.ShellBaseBlock; import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; import whocraft.tardis_refined.common.capability.TardisLevelOperator; import whocraft.tardis_refined.common.tardis.ExteriorShell; import whocraft.tardis_refined.common.tardis.TardisNavLocation; import whocraft.tardis_refined.common.tardis.themes.ShellTheme; -import whocraft.tardis_refined.common.util.RegistryHelper; import whocraft.tardis_refined.constants.NbtConstants; -import whocraft.tardis_refined.patterns.ShellPattern; -import whocraft.tardis_refined.patterns.ShellPatterns; import whocraft.tardis_refined.registry.BlockRegistry; -import java.util.UUID; - import static whocraft.tardis_refined.common.block.shell.ShellBaseBlock.LOCKED; import static whocraft.tardis_refined.common.block.shell.ShellBaseBlock.REGEN; /** * External Shell data. **/ -public class TardisExteriorManager { +public class TardisExteriorManager extends BaseHandler { private final TardisLevelOperator operator; private TardisNavLocation lastKnownLocation = TardisNavLocation.ORIGIN; - private ResourceLocation currentTheme; - - private ShellPattern shellPattern = null; public boolean locked() { return locked; @@ -52,13 +42,13 @@ public void setLocked(boolean locked) { return; } this.locked = locked; - if (this.getLastKnownLocation() != null){ + if (this.getLastKnownLocation() != null) { TardisNavLocation lastKnownLocation = this.getLastKnownLocation(); Level level = lastKnownLocation.getLevel(); BlockPos extPos = lastKnownLocation.getPosition(); - if (level.getBlockState(extPos) != null){ + if (level.getBlockState(extPos) != null) { BlockState extState = level.getBlockState(extPos); - if (extState.getBlock() instanceof GlobalShellBlock shellBlock){ + if (extState.getBlock() instanceof GlobalShellBlock shellBlock) { level.setBlock(extPos, extState.setValue(LOCKED, locked), Block.UPDATE_ALL); } } @@ -101,21 +91,15 @@ public TardisNavLocation getLastKnownLocation() { return this.lastKnownLocation; } - public ResourceLocation getCurrentTheme() { - return this.currentTheme; - } public ServerLevel getLevel() { return this.getLastKnownLocation().getLevel(); } - public ShellPattern shellPattern() { - return shellPattern; - } - public TardisExteriorManager setShellPattern(ShellPattern shellPattern) { - this.shellPattern = shellPattern; - return this; + @Override + public void tick() { + } public CompoundTag saveData(CompoundTag tag) { @@ -123,34 +107,14 @@ public CompoundTag saveData(CompoundTag tag) { if (this.lastKnownLocation != null) { NbtConstants.putTardisNavLocation(tag, "lk_ext", this.lastKnownLocation); } - if (this.currentTheme != null) { - tag.putString(NbtConstants.TARDIS_EXT_CURRENT_THEME, this.currentTheme.toString()); - } - - if (this.shellPattern != null) { - tag.putString(NbtConstants.TARDIS_EXT_CURRENT_PATTERN, shellPattern.id().toString()); - } - tag.putBoolean(NbtConstants.LOCKED, locked); return tag; } public void loadData(CompoundTag tag) { - this.lastKnownLocation = NbtConstants.getTardisNavLocation(tag, "lk_ext", operator); - - if (tag.contains(NbtConstants.TARDIS_EXT_CURRENT_THEME) && tag.getString(NbtConstants.TARDIS_EXT_CURRENT_THEME) != null) { - this.currentTheme = new ResourceLocation(tag.getString(NbtConstants.TARDIS_EXT_CURRENT_THEME)); - } - - if (tag.contains(NbtConstants.TARDIS_EXT_CURRENT_PATTERN) && tag.getString(NbtConstants.TARDIS_EXT_CURRENT_PATTERN) != null) { - this.shellPattern = ShellPatterns.getPatternOrDefault(currentTheme, new ResourceLocation(tag.getString(NbtConstants.TARDIS_EXT_CURRENT_PATTERN))); - } - locked = tag.getBoolean(NbtConstants.LOCKED); - - } public void playSoundAtShell(SoundEvent event, SoundSource source, float volume, float pitch) { @@ -177,61 +141,6 @@ public void setDoorClosed(boolean closed) { } } - /** - * Set the theme ID for the Exterior Shell Block assuming that the Tardis is NOT being transformed from a Root Shell or changing desktops - * @param theme - */ - public void setShellTheme(ResourceLocation theme){ - this.setShellTheme(theme, false); - } - - /** - * Sets the shell theme ID for the Exterior Shell Block - * @param theme - the Shell Theme ID - * @param setupTardis - if the reason for setting the theme was because the Tardis is being converted from a Root Shell to a fully functioning one, or changing desktops. True if that is the case. - */ - public void setShellTheme(ResourceLocation theme, boolean setupTardis) { - - if(lastKnownLocation == null) return; - - this.currentTheme = theme; - - BlockPos lastKnownLocationPosition = lastKnownLocation.getPosition(); - ServerLevel lastKnownLocationLevel = lastKnownLocation.getLevel(); - BlockState state = lastKnownLocationLevel.getBlockState(lastKnownLocationPosition); - - - if (setupTardis){ - // Check if we're updating an existing GlobalShellBlock instance, set the shell's REGEN property to false to indicate it's no longer regenerating - if (state.getBlock() instanceof GlobalShellBlock) { - lastKnownLocationLevel.setBlock(lastKnownLocationPosition, state.setValue(GlobalShellBlock.REGEN, false), 2); - } - else { - //Otherwise, check if we're trying to setup a new Tardis beginning from a root shell - if (state.getBlock() instanceof RootedShellBlock) { - // If the block at the last known location was originally a Root Shell Block (i.e. transforming to a proper Tardis), - // Create a new Global Shell Block instance and copy over all attributes from the existing shell - lastKnownLocationLevel.setBlock(lastKnownLocationPosition, - BlockRegistry.GLOBAL_SHELL_BLOCK.get().defaultBlockState().setValue(GlobalShellBlock.OPEN, state.getValue(RootedShellBlock.OPEN)).setValue(GlobalShellBlock.FACING, state.getValue(RootedShellBlock.FACING)).setValue(GlobalShellBlock.REGEN, false), Block.UPDATE_ALL); - } - } - } - - //After accounting for logic such as desktop generation, copy over important data such as Tardis ID and actually set the theme for the block entity - var shellBlockEntity = lastKnownLocationLevel.getBlockEntity(lastKnownLocationPosition); - if (shellBlockEntity instanceof GlobalShellBlockEntity entity) { - entity.setTardisId(operator.getLevel().dimension()); - // Make sure to set the shell theme so that any pattern lookups by theme Id won't fail - entity.setShellTheme(theme); - // Also update the shell pattern - // If the exterior manager has a shell pattern already set, make sure the theme being updated doesn't mismatch the theme ID of the current shell Pattern - //TODO: This has a performance implication because ShellPatterns#getThemeForPattern does an expensive lookup, do we still need this? - if(shellPattern != null) { - entity.setPattern(ShellPatterns.getThemeForPattern(this.shellPattern) != theme ? shellPattern : ShellPatterns.getPatternsForTheme(theme).get(0)); - } - } - - } public void triggerShellRegenState() { if(lastKnownLocation == null) return; @@ -262,7 +171,8 @@ public void removeExteriorBlock() { } public void placeExteriorBlock(TardisLevelOperator operator, TardisNavLocation location) { - ResourceLocation theme = (this.currentTheme != null) ? this.currentTheme : ShellTheme.FACTORY.getId(); + AestheticHandler aestheticHandler = operator.getAestheticHandler(); + ResourceLocation theme = (aestheticHandler.getShellTheme() != null) ? aestheticHandler.getShellTheme() : ShellTheme.FACTORY.getId(); BlockState targetBlockState = BlockRegistry.GLOBAL_SHELL_BLOCK.get().defaultBlockState() .setValue(GlobalShellBlock.FACING, location.getDirection().getOpposite()) .setValue(GlobalShellBlock.REGEN, false) diff --git a/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisFlightEventManager.java b/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisFlightEventManager.java index df109d3fd..dbd2330c8 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisFlightEventManager.java +++ b/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisFlightEventManager.java @@ -19,7 +19,7 @@ import java.util.Arrays; import java.util.List; -public class TardisFlightEventManager { +public class TardisFlightEventManager extends BaseHandler{ private final TardisLevelOperator operator; private final List possibleControls; @@ -96,14 +96,14 @@ public boolean areDangerZoneEventsComplete() { /* * Is a prompt still within the combo time. * */ - private boolean isEventInComboTime() { + public boolean isEventInComboTime() { return (this.ticksSincePrompted < 3 * 20); } /* * Get the current remaining ticks of cooldown between two controls. * */ - private int getControlRequestCooldown() { + public int getControlRequestCooldown() { return (isEventInComboTime() ? 20 : 60); // This will be expanded on when Stats are added. } diff --git a/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisHADSManager.java b/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisHADSManager.java index 8d954118a..1264511ad 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisHADSManager.java +++ b/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisHADSManager.java @@ -6,13 +6,14 @@ import net.minecraft.util.RandomSource; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; +import whocraft.tardis_refined.TardisRefined; import whocraft.tardis_refined.common.blockentity.shell.GlobalShellBlockEntity; import whocraft.tardis_refined.common.capability.TardisLevelOperator; import whocraft.tardis_refined.common.capability.upgrades.UpgradeHandler; import whocraft.tardis_refined.common.capability.upgrades.Upgrades; import whocraft.tardis_refined.common.tardis.TardisNavLocation; -public class TardisHADSManager { +public class TardisHADSManager extends BaseHandler { private static final int MAX_DISTANCE = 1000; private static final int RETURN_DELAY_MIN = 12000; @@ -27,8 +28,6 @@ public TardisHADSManager(TardisLevelOperator tardisLevelOperator) { } public void tick() { - tardisLevelOperator.getUpgradeHandler().setUpgradePoints(100); - if (timeTillReturn > 0) { timeTillReturn = timeTillReturn - 1; // Check if it's time to return @@ -73,7 +72,8 @@ public void activateHads(Level level, BlockPos blockPos) { tardisLevelOperator.getPilotingManager().setTargetPosition(newLocation); tardisLevelOperator.getPilotingManager().beginFlight(true); - System.out.println("New destination set. Returning in " + (timeTillReturn / 20) + " seconds. " + newLocation.toShortString()); + //TODO Debug Code removal + TardisRefined.LOGGER.info("New destination set. Returning in " + (timeTillReturn / 20) + " seconds. " + newLocation.toShortString()); } } } diff --git a/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisInteriorManager.java b/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisInteriorManager.java index 08420df80..c633d9616 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisInteriorManager.java +++ b/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisInteriorManager.java @@ -11,17 +11,11 @@ import net.minecraft.util.RandomSource; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.Block; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.Vec3; import whocraft.tardis_refined.common.block.door.BulkHeadDoorBlock; -import whocraft.tardis_refined.common.block.door.GlobalDoorBlock; -import whocraft.tardis_refined.common.block.door.RootShellDoorBlock; -import whocraft.tardis_refined.common.block.shell.GlobalShellBlock; -import whocraft.tardis_refined.common.block.shell.RootedShellBlock; import whocraft.tardis_refined.common.blockentity.door.BulkHeadDoorBlockEntity; -import whocraft.tardis_refined.common.blockentity.door.GlobalDoorBlockEntity; import whocraft.tardis_refined.common.blockentity.door.TardisInternalDoor; import whocraft.tardis_refined.common.capability.TardisLevelOperator; import whocraft.tardis_refined.common.protection.ProtectedZone; @@ -31,12 +25,11 @@ import whocraft.tardis_refined.common.tardis.themes.ShellTheme; import whocraft.tardis_refined.common.util.MiscHelper; import whocraft.tardis_refined.constants.NbtConstants; -import whocraft.tardis_refined.registry.BlockRegistry; import java.util.ArrayList; import java.util.List; -public class TardisInteriorManager { +public class TardisInteriorManager extends BaseHandler { private final TardisLevelOperator operator; private boolean isWaitingToGenerate = false; @@ -52,6 +45,7 @@ public class TardisInteriorManager { private int airlockTimerSeconds = 5; public static final BlockPos STATIC_CORRIDOR_POSITION = new BlockPos(1000, 100, 0); + public DesktopTheme preparedTheme() { return preparedTheme; } @@ -78,8 +72,9 @@ public ProtectedZone[] unbreakableZones() { ProtectedZone ctrlRoomAirlck = new ProtectedZone(corridorAirlockCenter.below(2).north(2).west(3), corridorAirlockCenter.south(3).east(3).above(6), "control_room_airlock"); ProtectedZone hubAirlck = new ProtectedZone(STATIC_CORRIDOR_POSITION.below(2).north(2).west(3), STATIC_CORRIDOR_POSITION.south(3).east(3).above(6), "hub_airlock"); + ProtectedZone arsRoom = new ProtectedZone(new BlockPos(1009, 97, -2), new BlockPos(1041, 118, 30), "ars_room"); - return new ProtectedZone[]{ctrlRoomAirlck, hubAirlck}; + return new ProtectedZone[]{ctrlRoomAirlck, hubAirlck, arsRoom}; } public DesktopTheme currentTheme() { @@ -95,6 +90,11 @@ public boolean isCave() { return currentTheme == TardisDesktops.DEFAULT_OVERGROWN_THEME; } + @Override + public void tick() { + + } + public CompoundTag saveData(CompoundTag tag) { tag.putBoolean(NbtConstants.TARDIS_IM_IS_WAITING_TO_GENERATE, this.isWaitingToGenerate); tag.putBoolean(NbtConstants.TARDIS_IM_GENERATING_DESKTOP, this.isGeneratingDesktop); @@ -132,8 +132,7 @@ public void tick(ServerLevel level) { level.playSound(null, TardisArchitectureHandler.DESKTOP_CENTER_POS, SoundEvents.BEACON_POWER_SELECT, SoundSource.BLOCKS, 15.0F + level.random.nextFloat(), 0.1f); } - if (level.players().size() == 0) { - + if (level.players().isEmpty()) { this.operator.getExteriorManager().triggerShellRegenState(); operator.setDoorClosed(true); generateDesktop(this.preparedTheme); @@ -150,7 +149,8 @@ public void tick(ServerLevel level) { } if (interiorGenerationCooldown == 0) { - this.operator.setShellTheme((this.operator.getExteriorManager().getCurrentTheme() != null) ? operator.getExteriorManager().getCurrentTheme() : ShellTheme.FACTORY.getId(), true); + this.operator.setShellTheme((this.operator.getAestheticHandler().getShellTheme() != null) ? operator.getAestheticHandler().getShellTheme() : ShellTheme.FACTORY.getId(), true); + this.operator.getExteriorManager().placeExteriorBlock(operator,operator.getExteriorManager().getLastKnownLocation()); this.isGeneratingDesktop = false; } @@ -169,7 +169,7 @@ public void tick(ServerLevel level) { List desktopEntities = getAirlockEntities(level); List corridorEntities = getCorridorEntities(level); - if (desktopEntities.size() > 0 || corridorEntities.size() > 0) { + if (!desktopEntities.isEmpty() || !corridorEntities.isEmpty()) { airlockCountdownSeconds--; if (airlockCountdownSeconds <= 0) { @@ -180,14 +180,14 @@ public void tick(ServerLevel level) { // Lock the doors. BlockPos desktopDoorPos = corridorAirlockCenter.north(2); if (level.getBlockEntity(desktopDoorPos) instanceof BulkHeadDoorBlockEntity bulkHeadDoorBlockEntity) { - bulkHeadDoorBlockEntity.closeDoor(level, desktopDoorPos, level.getBlockState(desktopDoorPos)); - level.setBlock(desktopDoorPos, level.getBlockState(desktopDoorPos).setValue(BulkHeadDoorBlock.LOCKED, true), 2); + bulkHeadDoorBlockEntity.toggleDoor(level, desktopDoorPos, level.getBlockState(desktopDoorPos), false); + level.setBlock(desktopDoorPos, level.getBlockState(desktopDoorPos).setValue(BulkHeadDoorBlock.LOCKED, true), Block.UPDATE_CLIENTS); } BlockPos corridorDoorBlockPos = new BlockPos(1000, 100, 2); if (level.getBlockEntity(corridorDoorBlockPos) instanceof BulkHeadDoorBlockEntity bulkHeadDoorBlockEntity) { - bulkHeadDoorBlockEntity.closeDoor(level, corridorDoorBlockPos, level.getBlockState(corridorDoorBlockPos)); - level.setBlock(corridorDoorBlockPos, level.getBlockState(corridorDoorBlockPos).setValue(BulkHeadDoorBlock.LOCKED, true), 2); + bulkHeadDoorBlockEntity.toggleDoor(level, corridorDoorBlockPos, level.getBlockState(corridorDoorBlockPos), false); + level.setBlock(corridorDoorBlockPos, level.getBlockState(corridorDoorBlockPos).setValue(BulkHeadDoorBlock.LOCKED, true), Block.UPDATE_CLIENTS); } } } else { @@ -238,19 +238,18 @@ public void tick(ServerLevel level) { } if (airlockTimerSeconds == 7) { - airlockTimerSeconds = 0; this.processingWarping = false; this.airlockTimerSeconds = 20; BlockPos desktopDoorPos = corridorAirlockCenter.north(2); if (level.getBlockEntity(desktopDoorPos) instanceof BulkHeadDoorBlockEntity bulkHeadDoorBlockEntity) { - bulkHeadDoorBlockEntity.openDoor(level, desktopDoorPos, level.getBlockState(desktopDoorPos)); - level.setBlock(desktopDoorPos, level.getBlockState(desktopDoorPos).setValue(BulkHeadDoorBlock.LOCKED, false), 2); + bulkHeadDoorBlockEntity.toggleDoor(level, desktopDoorPos, level.getBlockState(desktopDoorPos), true); + level.setBlock(desktopDoorPos, level.getBlockState(desktopDoorPos).setValue(BulkHeadDoorBlock.LOCKED, false), Block.UPDATE_CLIENTS); } BlockPos corridorDoorBlockPos = new BlockPos(1000, 100, 2); if (level.getBlockEntity(corridorDoorBlockPos) instanceof BulkHeadDoorBlockEntity bulkHeadDoorBlockEntity) { - bulkHeadDoorBlockEntity.openDoor(level, corridorDoorBlockPos, level.getBlockState(corridorDoorBlockPos)); - level.setBlock(corridorDoorBlockPos, level.getBlockState(corridorDoorBlockPos).setValue(BulkHeadDoorBlock.LOCKED, false), 2); + bulkHeadDoorBlockEntity.toggleDoor(level, corridorDoorBlockPos, level.getBlockState(corridorDoorBlockPos), true); + level.setBlock(corridorDoorBlockPos, level.getBlockState(corridorDoorBlockPos).setValue(BulkHeadDoorBlock.LOCKED, false), Block.UPDATE_CLIENTS); } } @@ -293,6 +292,7 @@ public void generateDesktop(DesktopTheme theme) { if (tardisInternalDoor != null) { serverLevel.removeBlock(tardisInternalDoor.getDoorPosition(), false); } + // Generate Corridors if (!this.hasGeneratedCorridors) { TardisArchitectureHandler.generateEssentialCorridors(serverLevel); @@ -324,33 +324,4 @@ public void cancelDesktopChange() { this.isWaitingToGenerate = false; } - /** - * Sets the shell theme ID for the Door block - * @param theme - the Shell Theme ID - * @param setupTardis - if the reason for setting the theme was because the Tardis is being converted from a Root Shell to a fully functioning one or changing desktops. True if that is the case. - */ - public void setShellTheme(ResourceLocation theme, boolean setupTardis) { - if (operator.getInternalDoor() != null){ - BlockPos internalDoorPos = operator.getInternalDoor().getDoorPosition(); - BlockState state = operator.getLevel().getBlockState(internalDoorPos); - - if (setupTardis){ - if (state.getBlock() instanceof RootShellDoorBlock) { - // If the block at the last known location was originally a Root Shell Door (i.e. transforming to a proper Tardis), - // Create a new Global Shell Door instance and copy over all attributes from the existing shell - operator.getLevel().setBlock(internalDoorPos, - BlockRegistry.GLOBAL_SHELL_BLOCK.get().defaultBlockState().setValue(GlobalShellBlock.OPEN, state.getValue(RootedShellBlock.OPEN)) - .setValue(GlobalShellBlock.FACING, state.getValue(RootedShellBlock.FACING)), 2); - } - } - //After handling logic for changing desktops or transforming from root shell to functional Tardis, set the theme for the door block entity - BlockEntity blockEntity = operator.getLevel().getBlockEntity(internalDoorPos); - - if (blockEntity instanceof GlobalDoorBlockEntity doorBlockEntity) { - doorBlockEntity.setShellTheme(theme); - operator.setInternalDoor(doorBlockEntity); - } - - } - } } diff --git a/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisPilotingManager.java b/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisPilotingManager.java index f2529ab88..3321660a9 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisPilotingManager.java +++ b/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisPilotingManager.java @@ -3,7 +3,6 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; -import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerLevel; import net.minecraft.sounds.SoundSource; import net.minecraft.tags.FluidTags; @@ -14,19 +13,20 @@ import net.minecraft.world.phys.Vec3; import whocraft.tardis_refined.api.event.TardisEvents; import whocraft.tardis_refined.common.capability.TardisLevelOperator; +import whocraft.tardis_refined.common.capability.upgrades.IncrementUpgrade; +import whocraft.tardis_refined.common.capability.upgrades.Upgrade; import whocraft.tardis_refined.common.capability.upgrades.UpgradeHandler; import whocraft.tardis_refined.common.capability.upgrades.Upgrades; import whocraft.tardis_refined.common.tardis.TardisArchitectureHandler; import whocraft.tardis_refined.common.tardis.TardisNavLocation; -import whocraft.tardis_refined.common.tardis.themes.ShellTheme; -import whocraft.tardis_refined.common.util.RegistryHelper; import whocraft.tardis_refined.constants.NbtConstants; import whocraft.tardis_refined.registry.SoundRegistry; import java.util.ArrayList; +import java.util.Collections; import java.util.List; -public class TardisPilotingManager { +public class TardisPilotingManager extends BaseHandler{ // CONSTANTS private static final int TICKS_LANDING_MAX = 9 * 20; @@ -57,7 +57,6 @@ public boolean isCrashing() { private int cordIncrementIndex = 0; private boolean autoLand = false; - private ResourceLocation currentExteriorTheme; public TardisPilotingManager(TardisLevelOperator operator) { this.operator = operator; @@ -71,16 +70,27 @@ public boolean isAutoLandSet() { return this.autoLand; } - public ResourceLocation getCurrentExteriorTheme() { - return this.currentExteriorTheme; + + public boolean isOnCooldown() { + return (ticksSinceCrash > 0); } - public void setCurrentExteriorTheme(ResourceLocation theme) { - this.currentExteriorTheme = theme; + /** + * Accessor for the number of ticks since the Tardis crashed. + * @return private field ticksSinceCrash + */ + public int getCooldownTicks() { + return ticksSinceCrash; } - public boolean isOnCooldown() { - return (ticksSinceCrash > 0); + + /** + * A progress value after crashing that determines how long until cooldown has finished. + * Zero means it has only started, 1 means that cooldown has finished. + * @return a percentage value between 0 - 1. + */ + public int getCooldownDuration() { + return ticksSinceCrash / TICKS_COOLDOWN_MAX; } public void endCoolDown() { @@ -97,10 +107,6 @@ public void loadData(CompoundTag tag) { this.ticksSinceCrash = tag.getInt("ticksSinceCrash"); this.canUseControls = tag.getBoolean("canUseControls"); - if (tag.getString(NbtConstants.CONTROL_CURRENT_EXT) != null && !tag.getString(NbtConstants.CONTROL_CURRENT_EXT).isEmpty()) { - this.currentExteriorTheme = new ResourceLocation(tag.getString(NbtConstants.CONTROL_CURRENT_EXT)); - } - if (this.targetLocation == null) { this.targetLocation = TardisNavLocation.ORIGIN; } @@ -108,6 +114,11 @@ public void loadData(CompoundTag tag) { this.cordIncrementIndex = tag.getInt(NbtConstants.CONTROL_INCREMENT_INDEX); } + @Override + public void tick() { + + } + public CompoundTag saveData(CompoundTag tag) { tag.putBoolean(NbtConstants.CONTROL_IS_IN_FLIGHT, this.isInFlight); tag.putBoolean(NbtConstants.CONTROL_AUTOLAND, this.autoLand); @@ -116,9 +127,6 @@ public CompoundTag saveData(CompoundTag tag) { tag.putInt("ticksSinceCrash", this.ticksSinceCrash); tag.putBoolean("canUseControls", this.canUseControls); - if (this.currentExteriorTheme != null) { - tag.putString(NbtConstants.CONTROL_CURRENT_EXT, this.currentExteriorTheme.toString()); - } if (targetLocation != null) { NbtConstants.putTardisNavLocation(tag, "ctrl_target", this.targetLocation); } @@ -174,13 +182,6 @@ public void tick(Level level) { if (ticksCrashing == 1) { onCrashEnd(); } - - - if ((ticksLanding >= 6 * 20 || ticksLanding == 0) && !this.isCrashing()) { - var distanceBetweenWroop = (this.operator.getTardisFlightEventManager().getControlResponses() < this.operator.getTardisFlightEventManager().getRequiredControlRequests()) ? 20 * 1.6 : 20 * 1.75; - if (level.getGameTime() % (distanceBetweenWroop) == 0) - operator.getLevel().playSound(null, operator.getInternalDoor().getDoorPosition(), SoundRegistry.TARDIS_SINGLE_FLY.get(), SoundSource.AMBIENT, 10f, (this.operator.getTardisFlightEventManager().getControlResponses() < this.operator.getTardisFlightEventManager().getRequiredControlRequests()) ? 1.02f : 1f); - } } if (ticksSinceCrash > 0) { @@ -282,7 +283,11 @@ private BlockPos getLegalPosition(Level level, BlockPos pos, int originalY) { return new BlockPos(pos.getX(), originalY, pos.getZ()); } - private boolean isSafeToLand(TardisNavLocation location) + /** Checks the tardis nav location for a variety of reasons that a given position would be unsafe to land at. + * @param location the coordinates to check against + * @return true if safe to land, otherwise false + */ + public boolean isSafeToLand(TardisNavLocation location) { if (!isSolidBlock(location.getLevel(), location.getPosition()) && isSolidBlock(location.getLevel(), location.getPosition().below()) && !isSolidBlock(location.getLevel(), location.getPosition().above())) { return !location.getLevel().getBlockState(location.getPosition().below()).getFluidState().is(FluidTags.LAVA) && !location.getLevel().getBlockState(location.getPosition().below()).getFluidState().is(FluidTags.WATER); @@ -388,17 +393,13 @@ public boolean endFlight() { this.ticksLanding = TICKS_LANDING_MAX; TardisExteriorManager exteriorManager = operator.getExteriorManager(); - TardisInteriorManager interiorManager = operator.getInteriorManager(); + Level level = operator.getLevel(); TardisNavLocation landingLocation = this.targetLocation; TardisNavLocation location = findClosestValidPosition(landingLocation); - exteriorManager.placeExteriorBlock(operator, location); - if (this.currentExteriorTheme != null) { - interiorManager.setShellTheme(this.currentExteriorTheme, false); - } exteriorManager.playSoundAtShell(SoundRegistry.TARDIS_LAND.get(), SoundSource.BLOCKS, 1, 1); level.playSound(null, TardisArchitectureHandler.DESKTOP_CENTER_POS, SoundRegistry.TARDIS_LAND.get(), SoundSource.AMBIENT, 10f, 1f); @@ -461,9 +462,6 @@ public void crash() { var location = findClosestValidPosition(landing); tardisExteriorManager.placeExteriorBlock(operator, location); - if (currentExteriorTheme != null) { - tardisExteriorManager.setShellTheme(this.currentExteriorTheme); - } tardisExteriorManager.playSoundAtShell(SoundRegistry.TARDIS_CRASH_LAND.get(), SoundSource.BLOCKS, 1, 1); tarisLevel.playSound(null, TardisArchitectureHandler.DESKTOP_CENTER_POS, SoundRegistry.TARDIS_CRASH_LAND.get(), SoundSource.BLOCKS, 10f, 1f); @@ -494,6 +492,13 @@ public TardisNavLocation getTargetLocation() { return this.targetLocation; } + /** + * @return the current fast return location + */ + public TardisNavLocation getFastReturnLocation() { + return this.fastReturnLocation; + } + public void setTargetLocation(TardisNavLocation targetLocation) { this.targetLocation = targetLocation; } @@ -516,24 +521,21 @@ public void cycleCordIncrement(int direction) { this.cordIncrementIndex = nextIndex; } - public int[] getCoordinateIncrements(UpgradeHandler upgradeHandler){ + public int[] getCoordinateIncrements(UpgradeHandler upgradeHandler) { List increments = new ArrayList<>(List.of(1, 10, 100)); - if(Upgrades.EXPLORER.get().isUnlocked(upgradeHandler)){ - increments.add(1000); - } - - if(Upgrades.EXPLORER_II.get().isUnlocked(upgradeHandler)){ - increments.add(2500); - } - - if(Upgrades.EXPLORER_III.get().isUnlocked(upgradeHandler)){ - increments.add(5000); + for (Upgrade upgrade : Upgrades.UPGRADE_DEFERRED_REGISTRY.getRegistry()) { + if (upgrade instanceof IncrementUpgrade incrementUpgrade) { + if (upgrade.isUnlocked(upgradeHandler)) { + increments.add(incrementUpgrade.getIncrementAmount()); + } + } } - + Collections.sort(increments); return increments.stream().mapToInt(Integer::intValue).toArray(); } + public boolean shouldThrottleBeDown() { return isInFlight && ticksLanding == 0; } diff --git a/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisWaypointManager.java b/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisWaypointManager.java index 3d0af8563..59e697150 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisWaypointManager.java +++ b/common/src/main/java/whocraft/tardis_refined/common/tardis/manager/TardisWaypointManager.java @@ -7,7 +7,7 @@ import java.util.*; -public class TardisWaypointManager { +public class TardisWaypointManager extends BaseHandler{ private final TardisLevelOperator operator; private Map waypointMap = new HashMap<>(); @@ -33,6 +33,11 @@ public TardisNavLocation getWaypointByName(String name) { return waypointMap.get(name); } + @Override + public void tick() { + + } + public CompoundTag saveData(CompoundTag compoundTag) { ListTag waypointsList = new ListTag(); for (TardisNavLocation location : waypointMap.values()) { diff --git a/common/src/main/java/whocraft/tardis_refined/common/tardis/themes/ShellTheme.java b/common/src/main/java/whocraft/tardis_refined/common/tardis/themes/ShellTheme.java index 5111fe546..31b29975b 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/tardis/themes/ShellTheme.java +++ b/common/src/main/java/whocraft/tardis_refined/common/tardis/themes/ShellTheme.java @@ -6,12 +6,9 @@ import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import whocraft.tardis_refined.TardisRefined; -import whocraft.tardis_refined.constants.ModMessages; import whocraft.tardis_refined.registry.DeferredRegistry; import whocraft.tardis_refined.registry.RegistrySupplierHolder; -import java.util.Locale; - public class ShellTheme implements Theme { /** Registry Key for the ShellTheme registry. For addon mods, use this as the registry key*/ @@ -37,7 +34,22 @@ public class ShellTheme implements Theme { public static final RegistrySupplierHolder GROWTH = registerShellTheme("growth"); public static final RegistrySupplierHolder PORTALOO = registerShellTheme("portaloo"); public static final RegistrySupplierHolder PAGODA = registerShellTheme("pagoda"); + public static final RegistrySupplierHolder LIFT = registerShellTheme("lift"); + public static final RegistrySupplierHolder HIEROGLYPH = registerShellTheme("hieroglyph"); + public static final RegistrySupplierHolder CASTLE = registerShellTheme("castle"); + + public static ShellTheme getShellTheme(ResourceLocation resourceLocation){ + ShellTheme potentialTheme = SHELL_THEME_REGISTRY.get(resourceLocation); + if(potentialTheme != null){ + return potentialTheme; + } + return FACTORY.get(); + } + + public static ResourceLocation getKey(ShellTheme shellTheme){ + return SHELL_THEME_REGISTRY.getKey(shellTheme); + } private ResourceLocation translationKey; diff --git a/common/src/main/java/whocraft/tardis_refined/common/util/TardisHelper.java b/common/src/main/java/whocraft/tardis_refined/common/util/TardisHelper.java index 30fd1b404..fa0f5e316 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/util/TardisHelper.java +++ b/common/src/main/java/whocraft/tardis_refined/common/util/TardisHelper.java @@ -1,5 +1,6 @@ package whocraft.tardis_refined.common.util; +import net.minecraft.core.BlockPos; import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; import whocraft.tardis_refined.common.capability.TardisLevelOperator; @@ -12,4 +13,21 @@ public static void playCloisterBell(TardisLevelOperator tardisLevelOperator) { tardisLevelOperator.getLevel().playSound(null, TardisArchitectureHandler.DESKTOP_CENTER_POS, SoundEvents.BELL_BLOCK, SoundSource.BLOCKS, 1000f, 0.1f); } } + + public static boolean isInArsArea(BlockPos blockPos) { + + BlockPos corner1 = new BlockPos(1009, 97, -2); + BlockPos corner2 = new BlockPos(1041, 118, 30); + + int minX = Math.min(corner1.getX(), corner2.getX()); + int maxX = Math.max(corner1.getX(), corner2.getX()); + int minY = Math.min(corner1.getY(), corner2.getY()); + int maxY = Math.max(corner1.getY(), corner2.getY()); + int minZ = Math.min(corner1.getZ(), corner2.getZ()); + int maxZ = Math.max(corner1.getZ(), corner2.getZ()); + + return blockPos.getX() >= minX && blockPos.getX() <= maxX && + blockPos.getY() >= minY && blockPos.getY() <= maxY && + blockPos.getZ() >= minZ && blockPos.getZ() <= maxZ; + } } diff --git a/common/src/main/java/whocraft/tardis_refined/common/world/feature/NbtTemplateFeature.java b/common/src/main/java/whocraft/tardis_refined/common/world/feature/NbtTemplateFeature.java index 2e02f2019..fce7bc70e 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/world/feature/NbtTemplateFeature.java +++ b/common/src/main/java/whocraft/tardis_refined/common/world/feature/NbtTemplateFeature.java @@ -47,7 +47,7 @@ public boolean place(FeaturePlaceContext context) { posMutable.set(context.origin()); BlockPos offset = new BlockPos(-template.get().getSize().getX() / 2, context.config().heightOffset, -template.get().getSize().getZ() / 2); template.get().placeInWorld(context.level(), posMutable.offset(offset), posMutable.offset(offset), placementSettings, context.random(), Block.UPDATE_CLIENTS); -// System.out.println("Placed template at: " + posMutable.offset(offset).toString()); +// .println("Placed template at: " + posMutable.offset(offset).toString()); return true; } } \ No newline at end of file diff --git a/common/src/main/java/whocraft/tardis_refined/compat/portals/ImmersivePortals.java b/common/src/main/java/whocraft/tardis_refined/compat/portals/ImmersivePortals.java index 49a5d697a..84aa7adf2 100644 --- a/common/src/main/java/whocraft/tardis_refined/compat/portals/ImmersivePortals.java +++ b/common/src/main/java/whocraft/tardis_refined/compat/portals/ImmersivePortals.java @@ -168,7 +168,7 @@ public static boolean onDoorRemoved(Level level, Player player, BlockPos blockPo public static void createPortals(TardisLevelOperator operator) { UUID dimId = UUID.fromString(operator.getLevel().dimension().location().getPath()); - ResourceLocation theme = operator.getExteriorManager().getCurrentTheme(); + ResourceLocation theme = operator.getAestheticHandler().getShellTheme(); TardisInternalDoor door = operator.getInternalDoor(); if (operator.getInteriorManager().isCave() || !operator.getInternalDoor().isOpen() || !operator.isTardisReady() || tardisToPortalsMap.get(dimId) != null || !exteriorHasPortalSupport(theme) || door == null) { @@ -181,7 +181,7 @@ public static void createPortals(TardisLevelOperator operator) { BlockPos exteriorEntryBPos = location.getPosition(); Vec3 exteriorEntryPosition = new Vec3(exteriorEntryBPos.getX() + 0.5, exteriorEntryBPos.getY() + 1, exteriorEntryBPos.getZ() + 0.5); - theme = operator.getExteriorManager().getCurrentTheme(); + theme = operator.getAestheticHandler().getShellTheme(); PortalOffets themeData = themeToOffsetMap.get(theme); switch (location.getDirection()) { diff --git a/common/src/main/java/whocraft/tardis_refined/patterns/ConsolePatterns.java b/common/src/main/java/whocraft/tardis_refined/patterns/ConsolePatterns.java index 9e3864823..99996c68b 100644 --- a/common/src/main/java/whocraft/tardis_refined/patterns/ConsolePatterns.java +++ b/common/src/main/java/whocraft/tardis_refined/patterns/ConsolePatterns.java @@ -1,17 +1,13 @@ package whocraft.tardis_refined.patterns; import net.minecraft.resources.ResourceLocation; -import net.minecraft.server.packs.resources.Resource; import whocraft.tardis_refined.TardisRefined; import whocraft.tardis_refined.common.tardis.themes.ConsoleTheme; import whocraft.tardis_refined.common.tardis.themes.ShellTheme; import whocraft.tardis_refined.common.util.Platform; -import whocraft.tardis_refined.common.util.RegistryHelper; import whocraft.tardis_refined.constants.ResourceConstants; -import java.io.Console; import java.util.*; -import java.util.stream.Collectors; /** * Data manager for all {@link ConsolePattern}(s) @@ -111,6 +107,7 @@ public static ConsolePattern next(List patterns, ConsolePattern private static ConsolePattern addDefaultPattern(ResourceLocation themeId, String patternId, String textureName, boolean hasEmissiveTexture) { List consolePatternList; ConsolePattern pattern = (ConsolePattern) new ConsolePattern(patternId, new PatternTexture(createConsolePatternTextureLocation(themeId,textureName), hasEmissiveTexture)).setThemeId(themeId); + if (DEFAULT_PATTERNS.containsKey(themeId)) { consolePatternList = DEFAULT_PATTERNS.get(themeId); List currentList = new ArrayList<>(); @@ -128,7 +125,9 @@ private static ConsolePattern addDefaultPattern(ResourceLocation themeId, String /** @implSpec INTERNAL USE ONLY */ private static ResourceLocation createConsolePatternTextureLocation(ResourceLocation themeId, String textureName){ - return new ResourceLocation(TardisRefined.MODID, "textures/blockentity/console/" + themeId.getPath().toLowerCase(Locale.ENGLISH) + "/" + textureName + ".png"); + ResourceLocation texture = new ResourceLocation(TardisRefined.MODID, "textures/blockentity/console/" + themeId.getPath().toLowerCase(Locale.ENGLISH) + "/" + textureName + ".png"); + + return texture; } /** Gets a default list of {@link ConsolePattern} added by Tardis Refined. Useful as a fallback list. @@ -165,8 +164,9 @@ public static Map> registerDefaultPattern addDefaultPattern(ConsoleTheme.FACTORY.getId(), "wood", "factory_console_wood", true); /*Toyota*/ - addDefaultPattern(ConsoleTheme.TOYOTA.getId(), "violet", "toyota_texture_purple", true); - addDefaultPattern(ConsoleTheme.TOYOTA.getId(), "blue", "toyota_texture_blue", true); + addDefaultPattern(ConsoleTheme.TOYOTA.getId(), "violet", "toyota_console_purple", true); + addDefaultPattern(ConsoleTheme.TOYOTA.getId(), "blue", "toyota_console_blue", true); + addDefaultPattern(ConsoleTheme.TOYOTA.getId(), "skulk", "toyota_console_skulk", false); /*Crystal*/ addDefaultPattern(ConsoleTheme.CRYSTAL.getId(), "corrupted", "crystal_console_corrupted", true); @@ -190,9 +190,6 @@ public static Map> registerDefaultPattern /*Copper*/ addDefaultPattern(ConsoleTheme.COPPER.getId(), "sculk", "copper_console_sculk", false); - Map> patternsByCollection = new HashMap<>(); - DEFAULT_PATTERNS.entrySet().forEach(entry -> patternsByCollection.put(entry.getKey(), entry.getValue())); - - return patternsByCollection; + return new HashMap<>(DEFAULT_PATTERNS); } } diff --git a/common/src/main/java/whocraft/tardis_refined/patterns/ShellPatterns.java b/common/src/main/java/whocraft/tardis_refined/patterns/ShellPatterns.java index 6e7b51c59..3f32838d7 100644 --- a/common/src/main/java/whocraft/tardis_refined/patterns/ShellPatterns.java +++ b/common/src/main/java/whocraft/tardis_refined/patterns/ShellPatterns.java @@ -8,7 +8,6 @@ import whocraft.tardis_refined.constants.ResourceConstants; import java.util.*; -import java.util.stream.Collectors; /** Data Manager for all {@link ShellPattern}(s) */ public class ShellPatterns { @@ -164,11 +163,12 @@ public static Map> registerDefaultPatterns( addDefaultPattern(shellTheme, pattern); } - addDefaultPattern(ShellTheme.POLICE_BOX.getId(), "marble", false); + //TODO Currently not compatible + /* addDefaultPattern(ShellTheme.POLICE_BOX.getId(), "marble", false); addDefaultPattern(ShellTheme.POLICE_BOX.getId(), "gaudy", false); addDefaultPattern(ShellTheme.POLICE_BOX.getId(), "metal", false); addDefaultPattern(ShellTheme.POLICE_BOX.getId(), "stone", false); - addDefaultPattern(ShellTheme.POLICE_BOX.getId(), "red", false); + addDefaultPattern(ShellTheme.POLICE_BOX.getId(), "red", false);*/ addDefaultPattern(ShellTheme.PHONE_BOOTH.getId(), "metal", false); @@ -183,7 +183,7 @@ public static Map> registerDefaultPatterns( addDefaultPattern(ShellTheme.BIG_BEN.getId(), "gothic", false); Map> patternsByCollection = new HashMap<>(); - DEFAULT_PATTERNS.entrySet().forEach(entry -> patternsByCollection.put(entry.getKey(), entry.getValue())); + patternsByCollection.putAll(DEFAULT_PATTERNS); return patternsByCollection; } diff --git a/common/src/main/java/whocraft/tardis_refined/registry/BlockRegistry.java b/common/src/main/java/whocraft/tardis_refined/registry/BlockRegistry.java index c2bf34df7..eb81ffb0b 100644 --- a/common/src/main/java/whocraft/tardis_refined/registry/BlockRegistry.java +++ b/common/src/main/java/whocraft/tardis_refined/registry/BlockRegistry.java @@ -2,7 +2,6 @@ import net.minecraft.core.registries.Registries; import net.minecraft.world.item.BlockItem; - import net.minecraft.world.item.Item; import net.minecraft.world.level.block.*; import net.minecraft.world.level.block.state.BlockBehaviour; @@ -20,7 +19,6 @@ import whocraft.tardis_refined.common.block.shell.RootedShellBlock; import whocraft.tardis_refined.common.block.shell.ShellBaseBlock; - import java.util.function.Supplier; public class BlockRegistry { @@ -65,9 +63,7 @@ private static RegistrySupplier register(String id, Supplie //////////// REMOVE THESE BLOCKS FROM CREATIVE TABS BEFORE PRODUCTION // ARS Tree - public static final RegistrySupplier ARS_EGG = register("ars_egg", () -> new ArsEggBlock(BlockBehaviour.Properties.of().noOcclusion().strength(3, 3).sound(SoundType.AZALEA_LEAVES).lightLevel((x) -> { - return 12; - })), false, true); + public static final RegistrySupplier ARS_EGG = register("ars_egg", () -> new ArsEggBlock(BlockBehaviour.Properties.of().noOcclusion().strength(3, 3).sound(SoundType.AZALEA_LEAVES).lightLevel((x) -> 12)), true, true); public static final RegistrySupplier ARS_LEAVES = register("ars_leaves", () -> new LeavesBlock(BlockBehaviour.Properties.of().noOcclusion().strength(3, 3).sound(SoundType.AZALEA_LEAVES)), false, true); public static final RegistrySupplier ARS_LEAVES_SLAB = register("ars_leaves_slab", () -> new SlabBlock(BlockBehaviour.Properties.of().noOcclusion().strength(3, 3).sound(SoundType.AZALEA_LEAVES)), false, true); public static final RegistrySupplier ARS_LEAVES_FENCE = register("ars_leaves_fence", () -> new FenceBlock(BlockBehaviour.Properties.of().noOcclusion().strength(3, 3).sound(SoundType.AZALEA_LEAVES)), false, true); diff --git a/common/src/main/java/whocraft/tardis_refined/registry/DeferredRegistry.java b/common/src/main/java/whocraft/tardis_refined/registry/DeferredRegistry.java index 4cd392f16..157ad065f 100644 --- a/common/src/main/java/whocraft/tardis_refined/registry/DeferredRegistry.java +++ b/common/src/main/java/whocraft/tardis_refined/registry/DeferredRegistry.java @@ -2,11 +2,10 @@ import com.mojang.serialization.Codec; import dev.architectury.injectables.annotations.ExpectPlatform; -import net.minecraft.core.Holder; import net.minecraft.core.Registry; import net.minecraft.resources.ResourceKey; +import whocraft.tardis_refined.TardisRefined; -import java.util.Collection; import java.util.function.Supplier; /** Abstraction of a Registry handler based off the design patterns of Forge's DeferredRegister. */ @@ -32,7 +31,7 @@ public abstract class DeferredRegistry { */ @ExpectPlatform public static DeferredRegistry create(String modid, ResourceKey> resourceKey) { - throw new AssertionError(); + throw new RuntimeException(TardisRefined.PLATFORM_ERROR); } /** Gets the underlying Codec for the registry object type, if defined. Currently unused and untested, but added for completeness*/ diff --git a/common/src/main/java/whocraft/tardis_refined/registry/SoundRegistry.java b/common/src/main/java/whocraft/tardis_refined/registry/SoundRegistry.java index b08e8857f..67bf412e4 100644 --- a/common/src/main/java/whocraft/tardis_refined/registry/SoundRegistry.java +++ b/common/src/main/java/whocraft/tardis_refined/registry/SoundRegistry.java @@ -17,6 +17,8 @@ public class SoundRegistry { public static final RegistrySupplier TARDIS_MISC_SPARKLE = setUpSound("tardis_misc_sparkle"); public static final RegistrySupplier STATIC = setUpSound("static"); public static final RegistrySupplier DESTINATION_DING = setUpSound("destination_ding"); + public static final RegistrySupplier ARS_HUM = setUpSound("ars_hum"); + public static final RegistrySupplier TEST_HUM = setUpSound("test_hum"); private static RegistrySupplier setUpSound(String soundName) { SoundEvent sound = SoundEvent.createVariableRangeEvent(new ResourceLocation(TardisRefined.MODID, soundName)); diff --git a/common/src/main/resources/.cache/3fcdc37ad136e2a9e4d043224d2db5bc1dee2659 b/common/src/main/resources/.cache/3fcdc37ad136e2a9e4d043224d2db5bc1dee2659 deleted file mode 100644 index 508060f41..000000000 --- a/common/src/main/resources/.cache/3fcdc37ad136e2a9e4d043224d2db5bc1dee2659 +++ /dev/null @@ -1,15 +0,0 @@ -// 1.20.2 2023-12-08T13:12:13.6653636 Shell Patterns -24c3b07d5ebcb921f1a4014c0c7b7ce1db66d291 data/tardis_refined/tardis_refined/patterns/shell/big_ben.json -c023593375b56bf2ba50df33b355f0f99d062227 data/tardis_refined/tardis_refined/patterns/shell/briefcase.json -cd36b3fb97a42bfdca53b2a4e7c10facbd3e534d data/tardis_refined/tardis_refined/patterns/shell/drifter.json -193b3b2f3ff31321cec1b5286a80fb9f876e51df data/tardis_refined/tardis_refined/patterns/shell/factory.json -117bb1fc61803d65841238ac72d39b2183eefb94 data/tardis_refined/tardis_refined/patterns/shell/groening.json -658cff3bbea9976811061fa653fd85d14700687d data/tardis_refined/tardis_refined/patterns/shell/growth.json -a033e392d5ce58b74e9dd2561b2a3012b49525d2 data/tardis_refined/tardis_refined/patterns/shell/mystic.json -9636dacb9cae8d3d893a7f9bfca195631397973b data/tardis_refined/tardis_refined/patterns/shell/nuka.json -bb9b537f1b29c2414d9284828094163a425bcd70 data/tardis_refined/tardis_refined/patterns/shell/pagoda.json -9acf33da121ce7c83457b3d85c0a92d5ba511efd data/tardis_refined/tardis_refined/patterns/shell/phone_booth.json -67d26906e3655e7f9f08a906b56b225f71248726 data/tardis_refined/tardis_refined/patterns/shell/police_box.json -ba4b42fe3655f24a4263e59b614b0644229730a8 data/tardis_refined/tardis_refined/patterns/shell/portaloo.json -fdc997718013ffac35fe5192e0fbf32b60323720 data/tardis_refined/tardis_refined/patterns/shell/present.json -23066a16183502e0751e16f152356bde64f17045 data/tardis_refined/tardis_refined/patterns/shell/vending.json diff --git a/common/src/main/resources/.cache/c8f6ff9084a307ea1af670e22b8331798da837dd b/common/src/main/resources/.cache/c8f6ff9084a307ea1af670e22b8331798da837dd deleted file mode 100644 index 81b54a9c0..000000000 --- a/common/src/main/resources/.cache/c8f6ff9084a307ea1af670e22b8331798da837dd +++ /dev/null @@ -1,10 +0,0 @@ -// 1.20.2 2023-12-08T13:12:13.66236 Desktops -8e290467b025585e036665aeea036bf64ce4d426 data/tardis_refined/tardis_refined/desktops/copper.json -0cb37ac84ef411b9f87e44982707c19b2d472ea4 data/tardis_refined/tardis_refined/desktops/coral.json -c5455603c085cc04066d5f1e978cfebb9e49c77f data/tardis_refined/tardis_refined/desktops/crystal.json -caa01a065c70723320877c993617d0baf83fdb3b data/tardis_refined/tardis_refined/desktops/factory.json -e57d3827b830650835799d05abebbb1e74ca4057 data/tardis_refined/tardis_refined/desktops/future_nostalgia.json -12f560415238878ffcfb90cf8a4140de4a0814c7 data/tardis_refined/tardis_refined/desktops/nuka.json -69d8853b7525df9c3a5cd116f5d2cb945b096ef3 data/tardis_refined/tardis_refined/desktops/toyota.json -87d3c88c292d764642f3799405284d65dacd5e9e data/tardis_refined/tardis_refined/desktops/victorian.json -12a0c0450520bdf8619b12ee5404962ca43152e5 data/tardis_refined/tardis_refined/desktops/violet_eye.json diff --git a/common/src/main/resources/.cache/fb1d1450e45f24c16ff9548196e396cd1616c0aa b/common/src/main/resources/.cache/fb1d1450e45f24c16ff9548196e396cd1616c0aa deleted file mode 100644 index c819ac7e5..000000000 --- a/common/src/main/resources/.cache/fb1d1450e45f24c16ff9548196e396cd1616c0aa +++ /dev/null @@ -1,10 +0,0 @@ -// 1.20.2 2023-12-08T13:12:13.6643619 Console Patterns -2f482aa36f9bc5c30c7906230e20e11bb5cdb3c6 data/tardis_refined/tardis_refined/patterns/console/copper.json -80cef81ade3d59acf7c629be03ca07ceb29b4e45 data/tardis_refined/tardis_refined/patterns/console/coral.json -51ac36a16e84686df192a41a2c1dc966e266c836 data/tardis_refined/tardis_refined/patterns/console/crystal.json -48a1bed0f7c2bf7cd844873b4eb4e11e4166bd99 data/tardis_refined/tardis_refined/patterns/console/factory.json -64fc65e5823a648314b73165d693eab62a85208c data/tardis_refined/tardis_refined/patterns/console/initiative.json -0bd91ac43a05c679ec7386cccaa85956f785625a data/tardis_refined/tardis_refined/patterns/console/myst.json -a8045d394dd1b80fcaa677ebb72e05dc33b18bf5 data/tardis_refined/tardis_refined/patterns/console/nuka.json -0e55fb4cab79ccaa85601c19661b33ab5557b3e9 data/tardis_refined/tardis_refined/patterns/console/toyota.json -c694be5c89584cf128d98c962e0f739b7098fe5a data/tardis_refined/tardis_refined/patterns/console/victorian.json diff --git a/common/src/main/resources/assets/tardis_refined/lang/en_us.json b/common/src/main/resources/assets/tardis_refined/lang/en_us.json deleted file mode 100644 index 73c3a32de..000000000 --- a/common/src/main/resources/assets/tardis_refined/lang/en_us.json +++ /dev/null @@ -1,124 +0,0 @@ -{ - "block.tardis_refined.air_lock_generator": "Air Lock Generator", - "block.tardis_refined.ars_egg": "ARS Egg", - "block.tardis_refined.ars_leaves": "ARS Leaves", - "block.tardis_refined.ars_leaves_fence": "ARS Fence", - "block.tardis_refined.ars_leaves_slab": "ARS Slab", - "block.tardis_refined.bulk_head_door": "Bulk Head Door", - "block.tardis_refined.console_configuration": "Console Configurator", - "block.tardis_refined.flight_detector": "Flight Detector", - "block.tardis_refined.growth_stone": "Growth Stone", - "block.tardis_refined.hardened_growth_stone": "Hardened Growth Stone", - "block.tardis_refined.internal_door_block": "Internal Door", - "block.tardis_refined.landing_pad": "Landing Pad", - "block.tardis_refined.root_plant": "Root Plant", - "block.tardis_refined.root_shell": "Root Shell", - "block.tardis_refined.root_shell_door": "Root Door", - "block.tardis_refined.tardis_console": "Console", - "block.tardis_refined.tardis_door": "Tardis Door", - "block.tardis_refined.tardis_shell": "TARDIS", - "block.tardis_refined.terraformer": "Terraformer", - "command.tardis_refined.dim_not_a_tardis": "§c%s is not a TARDIS Dimension!", - "command.tardis_refined.export_desktop.fail": "§cFailed to export desktop %s!", - "command.tardis_refined.export_desktop.in_progress": "Generating datapack for desktop %s, this may take some time depending on the structure's size...", - "command.tardis_refined.export_desktop.resource_pack": "§9To define the Desktop's preview image, please create a Resource Pack. See some example Resource Packs at: %s", - "command.tardis_refined.export_desktop.success": "§aSuccessfully exported desktop %s to datapack %s! Use the %s command to see changes.", - "command.tardis_refined.no_internal_door": "§cNo Internal Door found in dimension %s! Consider using the default teleport command %s", - "config.tardis_refined.banned_dimensions": "Banned Dimensions", - "config.tardis_refined.console_idle_animations": "Play idle console animations", - "config.tardis_refined.control_names": "Render control names?", - "config.tardis_refined.immersive_portals": "Immersive Portals Compatibility?", - "control.tardis_refined.cord_x": "X", - "control.tardis_refined.cord_y": "Y", - "control.tardis_refined.cord_z": "Z", - "control.tardis_refined.dimension": "Dimension", - "control.tardis_refined.door_toggle": "Door Toggle", - "control.tardis_refined.fast_return": "Fast Return", - "control.tardis_refined.increment": "Increment", - "control.tardis_refined.monitor": "Computer Bank", - "control.tardis_refined.random": "Randomizer", - "control.tardis_refined.rotate": "Direction", - "control.tardis_refined.throttle": "Throttle", - "entity.tardis_refined.console_control": "Generic Control", - "gui.tardis_refined.buy_ability": "Purchase Upgrade?", - "gui.tardis_refined.upgrades": "Tardis Upgrades", - "item.tardis_refined.drill": "Growth Drill", - "item.tardis_refined.keychain": "Tardis Keyset", - "item.tardis_refined.pattern_manipulator": "Pattern Manipulator", - "item.tardis_refined.tardis_key": "Tardis Key", - "itemGroup.tardis_refined": "Tardis Refined", - "itemGroup.tardis_refined.tardis_refined": "Tardis Refined", - "message.tardis_refined.exterior_cooldown": "You must wait %s seconds", - "message.tardis_refined.key_bound": "Key Bound to %s", - "message.tardis_refined.key_cycled": "Main: %s", - "message.tardis_refined.selected": "Selected: %s", - "shell.tardis_refined.big_ben": "Big Ben", - "shell.tardis_refined.briefcase": "Briefcase", - "shell.tardis_refined.drifter": "Drifter", - "shell.tardis_refined.factory": "Factory", - "shell.tardis_refined.groening": "Groening", - "shell.tardis_refined.growth": "Growth", - "shell.tardis_refined.mystic": "Mystic", - "shell.tardis_refined.nuka": "Nuka", - "shell.tardis_refined.pagoda": "Pagoda", - "shell.tardis_refined.phone_booth": "Phone Booth", - "shell.tardis_refined.police_box": "Police Box", - "shell.tardis_refined.portaloo": "Portaloo", - "shell.tardis_refined.present": "Present", - "shell.tardis_refined.vending": "Vending Machine", - "sound.pattern_manipulator.subtitle": "Pattern Manipulator activates", - "sound.static.subtitle": "Screen display static", - "sound.tardis_crash_land.subtitle": "TARDIS crash lands", - "sound.tardis_land.subtitle": "TARDIS lands", - "sound.tardis_misc_sparkle.subtitle": "TARDIS arriving", - "sound.tardis_single_fly.subtitle": "TARDIS flies", - "sound.tardis_takeoff.subtitle": "TARDIS takes off", - "sound.time_blast.subtitle": "Time Vortex blast", - "tooltip.tardis_refined.tardis_list": "Key Set:", - "ui.tardis_refined.desktop_selection": "DESKTOP CONFIGURATION", - "ui.tardis_refined.monitor.cancel_desktop": "Would you like to cancel the upcoming reconfiguration?", - "ui.tardis_refined.monitor.desktop": "DESKTOP CONFIGURATION", - "ui.tardis_refined.monitor.desktop_cancel": "Cancel Desktop Reconfiguration", - "ui.tardis_refined.monitor.desktop_cancel.title": "OPERATION IN PROGRESS", - "ui.tardis_refined.monitor.desktop_cancel_description": "Systems disabled as a Desktop reconfiguration has been scheduled.", - "ui.tardis_refined.monitor.external_shell": "EXTERNAL SHELL CONFIGURATION", - "ui.tardis_refined.monitor.issues": "Issues:", - "ui.tardis_refined.monitor.list.selection": "Currently selected: &s", - "ui.tardis_refined.monitor.main.destination": "Destination", - "ui.tardis_refined.monitor.main.gps": "GPS", - "ui.tardis_refined.monitor.main_title": "COMPUTER BANK", - "ui.tardis_refined.monitor.no.waypoints": "No Waypoints Saved!", - "ui.tardis_refined.monitor.upgrades": "UPGRADES", - "ui.tardis_refined.monitor.upload": "Upload", - "ui.tardis_refined.monitor.upload.coords": "COORD NAVIGATION", - "ui.tardis_refined.monitor.upload.waypoints": "WAYPOINT NAVIGATION", - "ui.tardis_refined.monitor.waypoint_name": "Waypoint Name:", - "ui.tardis_refined.monitor.waypoints": "WAYPOINTS", - "ui.tardis_refined.shell_selection": "EXTERNAL SHELL CONFIGURATION", - "upgrade.tardis_refined.architecture_system": "Architecture", - "upgrade.tardis_refined.architecture_system.description": "Enables TARDIS Architecture Upgrades", - "upgrade.tardis_refined.chameleon_circuit_system": "Chameleon Circuit", - "upgrade.tardis_refined.chameleon_circuit_system.description": "Allows the TARDIS to change it's shape", - "upgrade.tardis_refined.coordinate_input": "Coordinate Input", - "upgrade.tardis_refined.coordinate_input.description": "Allows the Pilot to input coordinates with the monitor", - "upgrade.tardis_refined.defense_system": "Defense System", - "upgrade.tardis_refined.defense_system.description": "Enables Defense Protocols", - "upgrade.tardis_refined.explorer": "Explorer I", - "upgrade.tardis_refined.explorer.description": "1000k Increment", - "upgrade.tardis_refined.explorer_ii": "Explorer II", - "upgrade.tardis_refined.explorer_ii.description": "2500k Increment", - "upgrade.tardis_refined.explorer_iii": "Explorer III", - "upgrade.tardis_refined.explorer_iii.description": "5000k Increment", - "upgrade.tardis_refined.hostile_displacement": "Hostile Action Displacement", - "upgrade.tardis_refined.hostile_displacement.description": "Enables the displacement of the TARDIS when attacked", - "upgrade.tardis_refined.inside_architecture": "Desktop Reconfiguration", - "upgrade.tardis_refined.inside_architecture.description": "Allows the Pilot to change the appearance of the TARDIS Desktop", - "upgrade.tardis_refined.materialize_around": "Materialize Around", - "upgrade.tardis_refined.materialize_around.description": "Allows the TARDIS to have entities enter while materalizing", - "upgrade.tardis_refined.navigation_system": "Navigation System", - "upgrade.tardis_refined.navigation_system.description": "Allows upgrades to the TARDIS Navigation System", - "upgrade.tardis_refined.tardis_xp": "System Upgrades", - "upgrade.tardis_refined.tardis_xp.description": "Allows upgrades to the TARDIS", - "upgrade.tardis_refined.waypoints": "Waypoints", - "upgrade.tardis_refined.waypoints.description": "Allows the Pilot to create saved locations" -} \ No newline at end of file diff --git a/common/src/main/resources/assets/tardis_refined/models/block/flight_detector.json b/common/src/main/resources/assets/tardis_refined/models/block/flight_detector.json index 5dc57bad3..ca2808e72 100644 --- a/common/src/main/resources/assets/tardis_refined/models/block/flight_detector.json +++ b/common/src/main/resources/assets/tardis_refined/models/block/flight_detector.json @@ -6,6 +6,7 @@ "1": "tardis_refined:block/flight_detector", "particle": "tardis_refined:block/flight_detector" }, + "render_type" : "cutout", "elements": [ { "from": [1, 0, 1], diff --git a/common/src/main/resources/assets/tardis_refined/sounds/tardis/ars/ars_hum.ogg b/common/src/main/resources/assets/tardis_refined/sounds/tardis/ars/ars_hum.ogg new file mode 100644 index 000000000..a1349ecfa Binary files /dev/null and b/common/src/main/resources/assets/tardis_refined/sounds/tardis/ars/ars_hum.ogg differ diff --git a/common/src/main/resources/assets/tardis_refined/sounds/tardis/test_hum.ogg b/common/src/main/resources/assets/tardis_refined/sounds/tardis/test_hum.ogg new file mode 100644 index 000000000..22b2abf6b Binary files /dev/null and b/common/src/main/resources/assets/tardis_refined/sounds/tardis/test_hum.ogg differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/blockentity/console/nuka/nuka emission.png b/common/src/main/resources/assets/tardis_refined/textures/blockentity/console/nuka/nuka emission.png index af69a97e0..405b78d73 100644 Binary files a/common/src/main/resources/assets/tardis_refined/textures/blockentity/console/nuka/nuka emission.png and b/common/src/main/resources/assets/tardis_refined/textures/blockentity/console/nuka/nuka emission.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/blockentity/console/nuka/nuka_console.png b/common/src/main/resources/assets/tardis_refined/textures/blockentity/console/nuka/nuka_console.png index d968edbfe..ecd69ceee 100644 Binary files a/common/src/main/resources/assets/tardis_refined/textures/blockentity/console/nuka/nuka_console.png and b/common/src/main/resources/assets/tardis_refined/textures/blockentity/console/nuka/nuka_console.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/blockentity/console/toyota/toyota_texture_blue.png b/common/src/main/resources/assets/tardis_refined/textures/blockentity/console/toyota/toyota_console_blue.png similarity index 100% rename from common/src/main/resources/assets/tardis_refined/textures/blockentity/console/toyota/toyota_texture_blue.png rename to common/src/main/resources/assets/tardis_refined/textures/blockentity/console/toyota/toyota_console_blue.png diff --git a/common/src/main/resources/assets/tardis_refined/textures/blockentity/console/toyota/toyota_texture_blue_emissive.png b/common/src/main/resources/assets/tardis_refined/textures/blockentity/console/toyota/toyota_console_blue_emissive.png similarity index 100% rename from common/src/main/resources/assets/tardis_refined/textures/blockentity/console/toyota/toyota_texture_blue_emissive.png rename to common/src/main/resources/assets/tardis_refined/textures/blockentity/console/toyota/toyota_console_blue_emissive.png diff --git a/common/src/main/resources/assets/tardis_refined/textures/blockentity/console/toyota/toyota_texture_purple.png b/common/src/main/resources/assets/tardis_refined/textures/blockentity/console/toyota/toyota_console_purple.png similarity index 100% rename from common/src/main/resources/assets/tardis_refined/textures/blockentity/console/toyota/toyota_texture_purple.png rename to common/src/main/resources/assets/tardis_refined/textures/blockentity/console/toyota/toyota_console_purple.png diff --git a/common/src/main/resources/assets/tardis_refined/textures/blockentity/console/toyota/toyota_texture_purple_emissive.png b/common/src/main/resources/assets/tardis_refined/textures/blockentity/console/toyota/toyota_console_purple_emissive.png similarity index 100% rename from common/src/main/resources/assets/tardis_refined/textures/blockentity/console/toyota/toyota_texture_purple_emissive.png rename to common/src/main/resources/assets/tardis_refined/textures/blockentity/console/toyota/toyota_console_purple_emissive.png diff --git a/common/src/main/resources/assets/tardis_refined/textures/blockentity/console/toyota/toyota_console_skulk.png b/common/src/main/resources/assets/tardis_refined/textures/blockentity/console/toyota/toyota_console_skulk.png new file mode 100644 index 000000000..f2159983c Binary files /dev/null and b/common/src/main/resources/assets/tardis_refined/textures/blockentity/console/toyota/toyota_console_skulk.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/blockentity/life/ars_egg.png b/common/src/main/resources/assets/tardis_refined/textures/blockentity/life/ars_egg.png index 7caedf660..251452e60 100644 Binary files a/common/src/main/resources/assets/tardis_refined/textures/blockentity/life/ars_egg.png and b/common/src/main/resources/assets/tardis_refined/textures/blockentity/life/ars_egg.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/blockentity/life/ars_egg_emissive.png b/common/src/main/resources/assets/tardis_refined/textures/blockentity/life/ars_egg_emissive.png index 6194dd368..eb74ca5a2 100644 Binary files a/common/src/main/resources/assets/tardis_refined/textures/blockentity/life/ars_egg_emissive.png and b/common/src/main/resources/assets/tardis_refined/textures/blockentity/life/ars_egg_emissive.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/castle/castle.png b/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/castle/castle.png new file mode 100644 index 000000000..6769350f2 Binary files /dev/null and b/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/castle/castle.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/castle/castle_interior.png b/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/castle/castle_interior.png new file mode 100644 index 000000000..32c4276e2 Binary files /dev/null and b/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/castle/castle_interior.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/factory/factory.png b/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/factory/factory.png index fc379497b..4ff415bd9 100644 Binary files a/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/factory/factory.png and b/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/factory/factory.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/factory/factory_interior.png b/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/factory/factory_interior.png index 1efad017c..51cf566d7 100644 Binary files a/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/factory/factory_interior.png and b/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/factory/factory_interior.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/hieroglyph/hieroglyph.png b/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/hieroglyph/hieroglyph.png new file mode 100644 index 000000000..f98c8fd2d Binary files /dev/null and b/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/hieroglyph/hieroglyph.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/hieroglyph/hieroglyph_interior.png b/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/hieroglyph/hieroglyph_interior.png new file mode 100644 index 000000000..04336335b Binary files /dev/null and b/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/hieroglyph/hieroglyph_interior.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/lift/lift.png b/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/lift/lift.png new file mode 100644 index 000000000..855b6c5e1 Binary files /dev/null and b/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/lift/lift.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/lift/lift_interior.png b/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/lift/lift_interior.png new file mode 100644 index 000000000..3a322f886 Binary files /dev/null and b/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/lift/lift_interior.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/police_box/police_box.png b/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/police_box/police_box.png index 5079e7a25..f8ea7584b 100644 Binary files a/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/police_box/police_box.png and b/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/police_box/police_box.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/police_box/police_box_emissive.png b/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/police_box/police_box_emissive.png index 36c85aed1..8e91eab5a 100644 Binary files a/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/police_box/police_box_emissive.png and b/common/src/main/resources/assets/tardis_refined/textures/blockentity/shell/police_box/police_box_emissive.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/desktops/shalka.png b/common/src/main/resources/assets/tardis_refined/textures/gui/desktops/shalka.png new file mode 100644 index 000000000..ee812abf7 Binary files /dev/null and b/common/src/main/resources/assets/tardis_refined/textures/gui/desktops/shalka.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/trash.png b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/trash.png index fce9355a1..2074e311c 100644 Binary files a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/trash.png and b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/trash.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/alt_hexagon_frame_obtained.mcmeta b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/alt_hexagon_frame_obtained.mcmeta new file mode 100644 index 000000000..552ec0fd2 --- /dev/null +++ b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/alt_hexagon_frame_obtained.mcmeta @@ -0,0 +1,9 @@ +{ + "gui": { + "scaling": { + "type": "tile" , + "width": 26, + "height": 26 + } + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/alt_hexagon_frame_obtained.png b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/alt_hexagon_frame_obtained.png new file mode 100644 index 000000000..ed8a77c0c Binary files /dev/null and b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/alt_hexagon_frame_obtained.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/alt_hexagon_frame_unobtained.mcmeta b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/alt_hexagon_frame_unobtained.mcmeta new file mode 100644 index 000000000..552ec0fd2 --- /dev/null +++ b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/alt_hexagon_frame_unobtained.mcmeta @@ -0,0 +1,9 @@ +{ + "gui": { + "scaling": { + "type": "tile" , + "width": 26, + "height": 26 + } + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/alt_hexagon_frame_unobtained.png b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/alt_hexagon_frame_unobtained.png new file mode 100644 index 000000000..f569b5964 Binary files /dev/null and b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/alt_hexagon_frame_unobtained.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/box_obtained.mcmeta b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/box_obtained.mcmeta new file mode 100644 index 000000000..95b3311c4 --- /dev/null +++ b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/box_obtained.mcmeta @@ -0,0 +1,9 @@ +{ + "gui": { + "scaling": { + "type": "tile" , + "width": 200, + "height": 26 + } + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/box_obtained.png b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/box_obtained.png new file mode 100644 index 000000000..a8d8f947e Binary files /dev/null and b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/box_obtained.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/box_unobtained.mcmeta b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/box_unobtained.mcmeta new file mode 100644 index 000000000..95b3311c4 --- /dev/null +++ b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/box_unobtained.mcmeta @@ -0,0 +1,9 @@ +{ + "gui": { + "scaling": { + "type": "tile" , + "width": 200, + "height": 26 + } + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/box_unobtained.png b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/box_unobtained.png new file mode 100644 index 000000000..f0f592b97 Binary files /dev/null and b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/box_unobtained.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/exterior_frame_blue.mcmeta b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/exterior_frame_blue.mcmeta new file mode 100644 index 000000000..552ec0fd2 --- /dev/null +++ b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/exterior_frame_blue.mcmeta @@ -0,0 +1,9 @@ +{ + "gui": { + "scaling": { + "type": "tile" , + "width": 26, + "height": 26 + } + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/exterior_frame_blue.png b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/exterior_frame_blue.png new file mode 100644 index 000000000..e35833059 Binary files /dev/null and b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/exterior_frame_blue.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/exterior_frame_obtained.mcmeta b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/exterior_frame_obtained.mcmeta new file mode 100644 index 000000000..552ec0fd2 --- /dev/null +++ b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/exterior_frame_obtained.mcmeta @@ -0,0 +1,9 @@ +{ + "gui": { + "scaling": { + "type": "tile" , + "width": 26, + "height": 26 + } + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/exterior_frame_obtained.png b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/exterior_frame_obtained.png new file mode 100644 index 000000000..6ce4fa6d4 Binary files /dev/null and b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/exterior_frame_obtained.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/exterior_frame_unobtained.mcmeta b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/exterior_frame_unobtained.mcmeta new file mode 100644 index 000000000..552ec0fd2 --- /dev/null +++ b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/exterior_frame_unobtained.mcmeta @@ -0,0 +1,9 @@ +{ + "gui": { + "scaling": { + "type": "tile" , + "width": 26, + "height": 26 + } + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/exterior_frame_unobtained.png b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/exterior_frame_unobtained.png new file mode 100644 index 000000000..70dbe29df Binary files /dev/null and b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/exterior_frame_unobtained.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/gallifreyan_frame_obtained.mcmeta b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/gallifreyan_frame_obtained.mcmeta new file mode 100644 index 000000000..552ec0fd2 --- /dev/null +++ b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/gallifreyan_frame_obtained.mcmeta @@ -0,0 +1,9 @@ +{ + "gui": { + "scaling": { + "type": "tile" , + "width": 26, + "height": 26 + } + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/gallifreyan_frame_obtained.png b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/gallifreyan_frame_obtained.png new file mode 100644 index 000000000..14f94869e Binary files /dev/null and b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/gallifreyan_frame_obtained.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/gallifreyan_frame_unobtained.png b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/gallifreyan_frame_unobtained.png new file mode 100644 index 000000000..0caf216b6 Binary files /dev/null and b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/gallifreyan_frame_unobtained.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/lock.mcmeta b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/lock.mcmeta new file mode 100644 index 000000000..552ec0fd2 --- /dev/null +++ b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/lock.mcmeta @@ -0,0 +1,9 @@ +{ + "gui": { + "scaling": { + "type": "tile" , + "width": 26, + "height": 26 + } + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/lock.png b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/lock.png new file mode 100644 index 000000000..071c2d215 Binary files /dev/null and b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/lock.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/upgrade_frame_obtained.mcmeta b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/upgrade_frame_obtained.mcmeta new file mode 100644 index 000000000..552ec0fd2 --- /dev/null +++ b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/upgrade_frame_obtained.mcmeta @@ -0,0 +1,9 @@ +{ + "gui": { + "scaling": { + "type": "tile" , + "width": 26, + "height": 26 + } + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/upgrade_frame_obtained.png b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/upgrade_frame_obtained.png new file mode 100644 index 000000000..4e5f09c7c Binary files /dev/null and b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/upgrade_frame_obtained.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/upgrade_frame_unobtained.mcmeta b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/upgrade_frame_unobtained.mcmeta new file mode 100644 index 000000000..552ec0fd2 --- /dev/null +++ b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/upgrade_frame_unobtained.mcmeta @@ -0,0 +1,9 @@ +{ + "gui": { + "scaling": { + "type": "tile" , + "width": 26, + "height": 26 + } + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/upgrade_frame_unobtained.png b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/upgrade_frame_unobtained.png new file mode 100644 index 000000000..f8a2e75d7 Binary files /dev/null and b/common/src/main/resources/assets/tardis_refined/textures/gui/sprites/upgrades/upgrade_frame_unobtained.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/upgrades/upgrades.png b/common/src/main/resources/assets/tardis_refined/textures/gui/upgrades/upgrades.png index 9b016091b..88fdf8aec 100644 Binary files a/common/src/main/resources/assets/tardis_refined/textures/gui/upgrades/upgrades.png and b/common/src/main/resources/assets/tardis_refined/textures/gui/upgrades/upgrades.png differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/upgrades/widgets.png b/common/src/main/resources/assets/tardis_refined/textures/gui/upgrades/widgets.png deleted file mode 100644 index 9918a62c0..000000000 Binary files a/common/src/main/resources/assets/tardis_refined/textures/gui/upgrades/widgets.png and /dev/null differ diff --git a/common/src/main/resources/assets/tardis_refined/textures/gui/upgrades/window.png b/common/src/main/resources/assets/tardis_refined/textures/gui/upgrades/window.png index 9c6fcbb67..765b626fe 100644 Binary files a/common/src/main/resources/assets/tardis_refined/textures/gui/upgrades/window.png and b/common/src/main/resources/assets/tardis_refined/textures/gui/upgrades/window.png differ diff --git a/common/src/main/resources/data/tardis_refined/structures/desktop/shalka.nbt b/common/src/main/resources/data/tardis_refined/structures/desktop/shalka.nbt new file mode 100644 index 000000000..3933901f6 Binary files /dev/null and b/common/src/main/resources/data/tardis_refined/structures/desktop/shalka.nbt differ diff --git a/common/src/main/resources/data/tardis_refined/structures/rooms/ars/room_ars_stage_five.nbt b/common/src/main/resources/data/tardis_refined/structures/rooms/ars/room_ars_stage_five.nbt index 541b7bfdc..3a30909d9 100644 Binary files a/common/src/main/resources/data/tardis_refined/structures/rooms/ars/room_ars_stage_five.nbt and b/common/src/main/resources/data/tardis_refined/structures/rooms/ars/room_ars_stage_five.nbt differ diff --git a/common/src/main/resources/data/tardis_refined/structures/rooms/ars/room_ars_stage_four.nbt b/common/src/main/resources/data/tardis_refined/structures/rooms/ars/room_ars_stage_four.nbt index d3f4dac95..58e69e6db 100644 Binary files a/common/src/main/resources/data/tardis_refined/structures/rooms/ars/room_ars_stage_four.nbt and b/common/src/main/resources/data/tardis_refined/structures/rooms/ars/room_ars_stage_four.nbt differ diff --git a/common/src/main/resources/data/tardis_refined/structures/rooms/ars/room_ars_stage_one.nbt b/common/src/main/resources/data/tardis_refined/structures/rooms/ars/room_ars_stage_one.nbt index 717b89487..27b9761ce 100644 Binary files a/common/src/main/resources/data/tardis_refined/structures/rooms/ars/room_ars_stage_one.nbt and b/common/src/main/resources/data/tardis_refined/structures/rooms/ars/room_ars_stage_one.nbt differ diff --git a/common/src/main/resources/data/tardis_refined/structures/rooms/ars/room_ars_stage_three.nbt b/common/src/main/resources/data/tardis_refined/structures/rooms/ars/room_ars_stage_three.nbt index cc81ae9ad..409bd5198 100644 Binary files a/common/src/main/resources/data/tardis_refined/structures/rooms/ars/room_ars_stage_three.nbt and b/common/src/main/resources/data/tardis_refined/structures/rooms/ars/room_ars_stage_three.nbt differ diff --git a/common/src/main/resources/data/tardis_refined/structures/rooms/ars/room_ars_stage_two.nbt b/common/src/main/resources/data/tardis_refined/structures/rooms/ars/room_ars_stage_two.nbt index a0763516e..ed430039e 100644 Binary files a/common/src/main/resources/data/tardis_refined/structures/rooms/ars/room_ars_stage_two.nbt and b/common/src/main/resources/data/tardis_refined/structures/rooms/ars/room_ars_stage_two.nbt differ diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/copper.json b/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/copper.json deleted file mode 100644 index d6552e38d..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/copper.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "tardis_refined:copper", - "name_component": "{\"color\":\"gold\",\"text\":\"Copper\"}", - "structure": "tardis_refined:desktop/copper" -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/coral.json b/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/coral.json deleted file mode 100644 index 12ac4ee0a..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/coral.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "tardis_refined:coral", - "name_component": "{\"color\":\"gold\",\"text\":\"Coral\"}", - "structure": "tardis_refined:desktop/coral" -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/crystal.json b/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/crystal.json deleted file mode 100644 index 194a1f5a2..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/crystal.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "tardis_refined:crystal", - "name_component": "{\"color\":\"gold\",\"text\":\"Crystal\"}", - "structure": "tardis_refined:desktop/crystal" -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/factory.json b/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/factory.json deleted file mode 100644 index 3534227bc..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/factory.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "tardis_refined:factory", - "name_component": "{\"color\":\"gold\",\"text\":\"Factory\"}", - "structure": "tardis_refined:desktop/factory" -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/future_nostalgia.json b/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/future_nostalgia.json deleted file mode 100644 index 4b277b024..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/future_nostalgia.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "tardis_refined:future_nostalgia", - "name_component": "{\"color\":\"gold\",\"text\":\"Future Nostalgia\"}", - "structure": "tardis_refined:desktop/future_nostalgia" -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/nuka.json b/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/nuka.json deleted file mode 100644 index 3ef6e70a9..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/nuka.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "tardis_refined:nuka", - "name_component": "{\"color\":\"gold\",\"text\":\"Nuka\"}", - "structure": "tardis_refined:desktop/nuka" -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/toyota.json b/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/toyota.json deleted file mode 100644 index 3e8bdbd65..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/toyota.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "tardis_refined:toyota", - "name_component": "{\"color\":\"gold\",\"text\":\"Toyota\"}", - "structure": "tardis_refined:desktop/toyota" -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/victorian.json b/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/victorian.json deleted file mode 100644 index a6c291652..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/victorian.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "tardis_refined:victorian", - "name_component": "{\"color\":\"gold\",\"text\":\"Victorian\"}", - "structure": "tardis_refined:desktop/victorian" -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/violet_eye.json b/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/violet_eye.json deleted file mode 100644 index b5ea19b0d..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/desktops/violet_eye.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "tardis_refined:violet_eye", - "name_component": "{\"color\":\"gold\",\"text\":\"Violet Eye\"}", - "structure": "tardis_refined:desktop/violet_eye" -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/copper.json b/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/copper.json deleted file mode 100644 index 5d3cc5f14..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/copper.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "patterns": [ - { - "id": "tardis_refined:default", - "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}", - "texture_definition": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/console/copper/copper_console.png" - } - }, - { - "id": "tardis_refined:sculk", - "name_component": "{\"color\":\"yellow\",\"text\":\"Sculk\"}", - "texture_definition": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/console/copper/copper_console_sculk.png" - } - } - ] -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/coral.json b/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/coral.json deleted file mode 100644 index 7588a5afb..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/coral.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "patterns": [ - { - "id": "tardis_refined:default", - "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}", - "texture_definition": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/console/coral/coral_console.png" - } - }, - { - "id": "tardis_refined:war", - "name_component": "{\"color\":\"yellow\",\"text\":\"War\"}", - "texture_definition": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/console/coral/coral_console_war.png" - } - }, - { - "id": "tardis_refined:blue", - "name_component": "{\"color\":\"yellow\",\"text\":\"Blue\"}", - "texture_definition": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/console/coral/coral_console_blue.png" - } - } - ] -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/crystal.json b/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/crystal.json deleted file mode 100644 index 2d91ae2c4..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/crystal.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "patterns": [ - { - "id": "tardis_refined:default", - "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}", - "texture_definition": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/console/crystal/crystal_console.png" - } - }, - { - "id": "tardis_refined:corrupted", - "name_component": "{\"color\":\"yellow\",\"text\":\"Corrupted\"}", - "texture_definition": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/console/crystal/crystal_console_corrupted.png" - } - } - ] -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/factory.json b/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/factory.json deleted file mode 100644 index 439ec26fa..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/factory.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "patterns": [ - { - "id": "tardis_refined:default", - "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}", - "texture_definition": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/console/factory/factory_console.png" - } - }, - { - "id": "tardis_refined:vintage", - "name_component": "{\"color\":\"yellow\",\"text\":\"Vintage\"}", - "texture_definition": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/console/factory/factory_console_vintage.png" - } - }, - { - "id": "tardis_refined:mint", - "name_component": "{\"color\":\"yellow\",\"text\":\"Mint\"}", - "texture_definition": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/console/factory/factory_console_mint.png" - } - }, - { - "id": "tardis_refined:wood", - "name_component": "{\"color\":\"yellow\",\"text\":\"Wood\"}", - "texture_definition": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/console/factory/factory_console_wood.png" - } - } - ] -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/initiative.json b/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/initiative.json deleted file mode 100644 index 755e88962..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/initiative.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "patterns": [ - { - "id": "tardis_refined:default", - "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}", - "texture_definition": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/console/initiative/initiative_console.png" - } - }, - { - "id": "tardis_refined:aperture", - "name_component": "{\"color\":\"yellow\",\"text\":\"Aperture\"}", - "texture_definition": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/console/initiative/initiative_console_aperture.png" - } - }, - { - "id": "tardis_refined:blue", - "name_component": "{\"color\":\"yellow\",\"text\":\"Blue\"}", - "texture_definition": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/console/initiative/initiative_console_blue.png" - } - }, - { - "id": "tardis_refined:construction", - "name_component": "{\"color\":\"yellow\",\"text\":\"Construction\"}", - "texture_definition": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/console/initiative/initiative_console_construction.png" - } - } - ] -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/myst.json b/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/myst.json deleted file mode 100644 index e487f1137..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/myst.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "patterns": [ - { - "id": "tardis_refined:default", - "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}", - "texture_definition": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/console/myst/myst_console.png" - } - }, - { - "id": "tardis_refined:molten", - "name_component": "{\"color\":\"yellow\",\"text\":\"Molten\"}", - "texture_definition": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/console/myst/myst_console_molten.png" - } - } - ] -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/nuka.json b/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/nuka.json deleted file mode 100644 index 64eaf835c..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/nuka.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "patterns": [ - { - "id": "tardis_refined:default", - "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}", - "texture_definition": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/console/nuka/nuka_console.png" - } - }, - { - "id": "tardis_refined:industrial", - "name_component": "{\"color\":\"yellow\",\"text\":\"Industrial\"}", - "texture_definition": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/console/nuka/nuka_industrial.png" - } - }, - { - "id": "tardis_refined:cool", - "name_component": "{\"color\":\"yellow\",\"text\":\"Cool\"}", - "texture_definition": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/console/nuka/nuka_cool.png" - } - } - ] -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/toyota.json b/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/toyota.json deleted file mode 100644 index 046015247..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/toyota.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "patterns": [ - { - "id": "tardis_refined:default", - "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}", - "texture_definition": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/console/toyota/toyota_console.png" - } - }, - { - "id": "tardis_refined:violet", - "name_component": "{\"color\":\"yellow\",\"text\":\"Violet\"}", - "texture_definition": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/console/toyota/toyota_texture_purple.png" - } - }, - { - "id": "tardis_refined:blue", - "name_component": "{\"color\":\"yellow\",\"text\":\"Blue\"}", - "texture_definition": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/console/toyota/toyota_texture_blue.png" - } - } - ] -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/victorian.json b/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/victorian.json deleted file mode 100644 index c486050e8..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/console/victorian.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "patterns": [ - { - "id": "tardis_refined:default", - "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}", - "texture_definition": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/console/victorian/victorian_console.png" - } - }, - { - "id": "tardis_refined:smissmass", - "name_component": "{\"color\":\"yellow\",\"text\":\"Smissmass\"}", - "texture_definition": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/console/victorian/victorian_console_smissmass.png" - } - }, - { - "id": "tardis_refined:grant", - "name_component": "{\"color\":\"yellow\",\"text\":\"Grant\"}", - "texture_definition": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/console/victorian/victorian_console_grant.png" - } - } - ] -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/big_ben.json b/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/big_ben.json deleted file mode 100644 index 8a7705c29..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/big_ben.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "patterns": [ - { - "exterior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/big_ben/big_ben.png" - }, - "id": "tardis_refined:default", - "interior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/big_ben/big_ben_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}" - }, - { - "exterior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/big_ben/gothic.png" - }, - "id": "tardis_refined:gothic", - "interior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/big_ben/gothic_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Gothic\"}" - } - ] -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/briefcase.json b/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/briefcase.json deleted file mode 100644 index 3d0388639..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/briefcase.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "patterns": [ - { - "exterior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/briefcase/briefcase.png" - }, - "id": "tardis_refined:default", - "interior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/briefcase/briefcase_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}" - }, - { - "exterior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/briefcase/intel.png" - }, - "id": "tardis_refined:intel", - "interior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/briefcase/intel_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Intel\"}" - }, - { - "exterior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/briefcase/metal.png" - }, - "id": "tardis_refined:metal", - "interior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/briefcase/metal_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Metal\"}" - }, - { - "exterior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/briefcase/mesa.png" - }, - "id": "tardis_refined:mesa", - "interior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/briefcase/mesa_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Mesa\"}" - } - ] -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/drifter.json b/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/drifter.json deleted file mode 100644 index 3ac972370..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/drifter.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "patterns": [ - { - "exterior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/drifter/drifter.png" - }, - "id": "tardis_refined:default", - "interior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/drifter/drifter_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}" - } - ] -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/mystic.json b/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/mystic.json deleted file mode 100644 index 1007c84f8..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/mystic.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "patterns": [ - { - "exterior": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/shell/mystic/mystic.png" - }, - "id": "tardis_refined:default", - "interior": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/shell/mystic/mystic_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}" - }, - { - "exterior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/mystic/dwarven.png" - }, - "id": "tardis_refined:dwarven", - "interior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/mystic/dwarven_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Dwarven\"}" - } - ] -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/nuka.json b/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/nuka.json deleted file mode 100644 index dbbf196d1..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/nuka.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "patterns": [ - { - "exterior": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/shell/nuka/nuka.png" - }, - "id": "tardis_refined:default", - "interior": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/shell/nuka/nuka_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}" - } - ] -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/pagoda.json b/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/pagoda.json deleted file mode 100644 index dc2c29726..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/pagoda.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "patterns": [ - { - "exterior": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/shell/pagoda/pagoda.png" - }, - "id": "tardis_refined:default", - "interior": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/shell/pagoda/pagoda_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}" - } - ] -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/phone_booth.json b/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/phone_booth.json deleted file mode 100644 index 880533546..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/phone_booth.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "patterns": [ - { - "exterior": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/shell/phone_booth/phone_booth.png" - }, - "id": "tardis_refined:default", - "interior": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/shell/phone_booth/phone_booth_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}" - }, - { - "exterior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/phone_booth/metal.png" - }, - "id": "tardis_refined:metal", - "interior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/phone_booth/metal_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Metal\"}" - } - ] -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/police_box.json b/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/police_box.json deleted file mode 100644 index 9c57ffe0c..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/police_box.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "patterns": [ - { - "exterior": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/shell/police_box/police_box.png" - }, - "id": "tardis_refined:default", - "interior": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/shell/police_box/police_box_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}" - }, - { - "exterior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/police_box/marble.png" - }, - "id": "tardis_refined:marble", - "interior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/police_box/marble_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Marble\"}" - }, - { - "exterior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/police_box/gaudy.png" - }, - "id": "tardis_refined:gaudy", - "interior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/police_box/gaudy_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Gaudy\"}" - }, - { - "exterior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/police_box/metal.png" - }, - "id": "tardis_refined:metal", - "interior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/police_box/metal_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Metal\"}" - }, - { - "exterior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/police_box/stone.png" - }, - "id": "tardis_refined:stone", - "interior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/police_box/stone_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Stone\"}" - }, - { - "exterior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/police_box/red.png" - }, - "id": "tardis_refined:red", - "interior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/police_box/red_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Red\"}" - } - ] -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/portaloo.json b/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/portaloo.json deleted file mode 100644 index 096f1cc13..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/portaloo.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "patterns": [ - { - "exterior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/portaloo/portaloo.png" - }, - "id": "tardis_refined:default", - "interior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/portaloo/portaloo_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}" - } - ] -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/present.json b/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/present.json deleted file mode 100644 index d47e5613b..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/present.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "patterns": [ - { - "exterior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/present/present.png" - }, - "id": "tardis_refined:default", - "interior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/present/present_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}" - }, - { - "exterior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/present/cardboard.png" - }, - "id": "tardis_refined:cardboard", - "interior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/present/cardboard_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Cardboard\"}" - } - ] -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/vending.json b/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/vending.json deleted file mode 100644 index ec6b78cf4..000000000 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/vending.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "patterns": [ - { - "exterior": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/shell/vending/vending.png" - }, - "id": "tardis_refined:default", - "interior": { - "emissive": true, - "texture": "tardis_refined:textures/blockentity/shell/vending/vending_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}" - } - ] -} \ No newline at end of file diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/structures/corridors/corridor_hub_roomless.nbt b/common/src/main/resources/data/tardis_refined/tardis_refined/structures/corridors/corridor_hub_roomless.nbt new file mode 100644 index 000000000..a239b0d65 Binary files /dev/null and b/common/src/main/resources/data/tardis_refined/tardis_refined/structures/corridors/corridor_hub_roomless.nbt differ diff --git a/common/src/main/resources/tardis_refined-common.mixins.json b/common/src/main/resources/tardis_refined-common.mixins.json index 791a6211e..14d4c7e5a 100644 --- a/common/src/main/resources/tardis_refined-common.mixins.json +++ b/common/src/main/resources/tardis_refined-common.mixins.json @@ -9,6 +9,7 @@ "PortalMixin" ], "client": [ + "FogRendererMixin" ], "injectors": { "defaultRequire": 1 diff --git a/common/src/main/resources/tardis_refined.accesswidener b/common/src/main/resources/tardis_refined.accesswidener index a077de846..173383525 100644 --- a/common/src/main/resources/tardis_refined.accesswidener +++ b/common/src/main/resources/tardis_refined.accesswidener @@ -8,4 +8,6 @@ extendable method net/minecraft/world/entity/Entity getBoundingBox ()Lnet/minecr accessible class net/minecraft/core/particles/SimpleParticleType accessible class net/minecraft/core/particles/SimpleParticleType$1 accessible method net/minecraft/server/MinecraftServer wrapRunnable (Ljava/lang/Runnable;)Lnet/minecraft/server/TickTask; -accessible field net/minecraft/server/level/ServerLevel dragonFight Lnet/minecraft/world/level/dimension/end/EndDragonFight; \ No newline at end of file +accessible field net/minecraft/server/level/ServerLevel dragonFight Lnet/minecraft/world/level/dimension/end/EndDragonFight; +accessible method net/minecraft/client/particle/SuspendedParticle (Lnet/minecraft/client/multiplayer/ClientLevel;Lnet/minecraft/client/particle/SpriteSet;DDDDDD)V +accessible field net/minecraft/client/particle/Particle gravity F diff --git a/fabric/build.gradle b/fabric/build.gradle index 8c4501b35..3f65b0b15 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -74,6 +74,7 @@ dependencies { modCompileOnly "com.terraformersmc:modmenu:${rootProject.mod_menu_version}" modCompileOnly "curse.maven:jei-238222:${rootProject.jei_fabric_version}" + modImplementation "curse.maven:huge-structure-blocks-474114:4803539" // Forge Config API Port modApi "fuzs.forgeconfigapiport:forgeconfigapiport-fabric:${rootProject.forge_config_api_port_version}" @@ -85,24 +86,24 @@ dependencies { modImplementation ("com.github.iPortalTeam.ImmersivePortalsMod:q_misc_util:v4.0.3-mc1.20.2") modImplementation ("com.github.iPortalTeam.ImmersivePortalsMod:build:v4.0.3-mc1.20.2") - /* // If working on Immersive Portals, change modCompileOnlyApi to modImplementation for the following two entries, this will enable Immersive Portals in Dev - modCompileOnlyApi("com.github.iPortalTeam.ImmersivePortalsMod:imm_ptl_core:${rootProject.immersive_portals_version}") { - exclude(group: "net.fabricmc.fabric-api") - transitive(false) - } - modCompileOnlyApi("com.github.iPortalTeam.ImmersivePortalsMod:q_misc_util:${rootProject.immersive_portals_version}") { - exclude(group: "net.fabricmc.fabric-api") - transitive(false) - } - //Immersive Portals Dependency, not listed on their repo but required for 1.19+ versions - modCompileOnlyApi("com.github.LlamaLad7:MixinExtras:${rootProject.mixin_extras_version}") { - exclude(group: "net.fabricmc.fabric-api") - transitive(false) - } - //Immersive Portals Dependency, not listed on their repo but required for 1.19+ versions - modCompileOnlyApi("me.shedaniel.cloth:cloth-config-fabric:${rootProject.cloth_config_fabric_version}") { - exclude(group: "net.fabricmc.fabric-api") - }*/ + /* // If working on Immersive Portals, change modCompileOnlyApi to modImplementation for the following two entries, this will enable Immersive Portals in Dev + modCompileOnlyApi("com.github.iPortalTeam.ImmersivePortalsMod:imm_ptl_core:${rootProject.immersive_portals_version}") { + exclude(group: "net.fabricmc.fabric-api") + transitive(false) + } + modCompileOnlyApi("com.github.iPortalTeam.ImmersivePortalsMod:q_misc_util:${rootProject.immersive_portals_version}") { + exclude(group: "net.fabricmc.fabric-api") + transitive(false) + } + //Immersive Portals Dependency, not listed on their repo but required for 1.19+ versions + modCompileOnlyApi("com.github.LlamaLad7:MixinExtras:${rootProject.mixin_extras_version}") { + exclude(group: "net.fabricmc.fabric-api") + transitive(false) + } + //Immersive Portals Dependency, not listed on their repo but required for 1.19+ versions + modCompileOnlyApi("me.shedaniel.cloth:cloth-config-fabric:${rootProject.cloth_config_fabric_version}") { + exclude(group: "net.fabricmc.fabric-api") + }*/ // Immersive Portals End @@ -173,14 +174,19 @@ components.java { publishing { publications { - mavenFabric(MavenPublication) { - artifactId = rootProject.archives_base_name + "-" + project.name + mavenForge(MavenPublication) { + artifactId = archives_base_name + "_" + project.name from components.java } } - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. repositories { - // Add repositories to publish to here. + maven { + url = "https://maven.craig.software/repository/whocraft/" + credentials { + username = project.findProperty("MAVEN_REPO_USERNAME") ?: System.getenv("MAVEN_REPO_USERNAME") ?: "" + password = project.findProperty("MAVEN_REPO_PASSWORD") ?: System.getenv("MAVEN_REPO_PASSWORD") ?: "" + } + } } } \ No newline at end of file diff --git a/fabric/src/main/java/whocraft/tardis_refined/common/network/fabric/NetworkManagerImpl.java b/fabric/src/main/java/whocraft/tardis_refined/common/network/fabric/NetworkManagerImpl.java index dc5090233..4b741b5b3 100644 --- a/fabric/src/main/java/whocraft/tardis_refined/common/network/fabric/NetworkManagerImpl.java +++ b/fabric/src/main/java/whocraft/tardis_refined/common/network/fabric/NetworkManagerImpl.java @@ -11,6 +11,7 @@ import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.Entity; import net.minecraft.world.level.block.entity.BlockEntity; +import whocraft.tardis_refined.TardisRefined; import whocraft.tardis_refined.common.network.MessageC2S; import whocraft.tardis_refined.common.network.MessageS2C; import whocraft.tardis_refined.common.network.MessageType; @@ -25,7 +26,7 @@ public NetworkManagerImpl(ResourceLocation channelName) { var msgId = buf.readUtf(); if (!this.toServer.containsKey(msgId)) { - System.out.println("Unknown message id received on server: " + msgId); + TardisRefined.LOGGER.error("Unknown message id received on server: " + msgId); return; } @@ -49,7 +50,7 @@ private void registerClient() { var msgId = buf.readUtf(); if (!this.toClient.containsKey(msgId)) { - System.out.println("Unknown message id received on client: " + msgId); + TardisRefined.LOGGER.error("Unknown message id received on client: " + msgId); return; } @@ -62,7 +63,7 @@ private void registerClient() { @Override public void sendToServer(MessageC2S message) { if (!this.toServer.containsValue(message.getType())) { - System.out.println("Message type not registered: " + message.getType().getId()); + TardisRefined.LOGGER.error("Message type not registered: " + message.getType().getId()); return; } @@ -75,7 +76,7 @@ public void sendToServer(MessageC2S message) { @Override public void sendToPlayer(ServerPlayer player, MessageS2C message) { if (!this.toClient.containsValue(message.getType())) { - System.out.println("Message type not registered: " + message.getType().getId()); + TardisRefined.LOGGER.error("Message type not registered: " + message.getType().getId()); return; } diff --git a/fabric/src/main/java/whocraft/tardis_refined/fabric/TardisRefinedFabric.java b/fabric/src/main/java/whocraft/tardis_refined/fabric/TardisRefinedFabric.java index d086eec79..f824a5b82 100644 --- a/fabric/src/main/java/whocraft/tardis_refined/fabric/TardisRefinedFabric.java +++ b/fabric/src/main/java/whocraft/tardis_refined/fabric/TardisRefinedFabric.java @@ -2,8 +2,10 @@ import fuzs.forgeconfigapiport.api.config.v3.ForgeConfigRegistry; import net.fabricmc.api.ModInitializer; +import net.fabricmc.fabric.api.command.v2.ArgumentTypeRegistry; import net.fabricmc.fabric.api.resource.IdentifiableResourceReloadListener; import net.fabricmc.fabric.api.resource.ResourceManagerHelper; +import net.minecraft.commands.synchronization.SingletonArgumentInfo; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.packs.PackType; import net.minecraft.server.packs.resources.PreparableReloadListener; @@ -12,6 +14,7 @@ import net.neoforged.fml.config.ModConfig; import whocraft.tardis_refined.TRConfig; import whocraft.tardis_refined.TardisRefined; +import whocraft.tardis_refined.command.arguments.UpgradeArgumentType; import whocraft.tardis_refined.common.tardis.TardisDesktops; import whocraft.tardis_refined.common.util.fabric.PlatformImpl; import whocraft.tardis_refined.common.world.fabric.TRFabricBiomeModifiers; @@ -64,6 +67,9 @@ public void onInitialize() { ForgeConfigRegistry.INSTANCE.register(TardisRefined.MODID, ModConfig.Type.CLIENT, TRConfig.CLIENT_SPEC); ForgeConfigRegistry.INSTANCE.register(TardisRefined.MODID, ModConfig.Type.SERVER, TRConfig.SERVER_SPEC); + ArgumentTypeRegistry.registerArgumentType(new ResourceLocation(TardisRefined.MODID, "upgrades"), UpgradeArgumentType.class, SingletonArgumentInfo.contextFree(UpgradeArgumentType::upgradeArgumentType)); + + register(SERVER_DATA, new ResourceLocation(TardisRefined.MODID, TardisRefined.MODID + "/" + "console_patterns"), ConsolePatterns.getReloadListener()); register(SERVER_DATA, new ResourceLocation(TardisRefined.MODID, TardisRefined.MODID + "/" + "desktops"), TardisDesktops.getReloadListener()); diff --git a/fabric/src/main/java/whocraft/tardis_refined/fabric/TardisRefinedFabricClient.java b/fabric/src/main/java/whocraft/tardis_refined/fabric/TardisRefinedFabricClient.java index 9318b4dec..0e700ba5f 100644 --- a/fabric/src/main/java/whocraft/tardis_refined/fabric/TardisRefinedFabricClient.java +++ b/fabric/src/main/java/whocraft/tardis_refined/fabric/TardisRefinedFabricClient.java @@ -7,6 +7,7 @@ import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry; import net.minecraft.client.renderer.RenderType; import net.minecraft.world.level.block.Block; +import whocraft.tardis_refined.TardisRefined; import whocraft.tardis_refined.client.ModelRegistry; import whocraft.tardis_refined.client.ParticleGallifrey; import whocraft.tardis_refined.client.TRParticles; @@ -24,7 +25,6 @@ import whocraft.tardis_refined.registry.BlockEntityRegistry; import whocraft.tardis_refined.registry.BlockRegistry; import whocraft.tardis_refined.registry.EntityRegistry; -import whocraft.tardis_refined.registry.RegistrySupplier; public class TardisRefinedFabricClient implements ClientModInitializer { @Override @@ -40,6 +40,7 @@ public void onInitializeClient() { private void particles() { ParticleFactoryRegistry.getInstance().register(TRParticles.GALLIFREY.get(), (ParticleGallifrey.Provider::new)); + ParticleFactoryRegistry.getInstance().register(TRParticles.ARS_LEAVES.get(), (ParticleGallifrey.ARSVinesParticle::new)); } private void establishBlockEntityRenderers() { @@ -55,8 +56,10 @@ private void establishBlockEntityRenderers() { BlockEntityRendererRegistry.register(BlockEntityRegistry.CONSOLE_CONFIGURATION.get(), ConsoleConfigurationRenderer::new); /*Required to Render Transparency*/ - for (Block entry : BlockRegistry.BLOCKS.getRegistry().stream().toList()) { - BlockRenderLayerMap.INSTANCE.putBlock(entry, RenderType.cutout()); + for (Block block : BlockRegistry.BLOCKS.getRegistry()) { + if(BlockRegistry.BLOCKS.getRegistry().getKey(block).getNamespace().contains(TardisRefined.MODID)){ + BlockRenderLayerMap.INSTANCE.putBlock(block, RenderType.cutout()); + } } } diff --git a/fabric/src/main/java/whocraft/tardis_refined/registry/fabric/DeferredRegistryImpl.java b/fabric/src/main/java/whocraft/tardis_refined/registry/fabric/DeferredRegistryImpl.java index 2ca6b4bbd..5704a6f18 100644 --- a/fabric/src/main/java/whocraft/tardis_refined/registry/fabric/DeferredRegistryImpl.java +++ b/fabric/src/main/java/whocraft/tardis_refined/registry/fabric/DeferredRegistryImpl.java @@ -32,12 +32,9 @@ public static class Impl extends DeferredRegistry { private final String modid; private final WritableRegistry registry; - - private ResourceKey> registryKey; - private final boolean isCustom; - private final boolean syncToClient; + private ResourceKey> registryKey; public Impl(String modid, ResourceKey> resourceKey) { this.modid = modid; @@ -52,8 +49,8 @@ public Impl(String modid, ResourceKey> resourceKey, boolean syncToCl this.registryKey = resourceKey; this.isCustom = true; this.syncToClient = syncToClient; - this.registry = syncToClient ? (MappedRegistry)FabricRegistryBuilder.createSimple(resourceKey).attribute(RegistryAttribute.SYNCED).buildAndRegister() : (MappedRegistry)FabricRegistryBuilder.createSimple(resourceKey).buildAndRegister(); - + this.registry = syncToClient ? (MappedRegistry) FabricRegistryBuilder.createSimple(resourceKey).attribute(RegistryAttribute.SYNCED).buildAndRegister() : (MappedRegistry) FabricRegistryBuilder.createSimple(resourceKey).buildAndRegister(); + } @Override @@ -72,7 +69,7 @@ public RegistrySupplier register(String id, Supplier supplie public RegistrySupplierHolder registerHolder(String id, Supplier sup) { ResourceLocation registeredId = new ResourceLocation(this.modid, id); Registry.register(this.registry, registeredId, sup.get()); //Need to call this to register the object - RegistrySupplierHolder registryHolder = RegistrySupplierHolder.create(this.registryKey, registeredId); //Create the holder, it will automatically bind the underlying value when the object is registered + RegistrySupplierHolder registryHolder = RegistrySupplierHolder.create(this.registryKey, registeredId); //Create the holder, it will automatically bind the underlying value when the object is registered return registryHolder; } diff --git a/forge/build.gradle b/forge/build.gradle index 110ff639d..6015237a1 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -145,17 +145,22 @@ tasks.withType(JavaCompile) { options.encoding = "UTF-8" options.release = 17 } - publishing { publications { mavenForge(MavenPublication) { - artifactId = archives_base_name + "-" + project.name + artifactId = archives_base_name + "_" + project.name from components.java } } - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. repositories { - // Add repositories to publish to here. + maven { + url = "https://maven.craig.software/repository/whocraft/" + credentials { + username = project.findProperty("MAVEN_REPO_USERNAME") ?: System.getenv("MAVEN_REPO_USERNAME") ?: "" + password = project.findProperty("MAVEN_REPO_PASSWORD") ?: System.getenv("MAVEN_REPO_PASSWORD") ?: "" + } + } } -} \ No newline at end of file +} + diff --git a/forge/src/generated/.cache/0533c97ce5395f38717098a1ca49d72068853e57 b/forge/src/generated/.cache/0533c97ce5395f38717098a1ca49d72068853e57 deleted file mode 100644 index 5cbd8e858..000000000 --- a/forge/src/generated/.cache/0533c97ce5395f38717098a1ca49d72068853e57 +++ /dev/null @@ -1,2 +0,0 @@ -// 1.20.2 2023-12-08T14:05:02.102456 Tags for minecraft:entity_type mod id tardis_refined -9c7849fe44abd1038764fb53dff5f0c10322170c data/carryon/tags/entity_types/entity_blacklist.json diff --git a/forge/src/generated/.cache/07cdbcdc6e4f4553ae9ccc48cd1ff0a5be53a01c b/forge/src/generated/.cache/07cdbcdc6e4f4553ae9ccc48cd1ff0a5be53a01c deleted file mode 100644 index 7bbd05619..000000000 --- a/forge/src/generated/.cache/07cdbcdc6e4f4553ae9ccc48cd1ff0a5be53a01c +++ /dev/null @@ -1,2 +0,0 @@ -// 1.20.2 2023-12-08T14:05:02.0970735 Particles -c035f460beb41b955ecff7b545f92f0ac78c4663 assets/tardis_refined/particles/gallifrey.json diff --git a/forge/src/generated/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 b/forge/src/generated/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 deleted file mode 100644 index 37e97fe7d..000000000 --- a/forge/src/generated/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 +++ /dev/null @@ -1,4 +0,0 @@ -// 1.20.2 2023-12-08T14:05:02.1000767 Registries -d9483eb301ed4a4fd91b5f042909997a1bc3085c data/tardis_refined/neoforge/biome_modifier/tardis_root_cluster.json -b3353cf92cff570f9c4ac799f23045aa94b34968 data/tardis_refined/worldgen/configured_feature/tardis_root_cluster.json -0694927b6b3eb72bf137510f370a1d6133dc7795 data/tardis_refined/worldgen/placed_feature/tardis_root_cluster.json diff --git a/forge/src/generated/.cache/1605092b5c78c792538553a3583c4f114827efd2 b/forge/src/generated/.cache/1605092b5c78c792538553a3583c4f114827efd2 deleted file mode 100644 index 244909b88..000000000 --- a/forge/src/generated/.cache/1605092b5c78c792538553a3583c4f114827efd2 +++ /dev/null @@ -1,18 +0,0 @@ -// 1.20.2 2023-12-08T14:05:02.1000767 Item Models: tardis_refined -ce4f5ab23d604af7306a4aa1c128e8e308263554 assets/tardis_refined/models/item/air_lock_generator.json -961ce6420a6ff1952ba49ee162d130a3e8134815 assets/tardis_refined/models/item/ars_egg.json -436ee865aed07b4b30a5fb30ffd3c96ce04bd050 assets/tardis_refined/models/item/ars_leaves.json -f2290296596e42692e3c0ecfec473e7542aa48fc assets/tardis_refined/models/item/ars_leaves_fence.json -4004392fa2d43cfbea8150aec67c92230d8cee7a assets/tardis_refined/models/item/ars_leaves_fence_inventory.json -2749267654975a35cf5b20bc22c1faa9efc1cd52 assets/tardis_refined/models/item/ars_leaves_slab.json -0d6a0b165d3da445d389d1dec01a25f36e371b29 assets/tardis_refined/models/item/bulk_head_door.json -69fa0a4ee3775580367f0932ed9dfbc304ceb74f assets/tardis_refined/models/item/flight_detector.json -9603c27b39b619b3ae309e4922408da574fb825b assets/tardis_refined/models/item/growth_stone.json -e84c82ff2261eb425d01af1d8955b453030f1e3d assets/tardis_refined/models/item/hardened_growth_stone.json -e443b939c06c12bb2a0a7aa6ecf3b647fc3d2e3d assets/tardis_refined/models/item/landing_pad.json -7a891c1445d34b88904a4f7478b34483528ea911 assets/tardis_refined/models/item/root_shell.json -0c8a9b32be3b551d8adfb9111b88dd8b9bf00d59 assets/tardis_refined/models/item/root_shell_door.json -9651f7a379b48d60e4b39eefabf120ddd66ddde4 assets/tardis_refined/models/item/tardis_console.json -4a9a293a5aede6107d0f2996d8ab74ecd0079ed9 assets/tardis_refined/models/item/tardis_door.json -d184035b2f50a9994776a7f1b78e671ea3c5c32f assets/tardis_refined/models/item/tardis_shell.json -5617f3afe1436109b041856c874dc4379a379a32 assets/tardis_refined/models/item/terraformer.json diff --git a/forge/src/generated/.cache/3fcdc37ad136e2a9e4d043224d2db5bc1dee2659 b/forge/src/generated/.cache/3fcdc37ad136e2a9e4d043224d2db5bc1dee2659 deleted file mode 100644 index 3a249707f..000000000 --- a/forge/src/generated/.cache/3fcdc37ad136e2a9e4d043224d2db5bc1dee2659 +++ /dev/null @@ -1,15 +0,0 @@ -// 1.20.2 2023-12-08T13:22:25.9285182 Shell Patterns -24c3b07d5ebcb921f1a4014c0c7b7ce1db66d291 data/tardis_refined/tardis_refined/patterns/shell/big_ben.json -c023593375b56bf2ba50df33b355f0f99d062227 data/tardis_refined/tardis_refined/patterns/shell/briefcase.json -cd36b3fb97a42bfdca53b2a4e7c10facbd3e534d data/tardis_refined/tardis_refined/patterns/shell/drifter.json -193b3b2f3ff31321cec1b5286a80fb9f876e51df data/tardis_refined/tardis_refined/patterns/shell/factory.json -117bb1fc61803d65841238ac72d39b2183eefb94 data/tardis_refined/tardis_refined/patterns/shell/groening.json -658cff3bbea9976811061fa653fd85d14700687d data/tardis_refined/tardis_refined/patterns/shell/growth.json -a033e392d5ce58b74e9dd2561b2a3012b49525d2 data/tardis_refined/tardis_refined/patterns/shell/mystic.json -9636dacb9cae8d3d893a7f9bfca195631397973b data/tardis_refined/tardis_refined/patterns/shell/nuka.json -bb9b537f1b29c2414d9284828094163a425bcd70 data/tardis_refined/tardis_refined/patterns/shell/pagoda.json -9acf33da121ce7c83457b3d85c0a92d5ba511efd data/tardis_refined/tardis_refined/patterns/shell/phone_booth.json -67d26906e3655e7f9f08a906b56b225f71248726 data/tardis_refined/tardis_refined/patterns/shell/police_box.json -ba4b42fe3655f24a4263e59b614b0644229730a8 data/tardis_refined/tardis_refined/patterns/shell/portaloo.json -fdc997718013ffac35fe5192e0fbf32b60323720 data/tardis_refined/tardis_refined/patterns/shell/present.json -23066a16183502e0751e16f152356bde64f17045 data/tardis_refined/tardis_refined/patterns/shell/vending.json diff --git a/forge/src/generated/.cache/735031f3addf80804addae5e3f53249900116f1e b/forge/src/generated/.cache/735031f3addf80804addae5e3f53249900116f1e deleted file mode 100644 index c203321a8..000000000 --- a/forge/src/generated/.cache/735031f3addf80804addae5e3f53249900116f1e +++ /dev/null @@ -1,2 +0,0 @@ -// 1.20.2 2023-12-08T13:23:39.187254 Sound Definitions -c2d5cde702b331f487e487fa5a7eb27d62ec6264 assets/tardis_refined/sounds.json diff --git a/forge/src/generated/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/forge/src/generated/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e deleted file mode 100644 index 9b5cf8d2e..000000000 --- a/forge/src/generated/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ /dev/null @@ -1,19 +0,0 @@ -// 1.20.2 2023-12-08T14:05:02.0990759 Recipes -8719cd0f4220434f5c4e19b250d9baf0b7962d26 data/tardis_refined/advancements/recipes/misc/bulk_head_door.json -8269c68dc027027860af7f3e0ffac15e933a3fe7 data/tardis_refined/advancements/recipes/misc/console_configuration.json -d920b09dc43fa8d136406e6e132abfb8f6edcacc data/tardis_refined/advancements/recipes/misc/drill.json -550c3b58da6896b2547f1285e429c9ecd5c9f3c3 data/tardis_refined/advancements/recipes/misc/flight_detector.json -3517c6c5d953a58d80a1fb7b27b107811b494061 data/tardis_refined/advancements/recipes/misc/landing_pad.json -c4dd71075e63198517197c864403feb215e88940 data/tardis_refined/advancements/recipes/misc/pattern_manipulator.json -ab9e449cb689e170d95e6e715310a87d6ab4a3cb data/tardis_refined/advancements/recipes/misc/tardis_door.json -c4dd25640e0a886e45c91898700a2c35fdb92074 data/tardis_refined/advancements/recipes/misc/tardis_key.json -7dee5b3df1d2cbe4c056edfcb5aab5054102a4ac data/tardis_refined/advancements/recipes/misc/terraformer.json -d400b9f20cbd1dc0bc11a850635fa28b966ff7d5 data/tardis_refined/recipes/bulk_head_door.json -4666b8617b9a065d2c926af0f7fb6821ed0c1b20 data/tardis_refined/recipes/console_configuration.json -d1e2989b203305af597e11a55886a4758c149e8d data/tardis_refined/recipes/drill.json -aeff2b97cf7999f3ce94958e601a9de47a063e64 data/tardis_refined/recipes/flight_detector.json -abf11434010283396343e74ef6aec49e1c020d50 data/tardis_refined/recipes/landing_pad.json -35b8e0b89942aac1d2f8d6f5d967e521f7660d95 data/tardis_refined/recipes/pattern_manipulator.json -ea79ad37e912cd79d17a666c0bc06646963f0109 data/tardis_refined/recipes/tardis_door.json -d78e7ff5d11dec76ca7b4ed68c8380fd4f69d917 data/tardis_refined/recipes/tardis_key.json -1ea9085cfa97ca1288b71b9c1bd9e0977d60d7ec data/tardis_refined/recipes/terraformer.json diff --git a/forge/src/generated/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 b/forge/src/generated/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 deleted file mode 100644 index 7fa7a7bf3..000000000 --- a/forge/src/generated/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 +++ /dev/null @@ -1,2 +0,0 @@ -// 1.20.2 2023-12-08T13:23:39.1857505 Languages: en_us -2dd6aa5d96fcf587687695d4a1c75d6affe4953f assets/tardis_refined/lang/en_us.json diff --git a/forge/src/generated/.cache/c8f6ff9084a307ea1af670e22b8331798da837dd b/forge/src/generated/.cache/c8f6ff9084a307ea1af670e22b8331798da837dd deleted file mode 100644 index c4d972b3d..000000000 --- a/forge/src/generated/.cache/c8f6ff9084a307ea1af670e22b8331798da837dd +++ /dev/null @@ -1,10 +0,0 @@ -// 1.20.2 2023-12-08T13:22:25.9255147 Desktops -8e290467b025585e036665aeea036bf64ce4d426 data/tardis_refined/tardis_refined/desktops/copper.json -0cb37ac84ef411b9f87e44982707c19b2d472ea4 data/tardis_refined/tardis_refined/desktops/coral.json -c5455603c085cc04066d5f1e978cfebb9e49c77f data/tardis_refined/tardis_refined/desktops/crystal.json -caa01a065c70723320877c993617d0baf83fdb3b data/tardis_refined/tardis_refined/desktops/factory.json -e57d3827b830650835799d05abebbb1e74ca4057 data/tardis_refined/tardis_refined/desktops/future_nostalgia.json -12f560415238878ffcfb90cf8a4140de4a0814c7 data/tardis_refined/tardis_refined/desktops/nuka.json -69d8853b7525df9c3a5cd116f5d2cb945b096ef3 data/tardis_refined/tardis_refined/desktops/toyota.json -87d3c88c292d764642f3799405284d65dacd5e9e data/tardis_refined/tardis_refined/desktops/victorian.json -12a0c0450520bdf8619b12ee5404962ca43152e5 data/tardis_refined/tardis_refined/desktops/violet_eye.json diff --git a/forge/src/generated/.cache/e7bc600dadd489865d6fbbde8c1c01bd136d8060 b/forge/src/generated/.cache/e7bc600dadd489865d6fbbde8c1c01bd136d8060 deleted file mode 100644 index 6465cd287..000000000 --- a/forge/src/generated/.cache/e7bc600dadd489865d6fbbde8c1c01bd136d8060 +++ /dev/null @@ -1,3 +0,0 @@ -// 1.20.2 2023-12-08T14:05:02.098075 Tags for minecraft:worldgen/biome mod id tardis_refined -daa082500631e40fc8cc0cbb30f66a6f937a9471 data/tardis_refined/tags/worldgen/biome/collections/is_mountain_or_ocean.json -545a86cfeda00b9ec3a93f53755d7d212e4f18b2 data/tardis_refined/tags/worldgen/biome/has_structure/tardis_root_cluster.json diff --git a/forge/src/generated/.cache/f681b33583ec37ab445ac361e38402e069dc01f6 b/forge/src/generated/.cache/f681b33583ec37ab445ac361e38402e069dc01f6 deleted file mode 100644 index f8ec88552..000000000 --- a/forge/src/generated/.cache/f681b33583ec37ab445ac361e38402e069dc01f6 +++ /dev/null @@ -1,8 +0,0 @@ -// 1.20.2 2023-12-08T14:05:02.1014553 Tags for minecraft:block mod id tardis_refined -0e47996afffcdda5ea92f1f1147ef01691440a6e data/minecraft/tags/blocks/dragon_immune.json -870aa664161fb6f022473fecdd8e1e1105b476ac data/minecraft/tags/blocks/fences.json -1be1c1975b768bb05f7b50c206454433f0d615d1 data/minecraft/tags/blocks/leaves.json -cfeef3aee9d9815bc6a51c4d46cd709c1e896e26 data/minecraft/tags/blocks/mineable/pickaxe.json -b1417b641a7d7ea7e72a0d1f5276749a6995e569 data/minecraft/tags/blocks/needs_iron_tool.json -8615de07fd2fa07b903c95f462bedde3df5f96f5 data/minecraft/tags/blocks/slabs.json -0e47996afffcdda5ea92f1f1147ef01691440a6e data/minecraft/tags/blocks/wither_immune.json diff --git a/forge/src/generated/.cache/fb1d1450e45f24c16ff9548196e396cd1616c0aa b/forge/src/generated/.cache/fb1d1450e45f24c16ff9548196e396cd1616c0aa deleted file mode 100644 index 48d4970e6..000000000 --- a/forge/src/generated/.cache/fb1d1450e45f24c16ff9548196e396cd1616c0aa +++ /dev/null @@ -1,10 +0,0 @@ -// 1.20.2 2023-12-08T13:22:25.9275175 Console Patterns -2f482aa36f9bc5c30c7906230e20e11bb5cdb3c6 data/tardis_refined/tardis_refined/patterns/console/copper.json -80cef81ade3d59acf7c629be03ca07ceb29b4e45 data/tardis_refined/tardis_refined/patterns/console/coral.json -51ac36a16e84686df192a41a2c1dc966e266c836 data/tardis_refined/tardis_refined/patterns/console/crystal.json -48a1bed0f7c2bf7cd844873b4eb4e11e4166bd99 data/tardis_refined/tardis_refined/patterns/console/factory.json -64fc65e5823a648314b73165d693eab62a85208c data/tardis_refined/tardis_refined/patterns/console/initiative.json -0bd91ac43a05c679ec7386cccaa85956f785625a data/tardis_refined/tardis_refined/patterns/console/myst.json -a8045d394dd1b80fcaa677ebb72e05dc33b18bf5 data/tardis_refined/tardis_refined/patterns/console/nuka.json -0e55fb4cab79ccaa85601c19661b33ab5557b3e9 data/tardis_refined/tardis_refined/patterns/console/toyota.json -c694be5c89584cf128d98c962e0f739b7098fe5a data/tardis_refined/tardis_refined/patterns/console/victorian.json diff --git a/forge/src/generated/resources/.cache/0533c97ce5395f38717098a1ca49d72068853e57 b/forge/src/generated/resources/.cache/0533c97ce5395f38717098a1ca49d72068853e57 index 5cbd8e858..cdfa629ac 100644 --- a/forge/src/generated/resources/.cache/0533c97ce5395f38717098a1ca49d72068853e57 +++ b/forge/src/generated/resources/.cache/0533c97ce5395f38717098a1ca49d72068853e57 @@ -1,2 +1,2 @@ -// 1.20.2 2023-12-08T14:05:02.102456 Tags for minecraft:entity_type mod id tardis_refined +// 1.20.2 2023-12-09T00:48:51.7779441 Tags for minecraft:entity_type mod id tardis_refined 9c7849fe44abd1038764fb53dff5f0c10322170c data/carryon/tags/entity_types/entity_blacklist.json diff --git a/forge/src/generated/resources/.cache/07cdbcdc6e4f4553ae9ccc48cd1ff0a5be53a01c b/forge/src/generated/resources/.cache/07cdbcdc6e4f4553ae9ccc48cd1ff0a5be53a01c index 7bbd05619..f2f2a6325 100644 --- a/forge/src/generated/resources/.cache/07cdbcdc6e4f4553ae9ccc48cd1ff0a5be53a01c +++ b/forge/src/generated/resources/.cache/07cdbcdc6e4f4553ae9ccc48cd1ff0a5be53a01c @@ -1,2 +1,3 @@ -// 1.20.2 2023-12-08T14:05:02.0970735 Particles +// 1.20.2 2023-12-13T15:41:19.7516606 Particles +8cb6f3514bfe24e046149cf8e8442f7ed5315b8f assets/tardis_refined/particles/ars_leaves.json c035f460beb41b955ecff7b545f92f0ac78c4663 assets/tardis_refined/particles/gallifrey.json diff --git a/forge/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 b/forge/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 index 37e97fe7d..57189c9bd 100644 --- a/forge/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 +++ b/forge/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 @@ -1,4 +1,4 @@ -// 1.20.2 2023-12-08T14:05:02.1000767 Registries +// 1.20.2 2023-12-09T00:48:51.7754985 Registries d9483eb301ed4a4fd91b5f042909997a1bc3085c data/tardis_refined/neoforge/biome_modifier/tardis_root_cluster.json b3353cf92cff570f9c4ac799f23045aa94b34968 data/tardis_refined/worldgen/configured_feature/tardis_root_cluster.json 0694927b6b3eb72bf137510f370a1d6133dc7795 data/tardis_refined/worldgen/placed_feature/tardis_root_cluster.json diff --git a/forge/src/generated/resources/.cache/1605092b5c78c792538553a3583c4f114827efd2 b/forge/src/generated/resources/.cache/1605092b5c78c792538553a3583c4f114827efd2 index 244909b88..99588f5b0 100644 --- a/forge/src/generated/resources/.cache/1605092b5c78c792538553a3583c4f114827efd2 +++ b/forge/src/generated/resources/.cache/1605092b5c78c792538553a3583c4f114827efd2 @@ -1,4 +1,4 @@ -// 1.20.2 2023-12-08T14:05:02.1000767 Item Models: tardis_refined +// 1.20.2 2023-12-09T00:48:51.7769417 Item Models: tardis_refined ce4f5ab23d604af7306a4aa1c128e8e308263554 assets/tardis_refined/models/item/air_lock_generator.json 961ce6420a6ff1952ba49ee162d130a3e8134815 assets/tardis_refined/models/item/ars_egg.json 436ee865aed07b4b30a5fb30ffd3c96ce04bd050 assets/tardis_refined/models/item/ars_leaves.json diff --git a/forge/src/generated/resources/.cache/3fcdc37ad136e2a9e4d043224d2db5bc1dee2659 b/forge/src/generated/resources/.cache/3fcdc37ad136e2a9e4d043224d2db5bc1dee2659 index 76e2783b7..306031f8f 100644 --- a/forge/src/generated/resources/.cache/3fcdc37ad136e2a9e4d043224d2db5bc1dee2659 +++ b/forge/src/generated/resources/.cache/3fcdc37ad136e2a9e4d043224d2db5bc1dee2659 @@ -1,15 +1,18 @@ -// 1.20.2 2023-12-08T14:05:02.0970735 Shell Patterns +// 1.20.2 2023-12-18T17:52:51.3188952 Shell Patterns 24c3b07d5ebcb921f1a4014c0c7b7ce1db66d291 data/tardis_refined/tardis_refined/patterns/shell/big_ben.json c023593375b56bf2ba50df33b355f0f99d062227 data/tardis_refined/tardis_refined/patterns/shell/briefcase.json +0c683f48298e8e97709fa8f659a659440e35dc61 data/tardis_refined/tardis_refined/patterns/shell/castle.json cd36b3fb97a42bfdca53b2a4e7c10facbd3e534d data/tardis_refined/tardis_refined/patterns/shell/drifter.json 193b3b2f3ff31321cec1b5286a80fb9f876e51df data/tardis_refined/tardis_refined/patterns/shell/factory.json 117bb1fc61803d65841238ac72d39b2183eefb94 data/tardis_refined/tardis_refined/patterns/shell/groening.json 658cff3bbea9976811061fa653fd85d14700687d data/tardis_refined/tardis_refined/patterns/shell/growth.json +140b9e06b02281adb059d98166534bc8651ed90b data/tardis_refined/tardis_refined/patterns/shell/hieroglyph.json +52f7594b699059050be5feb39544050dc5fb0735 data/tardis_refined/tardis_refined/patterns/shell/lift.json a033e392d5ce58b74e9dd2561b2a3012b49525d2 data/tardis_refined/tardis_refined/patterns/shell/mystic.json 9636dacb9cae8d3d893a7f9bfca195631397973b data/tardis_refined/tardis_refined/patterns/shell/nuka.json bb9b537f1b29c2414d9284828094163a425bcd70 data/tardis_refined/tardis_refined/patterns/shell/pagoda.json 9acf33da121ce7c83457b3d85c0a92d5ba511efd data/tardis_refined/tardis_refined/patterns/shell/phone_booth.json -67d26906e3655e7f9f08a906b56b225f71248726 data/tardis_refined/tardis_refined/patterns/shell/police_box.json +d137e095ef4d32650e62dc8cba9a8abdb6634ef2 data/tardis_refined/tardis_refined/patterns/shell/police_box.json ba4b42fe3655f24a4263e59b614b0644229730a8 data/tardis_refined/tardis_refined/patterns/shell/portaloo.json fdc997718013ffac35fe5192e0fbf32b60323720 data/tardis_refined/tardis_refined/patterns/shell/present.json 23066a16183502e0751e16f152356bde64f17045 data/tardis_refined/tardis_refined/patterns/shell/vending.json diff --git a/forge/src/generated/resources/.cache/4dd1d6c274bb02a1ca04c043cc3e81adc6abd533 b/forge/src/generated/resources/.cache/4dd1d6c274bb02a1ca04c043cc3e81adc6abd533 index ce11fc1f9..e9c05d4a7 100644 --- a/forge/src/generated/resources/.cache/4dd1d6c274bb02a1ca04c043cc3e81adc6abd533 +++ b/forge/src/generated/resources/.cache/4dd1d6c274bb02a1ca04c043cc3e81adc6abd533 @@ -1,6 +1,6 @@ -// 1.20.2 2023-12-08T15:41:00.231863 Block States: tardis_refined +// 1.20.2 2023-12-13T15:41:19.7541757 Block States: tardis_refined b8a00271e10524036c2c321dc80eb8a392301f6c assets/tardis_refined/blockstates/air_lock_generator.json -29b0a883484c5efee10dee66ac65aa1072154ee6 assets/tardis_refined/blockstates/ars_egg.json +1ec70f6d41be20660fe5a60a94426a85150e5e48 assets/tardis_refined/blockstates/ars_egg.json 734a9a861a8cf9ce47f1daee3e848263e9810457 assets/tardis_refined/blockstates/ars_leaves.json ead863537dc530acfb593413b41dc0b0e2ae2bc8 assets/tardis_refined/blockstates/ars_leaves_fence.json e065aa83011079e577cce02028d390b3a01d4e07 assets/tardis_refined/blockstates/ars_leaves_slab.json diff --git a/forge/src/generated/resources/.cache/735031f3addf80804addae5e3f53249900116f1e b/forge/src/generated/resources/.cache/735031f3addf80804addae5e3f53249900116f1e index ec3ca61f9..015bf9536 100644 --- a/forge/src/generated/resources/.cache/735031f3addf80804addae5e3f53249900116f1e +++ b/forge/src/generated/resources/.cache/735031f3addf80804addae5e3f53249900116f1e @@ -1,2 +1,2 @@ -// 1.20.2 2023-12-08T14:05:02.1034582 Sound Definitions -c2d5cde702b331f487e487fa5a7eb27d62ec6264 assets/tardis_refined/sounds.json +// 1.20.2 2023-12-15T23:31:01.2684 Sound Definitions +af46e2a431d190adcb7142234979fa721ca75855 assets/tardis_refined/sounds.json diff --git a/forge/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/forge/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index 9b5cf8d2e..01e355213 100644 --- a/forge/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/forge/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,4 +1,4 @@ -// 1.20.2 2023-12-08T14:05:02.0990759 Recipes +// 1.20.2 2023-12-09T00:48:51.7754985 Recipes 8719cd0f4220434f5c4e19b250d9baf0b7962d26 data/tardis_refined/advancements/recipes/misc/bulk_head_door.json 8269c68dc027027860af7f3e0ffac15e933a3fe7 data/tardis_refined/advancements/recipes/misc/console_configuration.json d920b09dc43fa8d136406e6e132abfb8f6edcacc data/tardis_refined/advancements/recipes/misc/drill.json diff --git a/forge/src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 b/forge/src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 index 604a37761..49f17dc43 100644 --- a/forge/src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 +++ b/forge/src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 @@ -1,2 +1,2 @@ -// 1.20.2 2023-12-10T00:25:55.4954903 Languages: en_us -0589363d22ad9b5d62c9fe60277b6cdc760ad086 assets/tardis_refined/lang/en_us.json +// 1.20.2 2023-12-13T17:23:49.2085353 Languages: en_us +918df6357a51f37e6384a7a2a029249d89d8b970 assets/tardis_refined/lang/en_us.json diff --git a/forge/src/generated/resources/.cache/c8f6ff9084a307ea1af670e22b8331798da837dd b/forge/src/generated/resources/.cache/c8f6ff9084a307ea1af670e22b8331798da837dd index 9cf220d7d..d7aa2bfd3 100644 --- a/forge/src/generated/resources/.cache/c8f6ff9084a307ea1af670e22b8331798da837dd +++ b/forge/src/generated/resources/.cache/c8f6ff9084a307ea1af670e22b8331798da837dd @@ -1,10 +1,11 @@ -// 1.20.2 2023-12-08T14:05:02.0948835 Desktops +// 1.20.2 2023-12-16T01:02:27.210493 Desktops 8e290467b025585e036665aeea036bf64ce4d426 data/tardis_refined/tardis_refined/desktops/copper.json 0cb37ac84ef411b9f87e44982707c19b2d472ea4 data/tardis_refined/tardis_refined/desktops/coral.json c5455603c085cc04066d5f1e978cfebb9e49c77f data/tardis_refined/tardis_refined/desktops/crystal.json caa01a065c70723320877c993617d0baf83fdb3b data/tardis_refined/tardis_refined/desktops/factory.json e57d3827b830650835799d05abebbb1e74ca4057 data/tardis_refined/tardis_refined/desktops/future_nostalgia.json 12f560415238878ffcfb90cf8a4140de4a0814c7 data/tardis_refined/tardis_refined/desktops/nuka.json +d625590d682ac9a7d590d54f0ac39bc124d12170 data/tardis_refined/tardis_refined/desktops/shalka.json 69d8853b7525df9c3a5cd116f5d2cb945b096ef3 data/tardis_refined/tardis_refined/desktops/toyota.json 87d3c88c292d764642f3799405284d65dacd5e9e data/tardis_refined/tardis_refined/desktops/victorian.json 12a0c0450520bdf8619b12ee5404962ca43152e5 data/tardis_refined/tardis_refined/desktops/violet_eye.json diff --git a/forge/src/generated/resources/.cache/e7bc600dadd489865d6fbbde8c1c01bd136d8060 b/forge/src/generated/resources/.cache/e7bc600dadd489865d6fbbde8c1c01bd136d8060 index 6465cd287..a580b1d6b 100644 --- a/forge/src/generated/resources/.cache/e7bc600dadd489865d6fbbde8c1c01bd136d8060 +++ b/forge/src/generated/resources/.cache/e7bc600dadd489865d6fbbde8c1c01bd136d8060 @@ -1,3 +1,3 @@ -// 1.20.2 2023-12-08T14:05:02.098075 Tags for minecraft:worldgen/biome mod id tardis_refined +// 1.20.2 2023-12-09T00:48:51.7744808 Tags for minecraft:worldgen/biome mod id tardis_refined daa082500631e40fc8cc0cbb30f66a6f937a9471 data/tardis_refined/tags/worldgen/biome/collections/is_mountain_or_ocean.json 545a86cfeda00b9ec3a93f53755d7d212e4f18b2 data/tardis_refined/tags/worldgen/biome/has_structure/tardis_root_cluster.json diff --git a/forge/src/generated/resources/.cache/f681b33583ec37ab445ac361e38402e069dc01f6 b/forge/src/generated/resources/.cache/f681b33583ec37ab445ac361e38402e069dc01f6 index f8ec88552..ebde07062 100644 --- a/forge/src/generated/resources/.cache/f681b33583ec37ab445ac361e38402e069dc01f6 +++ b/forge/src/generated/resources/.cache/f681b33583ec37ab445ac361e38402e069dc01f6 @@ -1,4 +1,4 @@ -// 1.20.2 2023-12-08T14:05:02.1014553 Tags for minecraft:block mod id tardis_refined +// 1.20.2 2023-12-09T00:48:51.7769417 Tags for minecraft:block mod id tardis_refined 0e47996afffcdda5ea92f1f1147ef01691440a6e data/minecraft/tags/blocks/dragon_immune.json 870aa664161fb6f022473fecdd8e1e1105b476ac data/minecraft/tags/blocks/fences.json 1be1c1975b768bb05f7b50c206454433f0d615d1 data/minecraft/tags/blocks/leaves.json diff --git a/forge/src/generated/resources/.cache/fb1d1450e45f24c16ff9548196e396cd1616c0aa b/forge/src/generated/resources/.cache/fb1d1450e45f24c16ff9548196e396cd1616c0aa index 93a614135..49527c5d5 100644 --- a/forge/src/generated/resources/.cache/fb1d1450e45f24c16ff9548196e396cd1616c0aa +++ b/forge/src/generated/resources/.cache/fb1d1450e45f24c16ff9548196e396cd1616c0aa @@ -1,4 +1,4 @@ -// 1.20.2 2023-12-08T14:05:02.0960733 Console Patterns +// 1.20.2 2023-12-13T11:27:51.6000874 Console Patterns 2f482aa36f9bc5c30c7906230e20e11bb5cdb3c6 data/tardis_refined/tardis_refined/patterns/console/copper.json 80cef81ade3d59acf7c629be03ca07ceb29b4e45 data/tardis_refined/tardis_refined/patterns/console/coral.json 51ac36a16e84686df192a41a2c1dc966e266c836 data/tardis_refined/tardis_refined/patterns/console/crystal.json @@ -6,5 +6,5 @@ 64fc65e5823a648314b73165d693eab62a85208c data/tardis_refined/tardis_refined/patterns/console/initiative.json 0bd91ac43a05c679ec7386cccaa85956f785625a data/tardis_refined/tardis_refined/patterns/console/myst.json a8045d394dd1b80fcaa677ebb72e05dc33b18bf5 data/tardis_refined/tardis_refined/patterns/console/nuka.json -0e55fb4cab79ccaa85601c19661b33ab5557b3e9 data/tardis_refined/tardis_refined/patterns/console/toyota.json +42aebec6b374dd0534a5adfeb5f3af4a17291239 data/tardis_refined/tardis_refined/patterns/console/toyota.json c694be5c89584cf128d98c962e0f739b7098fe5a data/tardis_refined/tardis_refined/patterns/console/victorian.json diff --git a/forge/src/generated/resources/assets/tardis_refined/blockstates/ars_egg.json b/forge/src/generated/resources/assets/tardis_refined/blockstates/ars_egg.json index ef54d56a5..6360a9aeb 100644 --- a/forge/src/generated/resources/assets/tardis_refined/blockstates/ars_egg.json +++ b/forge/src/generated/resources/assets/tardis_refined/blockstates/ars_egg.json @@ -1,6 +1,27 @@ { "variants": { - "": { + "alive=false,hanging=false,waterlogged=false": { + "model": "tardis_refined:block/terraformer" + }, + "alive=false,hanging=false,waterlogged=true": { + "model": "tardis_refined:block/terraformer" + }, + "alive=false,hanging=true,waterlogged=false": { + "model": "tardis_refined:block/terraformer" + }, + "alive=false,hanging=true,waterlogged=true": { + "model": "tardis_refined:block/terraformer" + }, + "alive=true,hanging=false,waterlogged=false": { + "model": "tardis_refined:block/terraformer" + }, + "alive=true,hanging=false,waterlogged=true": { + "model": "tardis_refined:block/terraformer" + }, + "alive=true,hanging=true,waterlogged=false": { + "model": "tardis_refined:block/terraformer" + }, + "alive=true,hanging=true,waterlogged=true": { "model": "tardis_refined:block/terraformer" } } diff --git a/forge/src/generated/resources/assets/tardis_refined/lang/en_us.json b/forge/src/generated/resources/assets/tardis_refined/lang/en_us.json index 8b86a7b29..92cdca4c2 100644 --- a/forge/src/generated/resources/assets/tardis_refined/lang/en_us.json +++ b/forge/src/generated/resources/assets/tardis_refined/lang/en_us.json @@ -52,10 +52,13 @@ "message.tardis_refined.selected": "Selected: %s", "shell.tardis_refined.big_ben": "Big Ben", "shell.tardis_refined.briefcase": "Briefcase", + "shell.tardis_refined.castle": "Castle", "shell.tardis_refined.drifter": "Drifter", "shell.tardis_refined.factory": "Factory", "shell.tardis_refined.groening": "Groening", "shell.tardis_refined.growth": "Growth", + "shell.tardis_refined.hieroglyph": "Hieroglyph", + "shell.tardis_refined.lift": "Lift", "shell.tardis_refined.mystic": "Mystic", "shell.tardis_refined.nuka": "Nuka", "shell.tardis_refined.pagoda": "Pagoda", @@ -64,6 +67,8 @@ "shell.tardis_refined.portaloo": "Portaloo", "shell.tardis_refined.present": "Present", "shell.tardis_refined.vending": "Vending Machine", + "sound.ars_hum.subtitle": "ARS Tree Hum", + "sound.destination_ding.subtitle": "TARDIS reaches destination", "sound.pattern_manipulator.subtitle": "Pattern Manipulator activates", "sound.static.subtitle": "Screen display static", "sound.tardis_crash_land.subtitle": "TARDIS crash lands", @@ -106,11 +111,11 @@ "upgrade.tardis_refined.dimension_travel": "Inter-Dimensional Travel", "upgrade.tardis_refined.dimension_travel.description": "Allows the TARDIS to move between dimensions", "upgrade.tardis_refined.explorer": "Explorer I", - "upgrade.tardis_refined.explorer.description": "1000k Increment", + "upgrade.tardis_refined.explorer.description": "x1000 Increment", "upgrade.tardis_refined.explorer_ii": "Explorer II", - "upgrade.tardis_refined.explorer_ii.description": "2500k Increment", + "upgrade.tardis_refined.explorer_ii.description": "x2500 Increment", "upgrade.tardis_refined.explorer_iii": "Explorer III", - "upgrade.tardis_refined.explorer_iii.description": "5000k Increment", + "upgrade.tardis_refined.explorer_iii.description": "x5000 Increment", "upgrade.tardis_refined.hostile_displacement": "Hostile Action Displacement", "upgrade.tardis_refined.hostile_displacement.description": "Enables the displacement of the TARDIS when attacked", "upgrade.tardis_refined.inside_architecture": "Desktop Reconfiguration", diff --git a/forge/src/generated/resources/assets/tardis_refined/particles/ars_leaves.json b/forge/src/generated/resources/assets/tardis_refined/particles/ars_leaves.json new file mode 100644 index 000000000..ca698ca44 --- /dev/null +++ b/forge/src/generated/resources/assets/tardis_refined/particles/ars_leaves.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "minecraft:generic_0" + ] +} \ No newline at end of file diff --git a/forge/src/generated/resources/assets/tardis_refined/sounds.json b/forge/src/generated/resources/assets/tardis_refined/sounds.json index 9c7b292da..cda29666e 100644 --- a/forge/src/generated/resources/assets/tardis_refined/sounds.json +++ b/forge/src/generated/resources/assets/tardis_refined/sounds.json @@ -1,4 +1,10 @@ { + "ars_hum": { + "sounds": [ + "tardis_refined:tardis/ars/ars_hum" + ], + "subtitle": "sound.ars_hum.subtitle" + }, "destination_ding": { "sounds": [ "tardis_refined:tardis/destination_ding" @@ -47,6 +53,12 @@ ], "subtitle": "sound.tardis_takeoff.subtitle" }, + "test_hum": { + "sounds": [ + "tardis_refined:tardis/test_hum" + ], + "subtitle": "sound.test_hum.subtitle" + }, "time_blast": { "sounds": [ "tardis_refined:tardis/time_blast" diff --git a/forge/src/generated/resources/data/tardis_refined/tardis_refined/desktops/shalka.json b/forge/src/generated/resources/data/tardis_refined/tardis_refined/desktops/shalka.json new file mode 100644 index 000000000..a0e0369ec --- /dev/null +++ b/forge/src/generated/resources/data/tardis_refined/tardis_refined/desktops/shalka.json @@ -0,0 +1,5 @@ +{ + "id": "tardis_refined:shalka", + "name_component": "{\"color\":\"gold\",\"text\":\"Shalka\"}", + "structure": "tardis_refined:desktop/shalka" +} \ No newline at end of file diff --git a/forge/src/generated/resources/data/tardis_refined/tardis_refined/patterns/console/toyota.json b/forge/src/generated/resources/data/tardis_refined/tardis_refined/patterns/console/toyota.json index 046015247..8b5d216a3 100644 --- a/forge/src/generated/resources/data/tardis_refined/tardis_refined/patterns/console/toyota.json +++ b/forge/src/generated/resources/data/tardis_refined/tardis_refined/patterns/console/toyota.json @@ -13,7 +13,7 @@ "name_component": "{\"color\":\"yellow\",\"text\":\"Violet\"}", "texture_definition": { "emissive": true, - "texture": "tardis_refined:textures/blockentity/console/toyota/toyota_texture_purple.png" + "texture": "tardis_refined:textures/blockentity/console/toyota/toyota_console_purple.png" } }, { @@ -21,7 +21,15 @@ "name_component": "{\"color\":\"yellow\",\"text\":\"Blue\"}", "texture_definition": { "emissive": true, - "texture": "tardis_refined:textures/blockentity/console/toyota/toyota_texture_blue.png" + "texture": "tardis_refined:textures/blockentity/console/toyota/toyota_console_blue.png" + } + }, + { + "id": "tardis_refined:skulk", + "name_component": "{\"color\":\"yellow\",\"text\":\"Skulk\"}", + "texture_definition": { + "emissive": false, + "texture": "tardis_refined:textures/blockentity/console/toyota/toyota_console_skulk.png" } } ] diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/growth.json b/forge/src/generated/resources/data/tardis_refined/tardis_refined/patterns/shell/castle.json similarity index 59% rename from common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/growth.json rename to forge/src/generated/resources/data/tardis_refined/tardis_refined/patterns/shell/castle.json index f9fb0553f..a7a3b196d 100644 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/growth.json +++ b/forge/src/generated/resources/data/tardis_refined/tardis_refined/patterns/shell/castle.json @@ -3,12 +3,12 @@ { "exterior": { "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/growth/growth.png" + "texture": "tardis_refined:textures/blockentity/shell/castle/castle.png" }, "id": "tardis_refined:default", "interior": { "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/growth/growth_interior.png" + "texture": "tardis_refined:textures/blockentity/shell/castle/castle_interior.png" }, "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}" } diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/groening.json b/forge/src/generated/resources/data/tardis_refined/tardis_refined/patterns/shell/hieroglyph.json similarity index 57% rename from common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/groening.json rename to forge/src/generated/resources/data/tardis_refined/tardis_refined/patterns/shell/hieroglyph.json index 3e2d40864..469209790 100644 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/groening.json +++ b/forge/src/generated/resources/data/tardis_refined/tardis_refined/patterns/shell/hieroglyph.json @@ -3,12 +3,12 @@ { "exterior": { "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/groening/groening.png" + "texture": "tardis_refined:textures/blockentity/shell/hieroglyph/hieroglyph.png" }, "id": "tardis_refined:default", "interior": { "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/groening/groening_interior.png" + "texture": "tardis_refined:textures/blockentity/shell/hieroglyph/hieroglyph_interior.png" }, "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}" } diff --git a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/factory.json b/forge/src/generated/resources/data/tardis_refined/tardis_refined/patterns/shell/lift.json similarity index 59% rename from common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/factory.json rename to forge/src/generated/resources/data/tardis_refined/tardis_refined/patterns/shell/lift.json index da4ae5b0b..841d845c9 100644 --- a/common/src/main/resources/data/tardis_refined/tardis_refined/patterns/shell/factory.json +++ b/forge/src/generated/resources/data/tardis_refined/tardis_refined/patterns/shell/lift.json @@ -3,12 +3,12 @@ { "exterior": { "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/factory/factory.png" + "texture": "tardis_refined:textures/blockentity/shell/lift/lift.png" }, "id": "tardis_refined:default", "interior": { "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/factory/factory_interior.png" + "texture": "tardis_refined:textures/blockentity/shell/lift/lift_interior.png" }, "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}" } diff --git a/forge/src/generated/resources/data/tardis_refined/tardis_refined/patterns/shell/police_box.json b/forge/src/generated/resources/data/tardis_refined/tardis_refined/patterns/shell/police_box.json index 9c57ffe0c..e169a6a3b 100644 --- a/forge/src/generated/resources/data/tardis_refined/tardis_refined/patterns/shell/police_box.json +++ b/forge/src/generated/resources/data/tardis_refined/tardis_refined/patterns/shell/police_box.json @@ -11,66 +11,6 @@ "texture": "tardis_refined:textures/blockentity/shell/police_box/police_box_interior.png" }, "name_component": "{\"color\":\"yellow\",\"text\":\"Default\"}" - }, - { - "exterior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/police_box/marble.png" - }, - "id": "tardis_refined:marble", - "interior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/police_box/marble_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Marble\"}" - }, - { - "exterior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/police_box/gaudy.png" - }, - "id": "tardis_refined:gaudy", - "interior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/police_box/gaudy_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Gaudy\"}" - }, - { - "exterior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/police_box/metal.png" - }, - "id": "tardis_refined:metal", - "interior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/police_box/metal_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Metal\"}" - }, - { - "exterior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/police_box/stone.png" - }, - "id": "tardis_refined:stone", - "interior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/police_box/stone_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Stone\"}" - }, - { - "exterior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/police_box/red.png" - }, - "id": "tardis_refined:red", - "interior": { - "emissive": false, - "texture": "tardis_refined:textures/blockentity/shell/police_box/red_interior.png" - }, - "name_component": "{\"color\":\"yellow\",\"text\":\"Red\"}" } ] } \ No newline at end of file diff --git a/forge/src/main/java/whocraft/tardis_refined/commands/ForgeTRCommands.java b/forge/src/main/java/whocraft/tardis_refined/commands/ForgeTRCommands.java new file mode 100644 index 000000000..a111b1ea0 --- /dev/null +++ b/forge/src/main/java/whocraft/tardis_refined/commands/ForgeTRCommands.java @@ -0,0 +1,20 @@ +package whocraft.tardis_refined.commands; + + +import net.minecraft.commands.synchronization.ArgumentTypeInfo; +import net.minecraft.commands.synchronization.ArgumentTypeInfos; +import net.minecraft.commands.synchronization.SingletonArgumentInfo; +import net.minecraft.core.registries.Registries; +import whocraft.tardis_refined.TardisRefined; +import whocraft.tardis_refined.command.arguments.UpgradeArgumentType; +import whocraft.tardis_refined.registry.DeferredRegistry; +import whocraft.tardis_refined.registry.RegistrySupplier; + +public class ForgeTRCommands { + + public static final DeferredRegistry> COMMAND_ARGUMENT_TYPES = DeferredRegistry.create(TardisRefined.MODID, Registries.COMMAND_ARGUMENT_TYPE); + + + public static final RegistrySupplier> UPGRADE_ARGUMENT = COMMAND_ARGUMENT_TYPES.register("upgrade", () -> + ArgumentTypeInfos.registerByClass(UpgradeArgumentType.class, SingletonArgumentInfo.contextFree(UpgradeArgumentType::upgradeArgumentType))); +} \ No newline at end of file diff --git a/forge/src/main/java/whocraft/tardis_refined/common/data/LangProviderEnglish.java b/forge/src/main/java/whocraft/tardis_refined/common/data/LangProviderEnglish.java index 6b44180b1..e2ac488c4 100644 --- a/forge/src/main/java/whocraft/tardis_refined/common/data/LangProviderEnglish.java +++ b/forge/src/main/java/whocraft/tardis_refined/common/data/LangProviderEnglish.java @@ -2,7 +2,6 @@ import net.minecraft.ChatFormatting; import net.minecraft.Util; -import net.minecraft.client.resources.sounds.Sound; import net.minecraft.data.DataGenerator; import net.minecraft.resources.ResourceLocation; import net.minecraft.sounds.SoundEvent; @@ -37,6 +36,7 @@ protected void addTranslations() { addSound(SoundRegistry.TARDIS_MISC_SPARKLE.get(), "TARDIS arriving"); addSound(SoundRegistry.TIME_BLAST.get(), "Time Vortex blast"); addSound(SoundRegistry.DESTINATION_DING.get(), "TARDIS reaches destination"); + addSound(SoundRegistry.ARS_HUM.get(), "ARS Tree Hum"); /*Block*/ add(BlockRegistry.ARS_EGG.get(), "ARS Egg"); @@ -137,6 +137,9 @@ protected void addTranslations() { addShell(ShellTheme.GROWTH.getId(), "Growth"); addShell(ShellTheme.PORTALOO.getId(), "Portaloo"); addShell(ShellTheme.PAGODA.getId(), "Pagoda"); + addShell(ShellTheme.LIFT.getId(), "Lift"); + addShell(ShellTheme.HIEROGLYPH.getId(), "Hieroglyph"); + addShell(ShellTheme.CASTLE.getId(), "Castle"); /*Tool Tips*/ add(ModMessages.TOOLTIP_TARDIS_LIST_TITLE, "Key Set:"); @@ -159,9 +162,9 @@ protected void addTranslations() { addUpgrade(Upgrades.MATERIALIZE_AROUND.get(), "Materialize Around", "Allows the TARDIS to have entities enter while materalizing"); addUpgrade(Upgrades.ARCHITECTURE_SYSTEM.get(), "Architecture", "Enables TARDIS Architecture Upgrades"); addUpgrade(Upgrades.INSIDE_ARCHITECTURE.get(), "Desktop Reconfiguration", "Allows the Pilot to change the appearance of the TARDIS Desktop"); - addUpgrade(Upgrades.EXPLORER.get(), "Explorer I", "1000k Increment"); - addUpgrade(Upgrades.EXPLORER_II.get(), "Explorer II", "2500k Increment"); - addUpgrade(Upgrades.EXPLORER_III.get(), "Explorer III", "5000k Increment"); + addUpgrade(Upgrades.EXPLORER.get(), "Explorer I", "x1000 Increment"); + addUpgrade(Upgrades.EXPLORER_II.get(), "Explorer II", "x2500 Increment"); + addUpgrade(Upgrades.EXPLORER_III.get(), "Explorer III", "x5000 Increment"); addUpgrade(Upgrades.DIMENSION_TRAVEL.get(), "Inter-Dimensional Travel", "Allows the TARDIS to move between dimensions"); addUpgrade(Upgrades.LANDING_PAD.get(), "Landing Pad", "Allows the TARDIS to be summoned to a landing pad"); } diff --git a/forge/src/main/java/whocraft/tardis_refined/common/data/ModelProviderBlock.java b/forge/src/main/java/whocraft/tardis_refined/common/data/ModelProviderBlock.java index a7ae31e11..e69de29bb 100644 --- a/forge/src/main/java/whocraft/tardis_refined/common/data/ModelProviderBlock.java +++ b/forge/src/main/java/whocraft/tardis_refined/common/data/ModelProviderBlock.java @@ -1,78 +0,0 @@ -package whocraft.tardis_refined.common.data; - -import net.minecraft.data.DataGenerator; -import net.minecraft.data.models.BlockModelGenerators; -import net.neoforged.neoforge.client.model.generators.BlockModelBuilder; -import net.neoforged.neoforge.client.model.generators.BlockModelProvider; -import net.neoforged.neoforge.common.data.ExistingFileHelper; -import whocraft.tardis_refined.TardisRefined; - -//public class ModelProviderBlock extends BlockModelGenerators { -// -// public ModelProviderBlock(DataGenerator generator, ExistingFileHelper existingFileHelper) { -// super(generator.getPackOutput(), TardisRefined.MODID, existingFileHelper); -// } -// -// @Override -// protected void registerModels() { -// -///* ResourceLocation leavesTexture = new ResourceLocation("tardis_refined:block/ars_leaves"); -// ResourceLocation growthStoneTexture = new ResourceLocation("tardis_refined:block/growth_stone"); -// -// *//*Blocks that are rendered in code*//* -// emptyBlockState(BlockRegistry.GLOBAL_CONSOLE_BLOCK.get()); -// emptyBlockState(BlockRegistry.BULK_HEAD_DOOR.get()); -// emptyBlockState(BlockRegistry.GLOBAL_DOOR_BLOCK.get()); -// emptyBlockState(BlockRegistry.GLOBAL_SHELL_BLOCK.get()); -// emptyBlockState(BlockRegistry.ROOT_SHELL_DOOR.get()); -// emptyBlockState(BlockRegistry.ROOT_PLANT_BLOCK.get()); -// emptyBlockState(BlockRegistry.ROOT_SHELL_BLOCK.get()); -// emptyBlockState(BlockRegistry.INTERNAL_DOOR_BLOCK.get()); -// emptyBlockState(BlockRegistry.ARS_EGG.get()); -// -// threeDeeRotating(BlockRegistry.LANDING_PAD.get(), new ResourceLocation(TardisRefined.MODID, "block/landing_pad")); -// threeDeeRotating(BlockRegistry.FLIGHT_DETECTOR.get(), new ResourceLocation(TardisRefined.MODID, "block/flight_detector")); -// -// terraformer(BlockRegistry.TERRAFORMER_BLOCK.get()); -// -// *//*Basic Blocks*//* -// singleTexture(BlockRegistry.ARS_LEAVES.get()); -// singleTexture(BlockRegistry.AIR_LOCK_GENERATION_BLOCK.get()); -// singleTexture(BlockRegistry.GROWTH_STONE.get()); -// singleTexture(BlockRegistry.HARDENED_GROWTH_STONE.get()); -// -// *//*Fences*//* -// fencePost(BlockRegistry.ARS_LEAVES_FENCE.get(), leavesTexture); -// -// *//*Slabs*//* -// slab(BlockRegistry.ARS_LEAVES_SLAB.get(), leavesTexture, leavesTexture); -// -// -// threeDeeRotating(BlockRegistry.CONSOLE_CONFIGURATION_BLOCK.get(), new ResourceLocation(TardisRefined.MODID, "block/console_configuration")); -// */ } -// -// -// /* public JsonObject emptyBlockState(Block block) { -// return getBuilder(block).partialState().modelForState().modelFile(models().getExistingFile(new ResourceLocation("minecraft:block/barrier"))).addModel().toJson(); -// } -// -// public JsonObject customLocation(Block block, ResourceLocation resourceLocation) { -// return getBuilder(block).partialState().modelForState().modelFile(models().getExistingFile(resourceLocation)).addModel().toJson(); -// } -// -// public JsonObject terraformer(Block block) { -// return getBuilder(block).forAllStates( -// state -> state.getValue(TerraformerBlock.ACTIVE) ? -// ConfiguredModel.builder().modelFile(models().getExistingFile(new ResourceLocation(TardisRefined.MODID, "block/terraformer_on"))).build() : -// ConfiguredModel.builder().modelFile(models().getExistingFile(new ResourceLocation(TardisRefined.MODID, "block/terraformer"))).build()).toJson(); -// -// } -// -// // Paul McGann is... -// public JsonObject threeDeeRotating(Block block, ResourceLocation location) { -// return getBuilder(block.).forAllStates( -// state -> ConfiguredModel.builder().modelFile(new ModelFile.UncheckedModelFile(location)).rotationY((int) state.getValue(HorizontalDirectionalBlock.FACING).toYRot()).build()).toJson(); -// -// }*/ -// -//} \ No newline at end of file diff --git a/forge/src/main/java/whocraft/tardis_refined/common/data/ParticleProvider.java b/forge/src/main/java/whocraft/tardis_refined/common/data/ParticleProvider.java index 9c22a0a4f..9215bb48b 100644 --- a/forge/src/main/java/whocraft/tardis_refined/common/data/ParticleProvider.java +++ b/forge/src/main/java/whocraft/tardis_refined/common/data/ParticleProvider.java @@ -83,6 +83,7 @@ public CompletableFuture run(CachedOutput arg) { resourceLocations.add(new ResourceLocation("tardis_refined:silver/s_silver_sym_07")); makeParticle(TRParticles.GALLIFREY.get(), createParticle(resourceLocations), arg, base); + makeParticle(TRParticles.ARS_LEAVES.get(), createParticle(List.of(new ResourceLocation("minecraft:generic_0"))), arg, base); return CompletableFuture.allOf(this.futures.toArray(CompletableFuture[]::new)); diff --git a/forge/src/main/java/whocraft/tardis_refined/common/data/SoundProvider.java b/forge/src/main/java/whocraft/tardis_refined/common/data/SoundProvider.java index 661fd2aec..a3f6c880a 100644 --- a/forge/src/main/java/whocraft/tardis_refined/common/data/SoundProvider.java +++ b/forge/src/main/java/whocraft/tardis_refined/common/data/SoundProvider.java @@ -29,6 +29,8 @@ public void registerSounds() { add(SoundRegistry.TARDIS_MISC_SPARKLE.get(), basicSound("tardis_misc_sparkle", new ResourceLocation(TardisRefined.MODID, "tardis/tardis_misc_sparkle"))); add(SoundRegistry.STATIC.get(), basicSound("static", new ResourceLocation(TardisRefined.MODID, "ui/static"))); add(SoundRegistry.DESTINATION_DING.get(), basicSound("destination_ding", new ResourceLocation(TardisRefined.MODID, "tardis/destination_ding"))); + add(SoundRegistry.ARS_HUM.get(), basicSound("ars_hum", new ResourceLocation(TardisRefined.MODID, "tardis/ars/ars_hum"))); + add(SoundRegistry.TEST_HUM.get(), basicSound("test_hum", new ResourceLocation(TardisRefined.MODID, "tardis/test_hum"))); } @@ -36,4 +38,13 @@ public SoundDefinition basicSound(String langKey, ResourceLocation resourceLocat return SoundDefinition.definition().with(SoundDefinition.Sound.sound(resourceLocation, SoundDefinition.SoundType.SOUND)).subtitle(createSubtitle(langKey)); } + public SoundDefinition basicSound(String langKey, ResourceLocation... resourceLocation) { + SoundDefinition soundDefinition = SoundDefinition.definition(); + for (ResourceLocation location : resourceLocation) { + soundDefinition.with(SoundDefinition.Sound.sound(location, SoundDefinition.SoundType.SOUND)); + } + + return soundDefinition.subtitle(createSubtitle(langKey)); + } + } diff --git a/forge/src/main/java/whocraft/tardis_refined/common/network/neoforge/NetworkManagerImpl.java b/forge/src/main/java/whocraft/tardis_refined/common/network/neoforge/NetworkManagerImpl.java index 2bf72062c..12bef729b 100644 --- a/forge/src/main/java/whocraft/tardis_refined/common/network/neoforge/NetworkManagerImpl.java +++ b/forge/src/main/java/whocraft/tardis_refined/common/network/neoforge/NetworkManagerImpl.java @@ -10,6 +10,7 @@ import net.neoforged.neoforge.network.PacketDistributor; import net.neoforged.neoforge.network.PlayNetworkDirection; import net.neoforged.neoforge.network.simple.SimpleChannel; +import whocraft.tardis_refined.TardisRefined; import whocraft.tardis_refined.common.network.MessageC2S; import whocraft.tardis_refined.common.network.MessageS2C; import whocraft.tardis_refined.common.network.MessageType; @@ -35,7 +36,7 @@ public static NetworkManager create(ResourceLocation channelName) { @Override public void sendToServer(MessageC2S message) { if (!this.toServer.containsValue(message.getType())) { - System.out.println("Message type not registered: " + message.getType().getId()); + TardisRefined.LOGGER.error("Message type not registered: " + message.getType().getId()); return; } @@ -45,7 +46,7 @@ public void sendToServer(MessageC2S message) { @Override public void sendToPlayer(ServerPlayer player, MessageS2C message) { if (!this.toClient.containsValue(message.getType())) { - System.out.println("Message type not registered: " + message.getType().getId()); + TardisRefined.LOGGER.error("Message type not registered: " + message.getType().getId()); return; } @@ -55,7 +56,7 @@ public void sendToPlayer(ServerPlayer player, MessageS2C message) { @Override public void sendToTracking(Entity entity, MessageS2C message) { if (!this.toClient.containsValue(message.getType())) { - System.out.println("Message type not registered: " + message.getType().getId()); + TardisRefined.LOGGER.error("Message type not registered: " + message.getType().getId()); return; } this.channel.send(PacketDistributor.TRACKING_ENTITY_AND_SELF.with(() -> entity), message); @@ -64,7 +65,7 @@ public void sendToTracking(Entity entity, MessageS2C message) { @Override public void sendToTracking(BlockEntity blockEntity, MessageS2C message) { if (!this.toClient.containsValue(message.getType())) { - System.out.println("Message type not registered: " + message.getType().getId()); + TardisRefined.LOGGER.error("Message type not registered: " + message.getType().getId()); return; } this.channel.send(PacketDistributor.TRACKING_CHUNK.with(() -> blockEntity.getLevel().getChunkAt(blockEntity.getBlockPos())), message); @@ -83,7 +84,7 @@ public ToServer(FriendlyByteBuf buf) { var msgId = buf.readUtf(); if (!NetworkManagerImpl.this.toServer.containsKey(msgId)) { - System.out.println("Unknown message id received on server: " + msgId); + TardisRefined.LOGGER.error("Unknown message id received on server: " + msgId); this.message = null; return; } @@ -118,7 +119,7 @@ public ToClient(FriendlyByteBuf buf) { var msgId = buf.readUtf(); if (!NetworkManagerImpl.this.toClient.containsKey(msgId)) { - System.out.println("Unknown message id received on client: " + msgId); + TardisRefined.LOGGER.error("Unknown message id received on client: " + msgId); this.message = null; return; } diff --git a/forge/src/main/java/whocraft/tardis_refined/neoforge/ClientModBus.java b/forge/src/main/java/whocraft/tardis_refined/neoforge/ClientModBus.java index 2dab5847d..51ffcae38 100644 --- a/forge/src/main/java/whocraft/tardis_refined/neoforge/ClientModBus.java +++ b/forge/src/main/java/whocraft/tardis_refined/neoforge/ClientModBus.java @@ -53,6 +53,7 @@ public static void onRegisterLayerDefinitions(EntityRenderersEvent.RegisterLayer @SubscribeEvent public static void onRegisterParticles(RegisterParticleProvidersEvent event) { Minecraft.getInstance().particleEngine.register(TRParticles.GALLIFREY.get(), (ParticleEngine.SpriteParticleRegistration) (ParticleGallifrey.Provider::new)); + Minecraft.getInstance().particleEngine.register(TRParticles.ARS_LEAVES.get(), (ParticleEngine.SpriteParticleRegistration) (ParticleGallifrey.ARSVinesParticle::new)); } diff --git a/forge/src/main/java/whocraft/tardis_refined/neoforge/TardisRefinedForge.java b/forge/src/main/java/whocraft/tardis_refined/neoforge/TardisRefinedForge.java index 2d029bdeb..ef8d0d11d 100644 --- a/forge/src/main/java/whocraft/tardis_refined/neoforge/TardisRefinedForge.java +++ b/forge/src/main/java/whocraft/tardis_refined/neoforge/TardisRefinedForge.java @@ -10,6 +10,7 @@ import net.neoforged.neoforge.data.event.GatherDataEvent; import whocraft.tardis_refined.TRConfig; import whocraft.tardis_refined.TardisRefined; +import whocraft.tardis_refined.commands.ForgeTRCommands; import whocraft.tardis_refined.common.data.*; @Mod(TardisRefined.MODID) @@ -23,6 +24,8 @@ public TardisRefinedForge() { ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, TRConfig.CLIENT_SPEC); ModLoadingContext.get().registerConfig(ModConfig.Type.SERVER, TRConfig.SERVER_SPEC); + ForgeTRCommands.COMMAND_ARGUMENT_TYPES.register(); + /* if (ModCompatChecker.immersivePortals()) { if(TRConfig.COMMON.COMPATIBILITY_IP.get()) { ImmersivePortals.init(); diff --git a/gradle.properties b/gradle.properties index 76079c5eb..dd898c5f4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ org.gradle.jvmargs=-Xmx4G ##Mod Building and Metadata -jar_name=TARDIS Refined +jar_name=tardis_refined mod_name=TARDIS Refined mod_id=tardis_refined maven_group=whocraft