1
0

Partial upgrade to 1.18.1

This commit is contained in:
Ryan Fox 2022-01-29 17:18:37 -08:00
parent 326e9cc4fc
commit 8c51919e4e
Signed by: flewkey
GPG Key ID: 94F56ADFD848851E
12 changed files with 46 additions and 47 deletions

View File

@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.4-SNAPSHOT'
id 'fabric-loom' version '0.11-SNAPSHOT'
}
repositories {
@ -9,13 +9,14 @@ repositories {
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modCompile "net.fabricmc:fabric-loader:${project.loader_version}"
modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modCompile "org.json:json:20200518"
modCompile "org.xerial:sqlite-jdbc:3.32.3.2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modImplementation "org.json:json:20211205"
modImplementation "org.xerial:sqlite-jdbc:3.36.0.3"
modImplementation "com.google.code.findbugs:jsr305:3.0.2"
include "org.json:json:20200518"
include "org.xerial:sqlite-jdbc:3.32.3.2"
include "org.json:json:20211205"
include "org.xerial:sqlite-jdbc:3.36.0.3"
}
jar {

View File

@ -1,8 +1,8 @@
org.gradle.jvmargs=-Xmx1G
minecraft_version=1.16.3
yarn_mappings=1.16.3+build.47
loader_version=0.10.3+build.211
minecraft_version=1.18.1
yarn_mappings=1.18.1+build.22
loader_version=0.12.12
mod_version=1.2.0
maven_group=party.2a03.mc
maven_group=party._2a03.mc
archives_base_name=minecraft-tweaks-2a03
fabric_version=0.24.1+build.412-1.16
fabric_version=0.46.2+1.18

View File

@ -11,10 +11,10 @@ public class FlyCommand {
public static void register(CommandDispatcher<ServerCommandSource> dispatcher) {
dispatcher.register(CommandManager.literal("fly").executes(ctx -> {
ServerCommandSource source = ctx.getSource();
if (Config.getBool("disableFlyCommand")) {
//if (Config.getBool("disableFlyCommand")) {
source.sendFeedback(new LiteralText("The /fly command is disabled"), true);
return 0;
}
/*}
ServerPlayerEntity sender = source.getPlayer();
boolean flight = sender.abilities.allowFlying;
sender.abilities.allowFlying = !flight;
@ -25,7 +25,7 @@ public class FlyCommand {
sender.abilities.flying = false;
}
sender.sendAbilitiesUpdate();
return 1;
return 1;*/
}));
}
}

View File

@ -6,7 +6,7 @@ import net.minecraft.block.Blocks;
import net.minecraft.entity.ItemEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.server.command.CommandManager;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.network.ServerPlayerEntity;
@ -23,9 +23,9 @@ public class HeadCommand {
private static int giveHead(ServerCommandSource source, ServerPlayerEntity sender, String skullowner) {
ItemStack itemstack = new ItemStack(Blocks.PLAYER_HEAD.asItem());
CompoundTag compoundtag = new CompoundTag();
compoundtag.putString("SkullOwner", skullowner);
itemstack.setTag(compoundtag);
NbtCompound nbt = new NbtCompound();
nbt.putString("SkullOwner", skullowner);
itemstack.setNbt(nbt);
ItemEntity itementity = sender.dropItem(itemstack, false);
itementity.resetPickupDelay();
itementity.setOwner(sender.getUuid());

View File

@ -34,9 +34,9 @@ public class HomeCommand {
double x = sender.getX();
double y = sender.getY();
double z = sender.getZ();
float yaw = sender.yaw;
float pitch = sender.pitch;
RegistryKey registrykey = sender.getServerWorld().getRegistryKey();
float yaw = sender.getYaw();
float pitch = sender.getPitch();
RegistryKey registrykey = sender.getWorld().getRegistryKey();
PlayerPosition location = new PlayerPosition(x, y, z, yaw, pitch, registrykey);
playerdata.setHome(location);
source.sendFeedback(new LiteralText("Your home has been updated"), true);
@ -52,9 +52,9 @@ public class HomeCommand {
double x = sender.getX();
double y = sender.getY();
double z = sender.getZ();
float yaw = sender.yaw;
float pitch = sender.pitch;
RegistryKey registrykey = sender.getServerWorld().getRegistryKey();
float yaw = sender.getYaw();
float pitch = sender.getPitch();
RegistryKey registrykey = sender.getWorld().getRegistryKey();
PlayerPosition location = new PlayerPosition(x, y, z, yaw, pitch, registrykey);
playerdata.setHome(location);
source.sendFeedback(new LiteralText("User's home has been updated (" + StringArgumentType.getString(ctx, "UUID") + ")"), true);

View File

@ -37,9 +37,9 @@ public class SpawnCommand {
double x = sender.getX();
double y = sender.getY();
double z = sender.getZ();
float yaw = sender.yaw;
float pitch = sender.pitch;
RegistryKey registrykey = sender.getServerWorld().getRegistryKey();
float yaw = sender.getYaw();
float pitch = sender.getPitch();
RegistryKey registrykey = sender.getWorld().getRegistryKey();
PlayerPosition location = new PlayerPosition(x, y, z, yaw, pitch, registrykey);
Config.setData("spawn", location.getJSON());
source.sendFeedback(new LiteralText("Spawn has been set"), true);

View File

@ -1,5 +1,7 @@
package party._2a03.mc.mixin;
import java.util.Collection;
import com.mojang.brigadier.context.CommandContext;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.command.GameModeCommand;
import net.minecraft.server.network.ServerPlayerEntity;
@ -8,14 +10,14 @@ import net.minecraft.world.GameMode;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(GameModeCommand.class)
public class MixinGameModeCommand {
@Inject(method = "setGameMode", at = @At("HEAD"))
private static void OnSetGameMode(ServerCommandSource source, ServerPlayerEntity player, GameMode gameMode, CallbackInfo ci) {
@Inject(method = "execute", at = @At("HEAD"))
private static void OnExecute(CommandContext<ServerCommandSource> context, Collection<ServerPlayerEntity> targets, GameMode gameMode, CallbackInfoReturnable cir) {
if (gameMode == GameMode.CREATIVE) {
source.sendFeedback(new LiteralText("<Server> Creative mode? What are you, a cheater?"), false);
context.getSource().sendFeedback(new LiteralText("<Server> Creative mode? What are you, a cheater?"), false);
}
return;
}

View File

@ -31,11 +31,11 @@ public abstract class MixinServerPlayerEntity extends PlayerEntity {
}
}
@Inject(method = "setGameMode", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerPlayerEntity;sendAbilitiesUpdate()V"))
/*@Inject(method = "setGameMode", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerPlayerEntity;sendAbilitiesUpdate()V"))
public void disableFlightIfSafe(GameMode gameMode, CallbackInfo ci) {
if (gameMode != GameMode.CREATIVE && gameMode != GameMode.SPECTATOR) {
this.abilities.allowFlying = false;
this.abilities.flying = false;
}
}
}*/
}

View File

@ -13,13 +13,9 @@ import party._2a03.mc.util.Config;
@Mixin(TntEntity.class)
public abstract class MixinTntEntity extends Entity {
@Shadow
private int fuseTimer;
public MixinTntEntity(EntityType<? extends TntEntity> entityType, World world) {
super(entityType, world);
this.fuseTimer = 80;
this.inanimate = true;
this.intersectionChecked = true;
}
@Inject(method = "explode", at = @At("HEAD"), cancellable = true)

View File

@ -24,7 +24,7 @@ public class PlayerPosition {
this.z = data.getDouble(2);
this.yaw = data.getNumber(3).floatValue();
this.pitch = data.getNumber(4).floatValue();
this.registrykey = RegistryKey.of(Registry.DIMENSION, new Identifier(registry_string));
this.registrykey = RegistryKey.of(Registry.DIMENSION_KEY, new Identifier(registry_string));
}
}

View File

@ -2,17 +2,17 @@
"schemaVersion": 1,
"id": "minecraft-tweaks-2a03",
"version": "1.2.0",
"name": "2a03.party Tweaks",
"description": "Simple modifications for the 2a03.party Minecraft server.",
"name": "minecraft-tweaks-2a03",
"description": "Simple modifications for mc.2a03.party.",
"authors": [
"flewkey"
],
"contact": {
"homepage": "https://flewkey.com/",
"sources": "https://github.com/flewkey/minecraft-tweaks-2a03"
"sources": "https://git.sdf.org/flewkey/minecraft-tweaks-2a03"
},
"license": "MIT",
"icon": "assets/2a03-minecraft-tweaks/icon.png",
"icon": "assets/minecraft-tweaks-2a03/icon.png",
"environment": "*",
"entrypoints": {
"main": [
@ -23,8 +23,8 @@
"minecraft-tweaks-2a03.mixins.json"
],
"depends": {
"fabricloader": ">=0.8.2",
"fabricloader": ">=0.12.12",
"fabric": "*",
"minecraft": "1.16.x"
"minecraft": "1.18.1"
}
}

View File

@ -1,7 +1,7 @@
{
"required": true,
"package": "party._2a03.mc.mixin",
"compatibilityLevel": "JAVA_8",
"compatibilityLevel": "JAVA_17",
"server": [
"MixinGameMode",
"MixinGameModeCommand",