Skip to content

Commit

Permalink
Fixed shell pattern syncing, root shell waterlogging
Browse files Browse the repository at this point in the history
-Fixed AestheticHandler not using correct nbt key for deserialising shell theme data
-Fixed root shell block being always waterlogged on placement
-Added explicit Override annotations to handler classes
  • Loading branch information
50ap5ud5 committed Dec 20, 2023
1 parent 6e77752 commit c6eb5b3
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class RootedShellBlock extends ShellBaseBlock {
public RootedShellBlock(BlockBehaviour.Properties properties) {

super(properties);
this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(OPEN, false).setValue(REGEN, false));
this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(OPEN, false).setValue(REGEN, false).setValue(WATERLOGGED, false));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public void loadData(CompoundTag tag) {
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));
ResourceLocation themeID = new ResourceLocation(shellInfo.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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public ServerLevel getLevel() {
public void tick() {

}

@Override
public CompoundTag saveData(CompoundTag tag) {

if (this.lastKnownLocation != null) {
Expand All @@ -111,7 +111,7 @@ public CompoundTag saveData(CompoundTag tag) {

return tag;
}

@Override
public void loadData(CompoundTag tag) {
this.lastKnownLocation = NbtConstants.getTardisNavLocation(tag, "lk_ext", operator);
locked = tag.getBoolean(NbtConstants.LOCKED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public TardisFlightEventManager(TardisLevelOperator operator) {
this.operator = operator;
this.possibleControls = Arrays.stream(ConsoleControl.values()).filter(x -> x != ConsoleControl.MONITOR && x != ConsoleControl.THROTTLE).toList();
}

@Override
public void loadData(CompoundTag tag) {
this.isWaitingForControlResponse = tag.getBoolean("isWaitingForControlResponse");
this.isInDangerZone = tag.getBoolean("isInDangerZone");
Expand All @@ -55,7 +55,7 @@ public void loadData(CompoundTag tag) {
this.dangerZoneShakeScale = tag.getInt("dangerZoneShakeScale");
this.controlPrompt = ConsoleControl.findOr(tag.getString("controlPrompt"), ConsoleControl.THROTTLE);
}

@Override
public CompoundTag saveData(CompoundTag tag) {
tag.putBoolean("isWaitingForControlResponse", this.isWaitingForControlResponse);
tag.putBoolean("isInDangerZone", this.isInDangerZone);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public CompoundTag saveData(CompoundTag tag) {
tag.putString(NbtConstants.TARDIS_IM_CURRENT_THEME, this.currentTheme.getIdentifier().toString());
return tag;
}

@Override
public void loadData(CompoundTag tag) {
this.isWaitingToGenerate = tag.getBoolean(NbtConstants.TARDIS_IM_IS_WAITING_TO_GENERATE);
this.isGeneratingDesktop = tag.getBoolean(NbtConstants.TARDIS_IM_GENERATING_DESKTOP);
Expand All @@ -121,6 +121,7 @@ public void loadData(CompoundTag tag) {
this.corridorAirlockCenter = NbtUtils.readBlockPos(tag.getCompound(NbtConstants.TARDIS_IM_AIRLOCK_CENTER));
}


public void tick(ServerLevel level) {

if (this.isWaitingToGenerate) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public int getCooldownDuration() {
public void endCoolDown() {
this.ticksSinceCrash = TICKS_COOLDOWN_MAX;
}

@Override
public void loadData(CompoundTag tag) {
this.autoLand = tag.getBoolean(NbtConstants.CONTROL_AUTOLAND);
this.isInFlight = tag.getBoolean(NbtConstants.CONTROL_IS_IN_FLIGHT);
Expand All @@ -118,7 +118,7 @@ public void loadData(CompoundTag tag) {
public void tick() {

}

@Override
public CompoundTag saveData(CompoundTag tag) {
tag.putBoolean(NbtConstants.CONTROL_IS_IN_FLIGHT, this.isInFlight);
tag.putBoolean(NbtConstants.CONTROL_AUTOLAND, this.autoLand);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public TardisNavLocation getWaypointByName(String name) {
public void tick() {

}

@Override
public CompoundTag saveData(CompoundTag compoundTag) {
ListTag waypointsList = new ListTag();
for (TardisNavLocation location : waypointMap.values()) {
Expand All @@ -47,7 +47,7 @@ public CompoundTag saveData(CompoundTag compoundTag) {
compoundTag.put("Waypoints", waypointsList);
return compoundTag;
}

@Override
public void loadData(CompoundTag tag) {
waypointMap.clear();
ListTag waypointsList = tag.getList("Waypoints", 10);
Expand Down

0 comments on commit c6eb5b3

Please sign in to comment.