mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2026-02-01 00:10:15 +00:00
Update to Minecraft 1.17.1
- Remap everything to use MojMap class names too. This is what Forge
uses, so \o/.
This does NOT currently rename any classes to use suffix notation or
BlockEntity. That will come in a later change. We do however rename
references of "World" to "Level".
- Move the test mod into a separate "cctest" source set. As Forge now
works using Jigsaw we cannot have multiple mods defining the same
package, which causes problems with our JUnit test classes.
- Remove our custom test framework and replace it with vanilla's (this
is no longer stripped from the jar). RIP kotlin coroutines.
It's still worth using Kotlin here though, just for extension
methods.
- Other 1.17-related changes:
- Use separate tile/block entity tick methods for server and client
side, often avoiding ticking at all on the client.
- Switch much of the monitor rendering code to use vanilla's
built-in shader system. It's still an incredibly ugly hack, so not
really expecting this to work with any rendering mods, but we'll
cross that bridge when we come to it.
This commit is contained in:
@@ -5,17 +5,17 @@
|
||||
*/
|
||||
package dan200.computercraft.shared.command;
|
||||
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/**
|
||||
* The level a user must be at in order to execute a command.
|
||||
*/
|
||||
public enum UserLevel implements Predicate<CommandSource>
|
||||
public enum UserLevel implements Predicate<CommandSourceStack>
|
||||
{
|
||||
/**
|
||||
* Only can be used by the owner of the server: namely the server console or the player in SSP.
|
||||
@@ -53,7 +53,7 @@ public enum UserLevel implements Predicate<CommandSource>
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean test( CommandSource source )
|
||||
public boolean test( CommandSourceStack source )
|
||||
{
|
||||
if( this == ANYONE ) return true;
|
||||
|
||||
@@ -61,8 +61,8 @@ public enum UserLevel implements Predicate<CommandSource>
|
||||
{
|
||||
MinecraftServer server = source.getServer();
|
||||
Entity sender = source.getEntity();
|
||||
if( server.isSingleplayer() && sender instanceof PlayerEntity &&
|
||||
((PlayerEntity) sender).getGameProfile().getName().equalsIgnoreCase( server.getServerModName() ) )
|
||||
if( server.isSingleplayer() && sender instanceof Player &&
|
||||
((Player) sender).getGameProfile().getName().equalsIgnoreCase( server.getServerModName() ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user