Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pisaiah committed Oct 10, 2023
1 parent 64a488f commit 53ad662
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@
import net.minecraft.util.Formatting;
import net.minecraft.text.*;

import net.minecraft.util.Identifier;
import me.isaiah.multiworld.MultiworldMod;

//import me.isaiah.lib.IText;

/**
* Ensures compatiblity with colored chat in 1.18.2
*/
public class Fabric18Text {

public static Text colored_literal(String txt, Formatting color) {
return Text.of(txt);//IText.colored_literal(txt, color);
public static Text colored_literal_Depreated(String txt, Formatting color) {
return Text.of(txt);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,13 @@ public Text colored_literal(String txt, Formatting color) {
try {
return Text.of(txt).copy().formatted(color);
} catch (Exception | IncompatibleClassChangeError e) {
// Stupid Mojang changed color chat.
// Fallback for 1.18.2:
return Fabric18Text.colored_literal(txt, color);
// Fallback
return Text.of(txt);
}
}

@Override
public boolean is_the_end(ServerWorld world) {
// TODO Auto-generated method stub
if (!world.getDimension().isBedWorking() && !world.getDimension().hasCeiling()) {
return true;
}
Expand All @@ -72,7 +70,6 @@ public boolean is_the_end(ServerWorld world) {

@Override
public BlockPos get_pos(double x, double y, double z) {
// TODO Auto-generated method stub
return new BlockPos(x, y, z);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
import net.minecraft.server.network.ServerPlayerEntity;

/**
* CyberPermissions was released before
* any other Permission API was.
* CyberPermissions API
*/
public class CyberHandler {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public Text colored_literal(String txt, Formatting color) {
try {
return Text.of(txt).copy().formatted(color);
} catch (Exception | IncompatibleClassChangeError e) {
// Fallback for 1.18.2:
// Fallback
return Text.of(txt);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package me.isaiah.multiworld.fabric;

import com.mojang.brigadier.exceptions.CommandSyntaxException;

import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.network.ServerPlayerEntity;
import me.isaiah.multiworld.perm.Perm;
import net.fabricmc.loader.api.FabricLoader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,11 @@ public Text colored_literal(String txt, Formatting color) {

@Override
public boolean is_the_end(ServerWorld world) {
// TODO Auto-generated method stub
return world.getDimensionKey() == DimensionTypes.THE_END;
}

@Override
public BlockPos get_pos(double x, double y, double z) {
// TODO Auto-generated method stub
return BlockPos.ofFloored(x, y, z);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
import net.minecraft.server.network.ServerPlayerEntity;

/**
* CyberPermissions was released before
* any other Permission API was.
* CyberPermissions API
*/
public class CyberHandler {

Expand Down

0 comments on commit 53ad662

Please sign in to comment.