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

Bunch of cleanup and make it work fast in 1.21 (thank you spottedleaf for making me delete 10+ mixins) #7

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group=net.gensokyoreimagined.nitori
version=1.5-SNAPSHOT
version=1.6-SNAPSHOT
description=Converting patches into mixins, for the Ignite Framework

org.gradle.parallel=true

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package net.gensokyoreimagined.nitori.common.chunkwatching;

public interface PlayerClientVDTracking {

boolean isClientViewDistanceChanged();

int getClientViewDistance();

}
//public interface PlayerClientVDTracking {
//
// boolean isClientViewDistanceChanged();
//
// int getClientViewDistance();
//
//}
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
package net.gensokyoreimagined.nitori.common.world.chunk;

import net.minecraft.server.level.FullChunkStatus;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.level.ChunkPos;

import java.util.ArrayList;
import java.util.function.BiConsumer;

public class ChunkStatusTracker {

//Add other callback types in the future when needed
private static final ArrayList<BiConsumer<ServerLevel, ChunkPos>> UNLOAD_CALLBACKS = new ArrayList<>();
public static void onChunkStatusChange(ServerLevel serverWorld, ChunkPos pos, FullChunkStatus levelType) {
boolean loaded = levelType.isOrAfter(FullChunkStatus.FULL);
if (!loaded) {
for (int i = 0; i < UNLOAD_CALLBACKS.size(); i++) {
UNLOAD_CALLBACKS.get(i).accept(serverWorld, pos);
}
}
}

public static void registerUnloadCallback(BiConsumer<ServerLevel, ChunkPos> callback) {
UNLOAD_CALLBACKS.add(callback);
}
}
//import net.minecraft.server.level.FullChunkStatus;
//import net.minecraft.server.level.ServerLevel;
//import net.minecraft.world.level.ChunkPos;
//
//import java.util.ArrayList;
//import java.util.function.BiConsumer;
//
//public class ChunkStatusTracker {
//
// //Add other callback types in the future when needed
// private static final ArrayList<BiConsumer<ServerLevel, ChunkPos>> UNLOAD_CALLBACKS = new ArrayList<>();
// public static void onChunkStatusChange(ServerLevel serverWorld, ChunkPos pos, FullChunkStatus levelType) {
// boolean loaded = levelType.isOrAfter(FullChunkStatus.FULL);
// if (!loaded) {
// for (int i = 0; i < UNLOAD_CALLBACKS.size(); i++) {
// UNLOAD_CALLBACKS.get(i).accept(serverWorld, pos);
// }
// }
// }
//
// public static void registerUnloadCallback(BiConsumer<ServerLevel, ChunkPos> callback) {
// UNLOAD_CALLBACKS.add(callback);
// }
//}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package net.gensokyoreimagined.nitori.common.world.listeners;

import net.minecraft.world.level.border.WorldBorder;
import net.minecraft.world.level.border.BorderChangeListener;

public interface WorldBorderListenerOnce extends BorderChangeListener {

void lithium$onWorldBorderShapeChange(WorldBorder worldBorder);

default void onAreaReplaced(WorldBorder border) {
this.lithium$onWorldBorderShapeChange(border);
}

@Override
default void onBorderSizeSet(WorldBorder border, double size) {
this.lithium$onWorldBorderShapeChange(border);
}

@Override
default void onBorderSizeLerping(WorldBorder border, double fromSize, double toSize, long time) {
this.lithium$onWorldBorderShapeChange(border);
}

@Override
default void onBorderCenterSet(WorldBorder border, double centerX, double centerZ) {
this.lithium$onWorldBorderShapeChange(border);
}

@Override
default void onBorderSetWarningTime(WorldBorder border, int warningTime) {

}

@Override
default void onBorderSetWarningBlocks(WorldBorder border, int warningBlockDistance) {

}

@Override
default void onBorderSetDamagePerBlock(WorldBorder border, double damagePerBlock) {

}

@Override
default void onBorderSetDamageSafeZOne(WorldBorder border, double safeZoneRadius) {

}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading