This commit is contained in:
gnembon committed 2020-06-03 03:51:24 -03:00
commit 9aad10ed98
9 files changed
+23 -19

No files matched your search

+2 -2
View File
@@ -5,8 +5,8 @@ org.gradle.jvmargs=-Xmx1G
# check these on https://fabricmc.net/use # check these on https://fabricmc.net/use
# or better: https://modmuss50.me/fabric.html # or better: https://modmuss50.me/fabric.html
minecraft_version=20w22a minecraft_version=20w22a
yarn_mappings=20w22a+build.1 yarn_mappings=20w22a+build.10
loader_version=0.8.4+build.198 loader_version=0.8.5+build.199
# Mod Properties # Mod Properties
mod_version = 1.3.25+v200527 mod_version = 1.3.25+v200527
+6
View File
@@ -80,6 +80,11 @@ public class CarpetServer // static for now - easier to handle all around the co
public static void registerCarpetCommands(CommandDispatcher<ServerCommandSource> dispatcher) public static void registerCarpetCommands(CommandDispatcher<ServerCommandSource> dispatcher)
{ {
settingsManager.registerCommand(dispatcher);
extensions.forEach(e -> {
SettingsManager sm = e.customSettingsManager();
if (sm != null) sm.registerCommand(dispatcher);
});
TickCommand.register(dispatcher); TickCommand.register(dispatcher);
ProfileCommand.register(dispatcher); ProfileCommand.register(dispatcher);
CounterCommand.register(dispatcher); CounterCommand.register(dispatcher);
@@ -100,6 +105,7 @@ public class CarpetServer // static for now - easier to handle all around the co
if (FabricLoader.getInstance().isDevelopmentEnvironment()) if (FabricLoader.getInstance().isDevelopmentEnvironment())
TestCommand.register(dispatcher); TestCommand.register(dispatcher);
// todo 1.16 - re-registerer apps if that's a reload operation.
} }
public static void onPlayerLoggedIn(ServerPlayerEntity player) public static void onPlayerLoggedIn(ServerPlayerEntity player)
@@ -365,7 +365,7 @@ public class BlockRotator
if (newState != null) if (newState != null)
{ {
world.setBlockState(pos, newState, 2 | 1024); world.setBlockState(pos, newState, 2 | 1024);
world.checkBlockRerender(pos, state, newState); world.scheduleBlockRerenderIfNeeded(pos, state, newState);
return true; return true;
} }
return false; return false;
@@ -17,7 +17,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos; import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biomes; import net.minecraft.world.biome.Biomes;
import net.minecraft.world.biome.DefaultBiomeFeatures; import net.minecraft.world.gen.feature.DefaultBiomeFeatures;
import net.minecraft.world.biome.source.BiomeAccess; import net.minecraft.world.biome.source.BiomeAccess;
//import net.minecraft.world.biome.source.BiomeSource; //import net.minecraft.world.biome.source.BiomeSource;
//import net.minecraft.world.biome.source.FixedBiomeSource; //import net.minecraft.world.biome.source.FixedBiomeSource;
@@ -56,8 +56,8 @@ import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
import static net.minecraft.world.biome.DefaultBiomeFeatures.FANCY_TREE_CONFIG; import static net.minecraft.world.gen.feature.DefaultBiomeFeatures.FANCY_TREE_CONFIG;
import static net.minecraft.world.biome.DefaultBiomeFeatures.OAK_TREE_CONFIG; import static net.minecraft.world.gen.feature.DefaultBiomeFeatures.OAK_TREE_CONFIG;
public class FeatureGenerator public class FeatureGenerator
{ {
+1 -1
View File
@@ -182,7 +182,7 @@ public class Logger
public void sendPlayerMessage(ServerPlayerEntity player, BaseText ... messages) public void sendPlayerMessage(ServerPlayerEntity player, BaseText ... messages)
{ {
Arrays.stream(messages).forEach(message -> player.sendSystemMessage(message, Util.field_25140)); Arrays.stream(messages).forEach(message -> player.sendSystemMessage(message, Util.NIL_UUID));
} }
/** /**
@@ -39,7 +39,7 @@ public abstract class World_movableTEMixin implements WorldInterface, WorldAcces
//public abstract ChunkManager getChunkManager(); //public abstract ChunkManager getChunkManager();
@Shadow @Shadow
public abstract void checkBlockRerender(BlockPos blockPos_1, BlockState s1, BlockState s2); public abstract void scheduleBlockRerenderIfNeeded(BlockPos blockPos_1, BlockState s1, BlockState s2);
@Shadow @Shadow
public abstract void updateListeners(BlockPos var1, BlockState var2, BlockState var3, int var4); public abstract void updateListeners(BlockPos var1, BlockState var2, BlockState var3, int var4);
@@ -105,7 +105,7 @@ public abstract class World_movableTEMixin implements WorldInterface, WorldAcces
{ {
if (blockState_2 != blockState_3) if (blockState_2 != blockState_3)
{ {
this.checkBlockRerender(blockPos_1, blockState_2, blockState_3); this.scheduleBlockRerenderIfNeeded(blockPos_1, blockState_2, blockState_3);
} }
if ((int_1 & 2) != 0 && (!this.isClient || (int_1 & 4) == 0) && (this.isClient || worldChunk_1.getLevelType() != null && worldChunk_1.getLevelType().isAfter(ChunkHolder.LevelType.TICKING))) if ((int_1 & 2) != 0 && (!this.isClient || (int_1 & 4) == 0) && (this.isClient || worldChunk_1.getLevelType() != null && worldChunk_1.getLevelType().isAfter(ChunkHolder.LevelType.TICKING)))
@@ -860,7 +860,7 @@ public class CarpetExpression
boolean dropLoot = true; boolean dropLoot = true;
if (playerBreak) if (playerBreak)
{ {
boolean isUsingEffectiveTool = !state.method_29291() || tool.isEffectiveOn(state); //!can break by hand boolean isUsingEffectiveTool = !state.isToolRequired() || tool.isEffectiveOn(state);
//postMine() durability from item classes //postMine() durability from item classes
float hardness = state.getHardness(world, where); float hardness = state.getHardness(world, where);
int damageAmount = 0; int damageAmount = 0;
@@ -76,8 +76,6 @@ public class SettingsManager
{ {
this.server = server; this.server = server;
loadConfigurationFromConf(); loadConfigurationFromConf();
registerCommand(server.getCommandManager().getDispatcher());
notifyPlayersCommandsChanged();
} }
public void detachServer() public void detachServer()
@@ -359,7 +357,7 @@ public class SettingsManager
return rule; return rule;
} }
private void registerCommand(CommandDispatcher<ServerCommandSource> dispatcher) public void registerCommand(CommandDispatcher<ServerCommandSource> dispatcher)
{ {
if (dispatcher.getRoot().getChildren().stream().anyMatch(node -> node.getName().equalsIgnoreCase(identifier))) if (dispatcher.getRoot().getChildren().stream().anyMatch(node -> node.getName().equalsIgnoreCase(identifier)))
{ {
+6 -6
View File
@@ -258,7 +258,7 @@ public class Messenger
} }
public static void m(PlayerEntity player, Object ... fields) public static void m(PlayerEntity player, Object ... fields)
{ {
player.sendSystemMessage(Messenger.c(fields), Util.field_25140); //NULL UUID player.sendSystemMessage(Messenger.c(fields), Util.NIL_UUID);
} }
/* /*
@@ -302,7 +302,7 @@ public class Messenger
public static void send(PlayerEntity player, Collection<BaseText> lines) public static void send(PlayerEntity player, Collection<BaseText> lines)
{ {
lines.forEach(message -> player.sendSystemMessage(message, Util.field_25140)); lines.forEach(message -> player.sendSystemMessage(message, Util.NIL_UUID));
} }
public static void send(ServerCommandSource source, Collection<BaseText> lines) public static void send(ServerCommandSource source, Collection<BaseText> lines)
{ {
@@ -314,21 +314,21 @@ public class Messenger
{ {
if (server == null) if (server == null)
LOG.error("Message not delivered: "+message); LOG.error("Message not delivered: "+message);
server.sendSystemMessage(new LiteralText(message), Util.field_25140); server.sendSystemMessage(new LiteralText(message), Util.NIL_UUID);
BaseText txt = c("gi "+message); BaseText txt = c("gi "+message);
for (PlayerEntity entityplayer : server.getPlayerManager().getPlayerList()) for (PlayerEntity entityplayer : server.getPlayerManager().getPlayerList())
{ {
entityplayer.sendSystemMessage(txt, Util.field_25140); entityplayer.sendSystemMessage(txt, Util.NIL_UUID);
} }
} }
public static void print_server_message(MinecraftServer server, BaseText message) public static void print_server_message(MinecraftServer server, BaseText message)
{ {
if (server == null) if (server == null)
LOG.error("Message not delivered: "+message.getString()); LOG.error("Message not delivered: "+message.getString());
server.sendSystemMessage(message, Util.field_25140); server.sendSystemMessage(message, Util.NIL_UUID);
for (PlayerEntity entityplayer : server.getPlayerManager().getPlayerList()) for (PlayerEntity entityplayer : server.getPlayerManager().getPlayerList())
{ {
entityplayer.sendSystemMessage(message, Util.field_25140); entityplayer.sendSystemMessage(message, Util.NIL_UUID);
} }
} }
} }