Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adventure mode/1.20.2 #406

Merged
merged 4 commits into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 22 additions & 19 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -2,30 +2,31 @@

![TARDIS Refined](https://wiki.tardisrefined.net/TARDIS-Refined-Wiki/tardis_refined_v2.png)

## Bug Fixes
- Bug fix: Added "Compatibility" with [Diagonal Windows](https://www.curseforge.com/minecraft/mc-mods/diagonal-windows)
- Bug fix: Exception Ticking World [#388](https://github.com/WhoCraft/TardisRefined/issues/388)
- Bug fix: Nuka Console Duplicate Control Entity Failing Flight Dance Events [#376](https://github.com/WhoCraft/TardisRefined/issues/376)
- Bug fix: land pad dont work and crash on server [#377](https://github.com/WhoCraft/TardisRefined/issues/377)
- Bug fix: tardis is damaged [#351](https://github.com/WhoCraft/TardisRefined/issues/351)
- Bug fix: Diagonal Windows makes it impossible to craft the terraformer [#383](https://github.com/WhoCraft/TardisRefined/issues/383)
- Bug fix: relogging causes TARDIS Dance events to not occur [#387](https://github.com/WhoCraft/TardisRefined/issues/387)
- Bug fix: [Incompatibility] Tardis refined dimensions fail to load with Dimension Threads [#374](https://github.com/WhoCraft/TardisRefined/issues/374)
- Bug fix: Console cannot be removed/changed with the console configurator outside the TARDIS dimension [#380](https://github.com/WhoCraft/TardisRefined/issues/380)
- Bug fix: Fixed a bug where the overlay keybinds always rendered the default key
#### Bug Fixes
- Bug Fix: Added "Compatibility" with [Diagonal Windows](https://www.curseforge.com/minecraft/mc-mods/diagonal-windows)
- Bug Fix: Exception Ticking World [#388](https://github.com/WhoCraft/TardisRefined/issues/388)
- Bug Fix: Nuka Console Duplicate Control Entity Failing Flight Dance Events [#376](https://github.com/WhoCraft/TardisRefined/issues/376)
- Bug Fix: land pad dont work and crash on server [#377](https://github.com/WhoCraft/TardisRefined/issues/377)
- Bug Fix: tardis is damaged [#351](https://github.com/WhoCraft/TardisRefined/issues/351)
- Bug Fix: Diagonal Windows makes it impossible to craft the terraformer [#383](https://github.com/WhoCraft/TardisRefined/issues/383)
- Bug Fix: relogging causes TARDIS Dance events to not occur [#387](https://github.com/WhoCraft/TardisRefined/issues/387)
- Bug Fix: [Incompatibility] Tardis refined dimensions fail to load with Dimension Threads [#374](https://github.com/WhoCraft/TardisRefined/issues/374)
- Bug Fix: Console cannot be removed/changed with the console configurator outside the TARDIS dimension [#380](https://github.com/WhoCraft/TardisRefined/issues/380)
- Bug Fix: Fixed a bug where the overlay keybinds always rendered the default key

## Enhancements
#### Enhancements
- Enhancement: Added Adventure Mode
- Enhancement: Standing in a Crashed smoke of a crashed TARDIS will cause 0.5 damage to the player for the duration their standing in it
- Enhancement: Recovery Progress of crashed TARDIS now displayed on controls until repair is complete
- Enhancement: Recovery Progress of crashed TARDIS is now displayed on Key tooltip
- Enhancement: Holographic exteriors on consoles now spin according to throttle
- Enhancement: Shell Viewer/Time Vortex (Accessed Via Monitor Screen)
- Enhancement: Speed up downwards descent for Gravity Shaft
- Enhancement: UI for Gravity Shaft
- Enhancement: Improved UI for Gravity Shaft
- Enhancement: Colored various texts on Key item
- Enhancement: Alarm now sounds when Fuel is below 5% and the TARDIS is not fueling+
- Enhancement: Alarm now sounds when Fuel is below 5% and the TARDIS is not fueling

## Additions
#### Additions
- Added Item: Mallet
- Added Villager: Pilot (POI: Console)
- Added Interior: Useable Terraformed
@@ -53,7 +54,7 @@
- Added Vortex: Agender Flag
- Added Vortex: Gay Flag

## Textures, Models & Animations
#### Textures, Models & Animations
- Texture: Updated all Factory Console Variants
- Model: Updated Coral Console Model
- Model: Updated Victorian Console Model
@@ -71,18 +72,20 @@
- Animation: Added Victorian Console Power on Animation
- Animation: Added Victorian Console Power off Animation

#### Adventure Mode
Mod Pack creators can now enable adventure mode in the server config - this will activate a mode where players have to visit a dimension and sample it in order to have their TARDIS travel there - Mod Pack creators can also add levels to automatically be sampled by a TARDIS

## Compatibility
#### Compatibility Notes
- [Trinkets](https://wiki.tardisrefined.net/extendedinventorymods.html#trinkets)
- [Curios](https://wiki.tardisrefined.net/extendedinventorymods.html#curios)
- [Diagonal Windows](https://wiki.tardisrefined.net/diagonal-blocks-windows-walls.html#diagonal-walls)


## Technical changes
#### Technical changes
- Most animations for Consoles are now loaded from JSON
- Some models for Consoles are now loaded from JSON

## NOTE
#### NOTE
- Upon updating to this version, your previous: ``Return Location``, ``Current Location`` and ``Target Location`` will be reset
This will not lead to any other data loss and your TARDIS will be exactly where you left it, take off once and you will be all sorted. This was a required change to resolve some issues

4 changes: 4 additions & 0 deletions common/src/main/java/whocraft/tardis_refined/TRConfig.java
Original file line number Diff line number Diff line change
@@ -60,10 +60,14 @@ public Common(ModConfigSpec.Builder builder) {

public static class Server {
public final ModConfigSpec.ConfigValue<List<? extends String>> BANNED_DIMENSIONS;
public final ModConfigSpec.ConfigValue<List<? extends String>> ADVENTURE_MODE_DEFAULTS;
public final ModConfigSpec.BooleanValue ADVENTURE_MODE;

public Server(ModConfigSpec.Builder builder) {
builder.push("travel");
BANNED_DIMENSIONS = builder.translation("config.tardis_refined.banned_dimensions").comment("A list of Dimensions the TARDIS cannot land in.").defineList("banned_dimensions", Lists.newArrayList("example:dimension"), String.class::isInstance);
ADVENTURE_MODE_DEFAULTS = builder.translation("config.tardis_refined.adventure_mode_defaults").comment("A list of Dimensions that are automatically sampled").defineList("adventure_mode_defaults", Lists.newArrayList("minecraft:overworld"), String.class::isInstance);
ADVENTURE_MODE = builder.translation("config.tardis_refined.adventure_mode").comment("Toggles whether players must discover and sample dimensions before they can travel there").define("adventure_mode", false);
builder.pop();
}

Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ public class TardisRefined {
public static final String NAME = "Tardis Refined";
public static final String PLATFORM_ERROR = "Something has gone critically wrong with platform definitions. Please contact the mod author.";
public static final Logger LOGGER = LogUtils.getLogger();
public static boolean IS_CONTROL_GROUP = false;

public static Gson GSON = new GsonBuilder()
.disableHtmlEscaping()
.registerTypeHierarchyAdapter(Component.class, new Component.Serializer()).
Original file line number Diff line number Diff line change
@@ -2,10 +2,11 @@

import net.minecraft.client.color.item.ItemColor;
import net.minecraft.world.item.DyeableLeatherItem;
import whocraft.tardis_refined.common.items.DimensionSamplerItem;

public class TRItemColouring {

// Sonic Colouring - changes the colour of any face thats blank and white and has a tintindex of 0
// Sonic Colouring - changes the colour of any face that's blank and white and has a tintindex of 0
public static ItemColor SCREWDRIVER_COLORS = (itemStack, tintIndex) -> {
if (tintIndex == 0) {
if (itemStack.getItem() instanceof DyeableLeatherItem dyeableLeatherItem) {
@@ -15,4 +16,15 @@ public class TRItemColouring {
return 0; // We do not want to tint, so we let the usual colour take over
};

public static ItemColor SAMPLE_COLORS = (itemStack, tintIndex) -> {
if (tintIndex == 2 && DimensionSamplerItem.hasDimAtAll(itemStack)) {
if (itemStack.getItem() instanceof DimensionSamplerItem dimensionSamplerItem) {
return dimensionSamplerItem.getColor(itemStack);
}
}
return 0; // We do not want to tint, so we let the usual colour take over
};



}
Original file line number Diff line number Diff line change
@@ -68,17 +68,15 @@ public InteractionResult use(BlockState blockState, Level level, BlockPos blockP
var keyChain = KeyItem.getKeychain(itemStack);
if (!keyChain.isEmpty()) {
ResourceKey<Level> dimension = KeyItem.getKeychain(itemStack).get(0);
var tardisLevel = Platform.getServer().getLevel(dimension);
var operatorOptional = TardisLevelOperator.get(tardisLevel);
if (operatorOptional.isEmpty()) {
return InteractionResult.PASS;
}
var operator = operatorOptional.get();

if (serverLevel.isEmptyBlock(blockPos.above()) && DimensionUtil.isAllowedDimension(level.dimension())) {
var tardisLevel = Platform.getServer().getLevel(dimension);


var operatorOptional = TardisLevelOperator.get(tardisLevel);
if (operatorOptional.isEmpty()) {
return InteractionResult.PASS;
}
if (serverLevel.isEmptyBlock(blockPos.above()) && operator.getProgressionManager().isLevelDiscovered(level.dimension())) {

var operator = operatorOptional.get();
TardisPilotingManager pilotManager = operator.getPilotingManager();
UpgradeHandler upgradeHandler = operator.getUpgradeHandler();

Original file line number Diff line number Diff line change
@@ -16,7 +16,6 @@
import org.jetbrains.annotations.Nullable;
import whocraft.tardis_refined.common.capability.tardis.TardisLevelOperator;
import whocraft.tardis_refined.common.tardis.themes.ShellTheme;
import whocraft.tardis_refined.compat.portals.IPStencil;
import whocraft.tardis_refined.constants.NbtConstants;
import whocraft.tardis_refined.patterns.ShellPattern;
import whocraft.tardis_refined.patterns.ShellPatterns;
@@ -131,9 +130,9 @@ public void onRightClick(BlockState blockState, TardisInternalDoor door, Player
cap.setDoorClosed(door.isOpen());//Tell the Tardis that the door should be closed if currently open, and should be open if currently closed.
if (player instanceof ServerPlayer serverPlayer) {
if (door.isOpen()) {
IPStencil.loadServerChunks(serverPlayer, cap.getPilotingManager().getCurrentLocation());
// IPStencil.loadServerChunks(serverPlayer, cap.getPilotingManager().getCurrentLocation());
} else {
IPStencil.unloadServerChunks(serverPlayer);
// IPStencil.unloadServerChunks(serverPlayer);
}
}
}
Original file line number Diff line number Diff line change
@@ -72,6 +72,7 @@ private void setUpTardis(BlockState blockState, Level level, BlockPos blockPos)
TardisLevelOperator.get(interior).ifPresent(tardisLevelOperator -> {
if (!tardisLevelOperator.hasInitiallyGenerated()) {
tardisLevelOperator.setupInitialCave(serverLevel, blockState, blockPos);
tardisLevelOperator.getProgressionManager().addDiscoveredLevel(level.dimension());
}
//After we setup the data and desktop, open the doors.
tardisLevelOperator.setDoorClosed(false);
Original file line number Diff line number Diff line change
@@ -62,6 +62,8 @@ public class TardisLevelOperator {
private final TardisClientData tardisClientData;
private final UpgradeHandler upgradeHandler;
private final AestheticHandler aestheticHandler;
private final ProgressionManager progressionManager;

private boolean hasInitiallyGenerated = false;
private TardisInternalDoor internalDoor = null;
// TARDIS state refers to different stages of TARDIS creation. This allows for different logic to operate in those moments.
@@ -79,6 +81,7 @@ public TardisLevelOperator(Level level) {
this.upgradeHandler = new UpgradeHandler(this);
this.aestheticHandler = new AestheticHandler(this);
this.flightDanceManager = new FlightDanceManager(this);
this.progressionManager = new ProgressionManager();
}

@ExpectPlatform
@@ -118,6 +121,7 @@ public CompoundTag serializeNBT() {
compoundTag = this.upgradeHandler.saveData(compoundTag);
compoundTag = this.aestheticHandler.saveData(compoundTag);
compoundTag = this.flightDanceManager.saveData(compoundTag);
compoundTag = this.progressionManager.saveData(compoundTag);

compoundTag.putInt("tardis_state", this.tardisState);

@@ -143,6 +147,7 @@ public void deserializeNBT(CompoundTag tag) {
this.upgradeHandler.loadData(tag);
this.aestheticHandler.loadData(tag);
this.flightDanceManager.loadData(tag);
this.progressionManager.loadData(tag);

this.tardisState = tag.getInt("tardis_state");

@@ -224,6 +229,10 @@ public void setInitiallyGenerated(boolean hasInitiallyGenerated) {
this.hasInitiallyGenerated = hasInitiallyGenerated;
}

public ProgressionManager getProgressionManager() {
return progressionManager;
}

/**
* Moves the entity into the TARDIS. If the TARDIS has no door established, the entity is sent to 0,100,0.
**/
Loading
Oops, something went wrong.