Skip to content

Commit 82a2dd7

Browse files
committed
- Enhancement: Players can now sleep in the TARDIS (No spawnpoint setting)
- Added Interior: Hartnell - Added Interior: Pertwee
1 parent a79bb44 commit 82a2dd7

File tree

11 files changed

+45
-4
lines changed

11 files changed

+45
-4
lines changed

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,10 @@
22

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

5+
#### Interiors
6+
- Added Interior: Hartnell
7+
- Added Interior: Pertwee
8+
59
#### Enhancements
610
- Enhancement: Added tooltips to various screens to indicate which mod added content
11+
- Enhancement: Players can now sleep in the TARDIS (No spawnpoint setting)

common/src/main/java/whocraft/tardis_refined/common/tardis/TardisDesktops.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ public static DesktopTheme getDesktopById(ResourceLocation location) {
5959
* Creates and adds the Tardis Refined default list of DesktopThemes to a standalone map.
6060
* Can be used for datagenerators or as a fallback registry
6161
*
62-
* @return
6362
*/
6463
public static Map<ResourceLocation, DesktopTheme> registerDefaultDesktops() {
6564
DEFAULT_DESKTOPS.clear();
@@ -86,6 +85,8 @@ public static Map<ResourceLocation, DesktopTheme> registerDefaultDesktops() {
8685
addDefaultDesktop(new DesktopTheme("classic", "desktop/classic"));
8786
addDefaultDesktop(new DesktopTheme("terraformed", "desktop/terraformed_useable"));
8887
addDefaultDesktop(new DesktopTheme("panamax", "desktop/panamax"));
88+
addDefaultDesktop(new DesktopTheme("hartnell", "desktop/hartnell"));
89+
addDefaultDesktop(new DesktopTheme("pertwee", "desktop/pertwee"));
8990

9091
return DEFAULT_DESKTOPS;
9192
}

common/src/main/java/whocraft/tardis_refined/constants/ModMessages.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public class ModMessages {
7373
public static final String VILLAGER_CAN_FLY = ui("villager_can_pilot");
7474
public static final String DEMANDS_PAYMENT = message("demands_payment");
7575
public static final String PILOT_TIME = message("pilot_time");
76+
public static final String TARDIS_SLEEP_END = message("tardis_sleep_end");
7677
public static String GITHUB_RELEASE_PAGE = "https://github.com/WhoCraft/TardisRefined/releases";
7778

7879
/*Item Special cases*/
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package whocraft.tardis_refined.mixin;
2+
3+
import net.minecraft.core.BlockPos;
4+
import net.minecraft.resources.ResourceKey;
5+
import net.minecraft.server.level.ServerPlayer;
6+
import net.minecraft.world.level.Level;
7+
import org.jetbrains.annotations.Nullable;
8+
import org.spongepowered.asm.mixin.Mixin;
9+
import org.spongepowered.asm.mixin.injection.At;
10+
import org.spongepowered.asm.mixin.injection.Inject;
11+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
12+
import whocraft.tardis_refined.common.util.PlayerUtil;
13+
import whocraft.tardis_refined.constants.ModMessages;
14+
import whocraft.tardis_refined.registry.TRDimensionTypes;
15+
16+
@Mixin(ServerPlayer.class)
17+
public class ServerPlayerMixin {
18+
19+
@Inject(method = "stopSleepInBed(ZZ)V", at = @At("HEAD"))
20+
private void stopSleepInBed(boolean bl, boolean bl2, CallbackInfo ci) {
21+
ServerPlayer serverPlayer = (ServerPlayer) (Object) this;
22+
PlayerUtil.sendMessage(serverPlayer, ModMessages.TARDIS_SLEEP_END, true);
23+
}
24+
25+
@Inject(method = "setRespawnPosition(Lnet/minecraft/resources/ResourceKey;Lnet/minecraft/core/BlockPos;FZZ)V", at = @At("HEAD"), cancellable = true)
26+
public void setRespawnPosition(ResourceKey<Level> resourceKey, BlockPos blockPos, float f, boolean bl, boolean bl2, CallbackInfo ci) {
27+
ServerPlayer serverPlayer = (ServerPlayer) (Object) this;
28+
if(serverPlayer.level().dimensionTypeId() == TRDimensionTypes.TARDIS){
29+
ci.cancel();
30+
}
31+
}
32+
33+
}
177 KB
Loading
172 KB
Loading

common/src/main/resources/data/tardis_refined/dimension_type/tardis.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
"natural": true,
44
"piglin_safe": true,
55
"respawn_anchor_works": true,
6-
"bed_works": false,
6+
"bed_works": true,
77
"has_raids": false,
8-
"has_skylight": false,
8+
"has_skylight": true,
99
"has_ceiling": true,
10-
"__COMMENT": "Skyline and bed works need to be enabled for beds to work, see https://github.com/WhoCraft/TardisRefined/issues/198",
1110
"coordinate_scale": 1,
1211
"ambient_light": 0,
1312
"logical_height": 384,
Binary file not shown.
Binary file not shown.

common/src/main/resources/tardis_refined-common.mixins.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"MinecraftServerStorageAccessor",
1010
"PistonBaseBlockMixin",
1111
"PlayerEntityMixin",
12+
"ServerPlayerMixin",
1213
"VillagerGoalPackagesMixin",
1314
"VillagerMixin"
1415
],

0 commit comments

Comments
 (0)