~jacksonchen666/TASTickrateChanger

c4a7f83fdcc979633d95e3bb5c79b2c14bca50fc — Jackson 3 years ago 43bad3c tiny-mod
mute messages, allow anyone, change version
M gradle.properties => gradle.properties +1 -1
@@ 12,7 12,7 @@ fabric_version=0.20.1+build.401-1.16


	#Mod properties
	mod_version         = Alpha4
	mod_version         = 1.0.1-Alpha
	maven_group         = de.scribble.lp.tastickratechanger
	archives_base_name  = TASTickratechanger(Fabric)-1.16.x


M src/main/java/de/scribble/lp/tastickratechanger/TickrateCommand.java => src/main/java/de/scribble/lp/tastickratechanger/TickrateCommand.java +6 -5
@@ 2,6 2,7 @@ package de.scribble.lp.tastickratechanger;

import java.util.Collection;

import com.mojang.brigadier.Command;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.arguments.FloatArgumentType;



@@ 15,23 16,23 @@ import net.minecraft.text.TranslatableText;
public class TickrateCommand {
	public TickrateCommand(CommandDispatcher<ServerCommandSource> dispatcher) {
		dispatcher.register(CommandManager.literal("tickrate").requires((serverCommandSource) -> {
	         return serverCommandSource.hasPermissionLevel(2);
	         return serverCommandSource.hasPermissionLevel(0);
	      }).
				then(CommandManager.argument("ticksPerSecond", FloatArgumentType.floatArg(0)).
					executes(source-> {
						source.getSource().getPlayer().sendMessage(new TranslatableText("Setting Tickrate to "+Float.toString(FloatArgumentType.getFloat(source, "ticksPerSecond")), new Object()), MessageType.SYSTEM, null);
//						source.getSource().getPlayer().sendMessage(new TranslatableText("Setting Tickrate to "+Float.toString(FloatArgumentType.getFloat(source, "ticksPerSecond")), new Object()), MessageType.SYSTEM, null);
						setTickrate(FloatArgumentType.getFloat(source, "ticksPerSecond"));
						return 0;
				}).then(CommandManager.literal("client").executes((source)->{
					source.getSource().getPlayer().sendMessage(new TranslatableText("Setting Client Tickrate to "+Float.toString(FloatArgumentType.getFloat(source, "ticksPerSecond")), new Object()), MessageType.SYSTEM, null);
//					source.getSource().getPlayer().sendMessage(new TranslatableText("Setting Client Tickrate to "+Float.toString(FloatArgumentType.getFloat(source, "ticksPerSecond")), new Object()), MessageType.SYSTEM, null);
					setTickrateClient(FloatArgumentType.getFloat(source, "ticksPerSecond"));
					return 0;
				})).then(CommandManager.literal("server").executes((source)->{
					source.getSource().getPlayer().sendMessage(new TranslatableText("Setting Server Tickrate to "+Float.toString(FloatArgumentType.getFloat(source, "ticksPerSecond")), new Object()), MessageType.SYSTEM, null);
//					source.getSource().getPlayer().sendMessage(new TranslatableText("Setting Server Tickrate to "+Float.toString(FloatArgumentType.getFloat(source, "ticksPerSecond")), new Object()), MessageType.SYSTEM, null);
					setTickrateServer(FloatArgumentType.getFloat(source, "ticksPerSecond"));
					return 0;
				})).then(CommandManager.argument("targets", EntityArgumentType.players()).executes((source)->{
					source.getSource().getPlayer().sendMessage(new TranslatableText("Setting Server Tickrate to "+Float.toString(FloatArgumentType.getFloat(source, "ticksPerSecond"))+" for players", new Object()), MessageType.SYSTEM, null);
//					source.getSource().getPlayer().sendMessage(new TranslatableText("Setting Server Tickrate to "+Float.toString(FloatArgumentType.getFloat(source, "ticksPerSecond"))+" for players", new Object()), MessageType.SYSTEM, null);
					setTickratePlayer(FloatArgumentType.getFloat(source, "ticksPerSecond"), EntityArgumentType.getPlayers(source, "targets"));
					return 0;
				}))

M src/main/resources/fabric.mod.json => src/main/resources/fabric.mod.json +2 -1
@@ 5,7 5,8 @@
  "name": "TASTickratechanger",
  "description": "Changes the Tickrate",
  "authors": [
    "ScribbleLP"
    "ScribbleLP",
    "JacksonChen666"
  ],
  "contributors": [],
  "contact": {},