Skip to content

Commit

Permalink
Upgrade Improvements, Asset Changes & Internal Door Fix (#184)
Browse files Browse the repository at this point in the history
Co-authored-by: 50ap5ud5 <[email protected]>
Co-authored-by: MagicMaan <[email protected]>
Co-authored-by: leafy <[email protected]>
  • Loading branch information
4 people authored Dec 19, 2023
1 parent 9e67bf7 commit 99b17b2
Show file tree
Hide file tree
Showing 260 changed files with 3,690 additions and 2,357 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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 }}
25 changes: 22 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -51,6 +69,7 @@ allprojects {
dirs '../modlibs'
}


}

tasks.withType(JavaCompile) {
Expand All @@ -61,4 +80,4 @@ allprojects {
java {
withSourcesJar()
}
}
}
88 changes: 88 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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



Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -51,6 +56,37 @@ public class TardisEvents {
}
}));

public static final Event<UpgradeUnlocked> 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<CanControlBeUsed> 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.
*/
Expand Down Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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);



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -51,4 +52,22 @@ public Particle createParticle(SimpleParticleType arg, ClientLevel arg2, double
return particleGallifrey;
}
}

public static class ARSVinesParticle implements ParticleProvider<SimpleParticleType> {
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;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -26,4 +32,32 @@ public static void setWaypointScreen(Collection<TardisNavLocation> waypoints) {
public static void setCoordinatesScreen(List<ResourceKey<Level>> 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<ResourceKey<Level>> 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));
}
}
}
Loading

0 comments on commit 99b17b2

Please sign in to comment.