Skip to content

Commit b2da6b6

Browse files
Jeryn9950ap5ud5CommandrMoose
authored
Compatibility: Immersive Portals (#246)
Co-authored-by: 50ap5ud5 <50ap5ud5125@gmail.com> Co-authored-by: Clayton T <34910888+CommandrMoose@users.noreply.github.com>
1 parent 375edd4 commit b2da6b6

File tree

50 files changed

+552
-396
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+552
-396
lines changed

.gitignore

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ atlassian-ide-plugin.xml
2222
# BlueJ files
2323
*.ctxt
2424

25-
# Package Files #
26-
*.jar
27-
*.war
28-
*.nar
29-
*.ear
30-
*.zip
31-
*.tar.gz
32-
*.rar
3325

3426
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
3527
hs_err_pid*

changelog.md

Lines changed: 5 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,8 @@
1-
## Upgrades
2-
- ARS Tree now grows with the percentage of upgrades unlocked
3-
- External Shell Configuration now locked behind Upgrades
4-
- x1000 Increment now locked behind upgrades
5-
- x2500 Increment now introduced and locked behind upgrades
6-
- x5000 Increment now introduced and locked behind upgrades
7-
- Added Waypoints
8-
- Added Co-ordinate Input (This might make you lazy people happy, but you are going to hell and back to get it)
9-
- Landing Pad now locked behind upgrades
10-
11-
## Particles
12-
#### Additions
13-
- Added ARS Leaves Particles
14-
- Crashed TARDIS now emits smokey particles as if room is overflowing with smoke
15-
- Root Plant now emits particles when growing to indicate to the user that they are doing it correctly
16-
17-
## Sounds
18-
#### Updates
19-
- Added ARS Room sound
20-
- Added Destination Ding noise, plays when TARDIS initially starts landing
21-
- TARDIS flight noise now loops via LoopingSound
22-
23-
## Commands
24-
#### Additions
25-
- Introduced Upgrades command to unlock/lock TARDIS Upgrades
26-
- Introduced Points command to set TARDIS xp/points
27-
28-
## Shells
29-
#### Updates
30-
- Updated Police Box Shell Model
31-
- Updated Factory Shell Model
32-
#### Additions
33-
- Added Lift Shell
34-
- Added Hieroglyph
35-
- Added Castle
36-
#### Removals
37-
- Removed Police Box "Marbles" Pattern due to Model Change
38-
- Removed Police Box "Gaudy" Pattern due to Model Change
39-
- Removed Police Box "Metal" Pattern due to Model Change
40-
- Removed Police Box "Stone" Pattern due to Model Change
41-
- Removed Police Box "Red" Pattern due to Model Change
42-
43-
## Crafting
44-
- Bulkhead doors can now be crafted
45-
46-
## Consoles
47-
#### Additions
48-
- Updated all Toyota Pattern Textures
49-
#### Updates
50-
- Updated Nuka Default Pattern
51-
52-
## Interiors
53-
- Added Shalka Interior
54-
55-
## TARDIS Growth Process
56-
- Players must now use Shears to unlock the growth stage TARDIS
57-
58-
## Rooms
59-
- ARS Room is back under mod protection
60-
- 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)
61-
62-
## Immersive Portals (Fabric)
63-
- Fixed bug where users could not leave via Immersive Portals portals due to a sizing issue
64-
65-
## Quality of Life
66-
- Interior doors and Shells now hold their own data instead of taking it from their related dimension
67-
- Shell animations now play in Shell Selection Screen
68-
- Sounds that loop are now handled differently, improving performance
69-
- Root shell now only creates the TARDIS dimension when sheared (Hi Performance gains!)
70-
- TARDIS interior is now air instead of growth stone
71-
72-
73-
# Bugs
74-
- Fix GlobalDoorBlock deleting the player held item when interacted with
75-
- Fix unexpected behaviour with ConsoleConfigurator console removal logic and change theme
76-
- Fixed console removal running the interaction twice and causing the configurator to change its console theme
77-
- Fixed console changing not updating control positions and sizes
78-
- Fixed various screens hard crashing the server
79-
- Fixed BulkHeadDoor deleting blocks around it when placed, you can no longer place it unless there is enough room
80-
81-
82-
## API
83-
#### Additions
84-
- Added TARDIS Upgrade Unlocked Event
85-
- Allows other mods to add: Shells, Patterns, Desktops, Consoles, Upgrades
1+
Fixes:
2+
- Fixes #271 - Darkened background of reconfiguration UI is rendering in the foreground
3+
- Fixes #259 - Console Configurator Hologram no longer updates
864

875

886

7+
Additions:
8+
- Added Faded Police Box Shell Pattern

common/src/main/java/whocraft/tardis_refined/ControlGroupCheckers.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
package whocraft.tardis_refined;
22

3-
import com.google.gson.Gson;
43
import com.google.gson.JsonArray;
54
import com.google.gson.JsonElement;
65
import com.google.gson.JsonParser;
76
import net.minecraft.network.chat.Component;
87
import net.minecraft.server.MinecraftServer;
9-
import net.minecraft.server.level.ServerLevel;
108

119
import java.io.BufferedReader;
1210
import java.io.IOException;
@@ -22,22 +20,23 @@ public class ControlGroupCheckers {
2220

2321
public static final ControlGroupCheckers INSTANCE = new ControlGroupCheckers();
2422
private static final String API_URL = "https://mc.craig.software/api/skin/beta_players";
25-
private List<String> uuidList;
23+
private final List<String> uuidList;
2624

2725
public ControlGroupCheckers() {
2826
this.uuidList = new ArrayList<>();
2927
fetchUUIDsFromAPI();
3028
}
3129

3230
public static void tickServer(MinecraftServer serverLevel){
33-
if(!IS_CONTROL_GROUP) return;
31+
if (!IS_CONTROL_GROUP) return;
3432
serverLevel.getPlayerList().getPlayers().iterator().forEachRemaining(serverPlayer -> {
3533
if(!ControlGroupCheckers.INSTANCE.isUUIDInList(serverPlayer.getStringUUID())){
3634
serverPlayer.connection.disconnect(Component.literal("Womp Womp! You're not on the list! :("));
3735
}
3836
});
3937
}
4038

39+
4140
public void fetchUUIDsFromAPI() {
4241
try {
4342
URL url = new URL(API_URL);

common/src/main/java/whocraft/tardis_refined/TRConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static class Common {
5353

5454
public Common(ModConfigSpec.Builder builder) {
5555
builder.push("compatibility");
56-
COMPATIBILITY_IP = builder.comment("Toggle Immersive Portals compatibility (TR 2.0+). 2.0 has limited support and does not recommend enabling this.").translation(ModMessages.CONFIG_IP_COMPAT).define("immersive_portals_version_two", false);
56+
COMPATIBILITY_IP = builder.comment("Toggle Immersive Portals compatibility (TR 2.0+). 2.0 has limited support and does not recommend enabling this.").translation(ModMessages.CONFIG_IP_COMPAT).define("immersive_portals_support", true);
5757
builder.pop();
5858
}
5959

common/src/main/java/whocraft/tardis_refined/api/event/TardisCommonEvents.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ public class TardisCommonEvents {
5050
}
5151
});
5252

53+
public static final Event<DesktopChangeEvent> DESKTOP_CHANGE_EVENT = new Event<>(DesktopChangeEvent.class, listeners -> (tardisLevelOperator) -> {
54+
for (DesktopChangeEvent listener : listeners) {
55+
listener.onDesktopChange(tardisLevelOperator);
56+
}
57+
});
58+
5359
public static final Event<TardisCrash> TARDIS_CRASH_EVENT = new Event<>(TardisCrash.class, listeners -> ((tardisLevelOperator, crashLocation) -> {
5460
for (TardisCrash listener : listeners) {
5561
listener.onTardisCrash(tardisLevelOperator, crashLocation);
@@ -130,6 +136,22 @@ public interface OpenDoor {
130136
void onDoorOpen(TardisLevelOperator tardisLevelOperator);
131137
}
132138

139+
140+
/**
141+
* An event that is triggered when the TARDIS desktp is changed.
142+
* Note: Only fired once all players have left the dimension
143+
*/
144+
@FunctionalInterface
145+
public interface DesktopChangeEvent {
146+
/**
147+
* Called when the TARDIS desktp is changed.
148+
*
149+
* @param tardisLevelOperator The operator of the TARDIS level.
150+
*/
151+
void onDesktopChange(TardisLevelOperator tardisLevelOperator);
152+
}
153+
154+
133155
/**
134156
* An event that is triggered when a TARDIS lands.
135157
*/

common/src/main/java/whocraft/tardis_refined/client/model/blockentity/door/interior/NukaDoorModel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, i
5151

5252
@Override
5353
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) {
54-
54+
root.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha);
5555
}
5656

5757
@Override

common/src/main/java/whocraft/tardis_refined/client/renderer/blockentity/door/GlobalDoorRenderer.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import whocraft.tardis_refined.client.model.blockentity.shell.ShellModelCollection;
1414
import whocraft.tardis_refined.common.block.door.GlobalDoorBlock;
1515
import whocraft.tardis_refined.common.blockentity.door.GlobalDoorBlockEntity;
16+
import whocraft.tardis_refined.compat.ModCompatChecker;
17+
import whocraft.tardis_refined.compat.portals.ImmersivePortalsClient;
1618

1719
public class GlobalDoorRenderer implements BlockEntityRenderer<GlobalDoorBlockEntity>, BlockEntityRendererProvider<GlobalDoorBlockEntity> {
1820

@@ -26,6 +28,13 @@ public GlobalDoorRenderer(BlockEntityRendererProvider.Context context) {
2628

2729
@Override
2830
public void render(GlobalDoorBlockEntity blockEntity, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource, int packedLight, int packedOverlay) {
31+
32+
if(ModCompatChecker.immersivePortals()){
33+
if(ImmersivePortalsClient.shouldStopRenderingInPortal()){
34+
return;
35+
}
36+
}
37+
2938
poseStack.pushPose();
3039
poseStack.translate(0.5F, 1.5F, 0.5F);
3140
poseStack.mulPose(Axis.ZP.rotationDegrees(180F));
@@ -40,7 +49,7 @@ public void render(GlobalDoorBlockEntity blockEntity, float partialTick, PoseSta
4049
currentModel = ShellModelCollection.getInstance().getShellEntry(theme).getShellDoorModel(blockEntity.pattern());
4150

4251
currentModel.setDoorPosition(isOpen);
43-
currentModel.renderInteriorDoor(blockEntity, isOpen, true, poseStack, bufferSource.getBuffer(RenderType.entityTranslucent(currentModel.getInteriorDoorTexture(blockEntity))), packedLight, OverlayTexture.NO_OVERLAY, 1f, 1f, 1f, 1f);
52+
currentModel.renderInteriorDoor(blockEntity, isOpen, true, poseStack, bufferSource.getBuffer(RenderType.entityTranslucentCull(currentModel.getInteriorDoorTexture(blockEntity))), packedLight, OverlayTexture.NO_OVERLAY, 1f, 1f, 1f, 1f);
4453

4554
poseStack.popPose();
4655
}

common/src/main/java/whocraft/tardis_refined/client/screen/MonitorScreen.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ public GenericMonitorSelectionList createSelectionList() {
8383
//selectionList.children().add(new SelectionListEntry(Component.translatable(ModMessages.UI_MONITOR_UPLOAD_COORDS), entry -> new C2SOpenCoordinatesDisplayMessage(CoordInputType.TRAVEL).send(), leftPos, Upgrades.COORDINATE_INPUT.get().isUnlocked(upgradeHandler)));
8484

8585
selectionList.children().add(new SelectionListEntry(Component.translatable(ModMessages.UI_MONITOR_SELECT_HUM), entry -> Minecraft.getInstance().setScreen(new HumSelectionScreen()), leftPos));
86-
selectionList.children().add(new SelectionListEntry(Component.translatable(ModMessages.UI_MONITOR_EJECT), entry -> new EjectPlayerFromConsoleMessage().send(), leftPos));
86+
selectionList.children().add(new SelectionListEntry(Component.translatable(ModMessages.UI_MONITOR_EJECT), entry -> {
87+
new EjectPlayerFromConsoleMessage().send();
88+
Minecraft.getInstance().setScreen(null);
89+
}, leftPos));
8790

8891

8992
if (selectionList.children().isEmpty()) {

common/src/main/java/whocraft/tardis_refined/client/sounds/LoopingHumSound.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package whocraft.tardis_refined.client.sounds;
22

33
import net.minecraft.client.Minecraft;
4+
import net.minecraft.client.player.LocalPlayer;
45
import net.minecraft.client.sounds.SoundManager;
56
import net.minecraft.client.sounds.WeighedSoundEvents;
67
import net.minecraft.sounds.SoundEvent;
78
import net.minecraft.sounds.SoundSource;
89
import org.jetbrains.annotations.NotNull;
10+
import whocraft.tardis_refined.registry.TRDimensionTypes;
911

1012
public class LoopingHumSound extends LoopingSound{
1113
private SoundEvent soundEvent;
@@ -23,9 +25,17 @@ public void setSoundEvent(SoundEvent soundEvent) {
2325
public void tick() {
2426
super.tick();
2527
volume = 0.10F;
26-
if(Minecraft.getInstance().player != null){
27-
setLocation(Minecraft.getInstance().player.position());
28+
LocalPlayer player = Minecraft.getInstance().player;
29+
if(player != null){
30+
setLocation(player.position());
31+
32+
if(player.level().dimensionTypeId() != TRDimensionTypes.TARDIS){
33+
stopSound();
34+
}
35+
2836
}
37+
38+
2939
}
3040

3141
// So, I don't like this. But it is necessary else we are making another Mixin, which isn't a bad thing but better to avoid

common/src/main/java/whocraft/tardis_refined/common/blockentity/device/CorridorTeleporterBlockEntity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void tick(Level level, BlockPos blockPos, BlockState blockState, Corridor
6666
List<Entity> entities = serverLevel.getEntitiesOfClass(Entity.class, box);
6767
BlockPos corridorAirlock = TardisInteriorManager.STATIC_CORRIDOR_POSITION;
6868
for (Entity entity : entities) {
69-
TardisTeleportData.getOrCreate(serverLevel).scheduleEntityTeleport(entity, serverLevel.dimension(), corridorAirlock.getX() + 0.5f, corridorAirlock.getY(), corridorAirlock.getZ() + 0.5f, 0,0 );
69+
TardisTeleportData.scheduleEntityTeleport(entity, serverLevel.dimension(), corridorAirlock.getX() + 0.5f, corridorAirlock.getY(), corridorAirlock.getZ() + 0.5f, 0,0 );
7070
}
7171

7272
if (entities.stream().count() > 0) {

0 commit comments

Comments
 (0)