Partial upgrade to 1.18.1
This commit is contained in:
parent
326e9cc4fc
commit
8c51919e4e
15
build.gradle
15
build.gradle
@ -1,5 +1,5 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'fabric-loom' version '0.4-SNAPSHOT'
|
id 'fabric-loom' version '0.11-SNAPSHOT'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@ -9,13 +9,14 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
||||||
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
|
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}"
|
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||||
modCompile "org.json:json:20200518"
|
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
||||||
modCompile "org.xerial:sqlite-jdbc:3.32.3.2"
|
modImplementation "org.json:json:20211205"
|
||||||
|
modImplementation "org.xerial:sqlite-jdbc:3.36.0.3"
|
||||||
modImplementation "com.google.code.findbugs:jsr305:3.0.2"
|
modImplementation "com.google.code.findbugs:jsr305:3.0.2"
|
||||||
include "org.json:json:20200518"
|
include "org.json:json:20211205"
|
||||||
include "org.xerial:sqlite-jdbc:3.32.3.2"
|
include "org.xerial:sqlite-jdbc:3.36.0.3"
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
org.gradle.jvmargs=-Xmx1G
|
org.gradle.jvmargs=-Xmx1G
|
||||||
minecraft_version=1.16.3
|
minecraft_version=1.18.1
|
||||||
yarn_mappings=1.16.3+build.47
|
yarn_mappings=1.18.1+build.22
|
||||||
loader_version=0.10.3+build.211
|
loader_version=0.12.12
|
||||||
mod_version=1.2.0
|
mod_version=1.2.0
|
||||||
maven_group=party.2a03.mc
|
maven_group=party._2a03.mc
|
||||||
archives_base_name=minecraft-tweaks-2a03
|
archives_base_name=minecraft-tweaks-2a03
|
||||||
fabric_version=0.24.1+build.412-1.16
|
fabric_version=0.46.2+1.18
|
||||||
|
@ -11,10 +11,10 @@ public class FlyCommand {
|
|||||||
public static void register(CommandDispatcher<ServerCommandSource> dispatcher) {
|
public static void register(CommandDispatcher<ServerCommandSource> dispatcher) {
|
||||||
dispatcher.register(CommandManager.literal("fly").executes(ctx -> {
|
dispatcher.register(CommandManager.literal("fly").executes(ctx -> {
|
||||||
ServerCommandSource source = ctx.getSource();
|
ServerCommandSource source = ctx.getSource();
|
||||||
if (Config.getBool("disableFlyCommand")) {
|
//if (Config.getBool("disableFlyCommand")) {
|
||||||
source.sendFeedback(new LiteralText("The /fly command is disabled"), true);
|
source.sendFeedback(new LiteralText("The /fly command is disabled"), true);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
/*}
|
||||||
ServerPlayerEntity sender = source.getPlayer();
|
ServerPlayerEntity sender = source.getPlayer();
|
||||||
boolean flight = sender.abilities.allowFlying;
|
boolean flight = sender.abilities.allowFlying;
|
||||||
sender.abilities.allowFlying = !flight;
|
sender.abilities.allowFlying = !flight;
|
||||||
@ -25,7 +25,7 @@ public class FlyCommand {
|
|||||||
sender.abilities.flying = false;
|
sender.abilities.flying = false;
|
||||||
}
|
}
|
||||||
sender.sendAbilitiesUpdate();
|
sender.sendAbilitiesUpdate();
|
||||||
return 1;
|
return 1;*/
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import net.minecraft.block.Blocks;
|
|||||||
import net.minecraft.entity.ItemEntity;
|
import net.minecraft.entity.ItemEntity;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
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.CommandManager;
|
||||||
import net.minecraft.server.command.ServerCommandSource;
|
import net.minecraft.server.command.ServerCommandSource;
|
||||||
import net.minecraft.server.network.ServerPlayerEntity;
|
import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
@ -23,9 +23,9 @@ public class HeadCommand {
|
|||||||
|
|
||||||
private static int giveHead(ServerCommandSource source, ServerPlayerEntity sender, String skullowner) {
|
private static int giveHead(ServerCommandSource source, ServerPlayerEntity sender, String skullowner) {
|
||||||
ItemStack itemstack = new ItemStack(Blocks.PLAYER_HEAD.asItem());
|
ItemStack itemstack = new ItemStack(Blocks.PLAYER_HEAD.asItem());
|
||||||
CompoundTag compoundtag = new CompoundTag();
|
NbtCompound nbt = new NbtCompound();
|
||||||
compoundtag.putString("SkullOwner", skullowner);
|
nbt.putString("SkullOwner", skullowner);
|
||||||
itemstack.setTag(compoundtag);
|
itemstack.setNbt(nbt);
|
||||||
ItemEntity itementity = sender.dropItem(itemstack, false);
|
ItemEntity itementity = sender.dropItem(itemstack, false);
|
||||||
itementity.resetPickupDelay();
|
itementity.resetPickupDelay();
|
||||||
itementity.setOwner(sender.getUuid());
|
itementity.setOwner(sender.getUuid());
|
||||||
|
@ -34,9 +34,9 @@ public class HomeCommand {
|
|||||||
double x = sender.getX();
|
double x = sender.getX();
|
||||||
double y = sender.getY();
|
double y = sender.getY();
|
||||||
double z = sender.getZ();
|
double z = sender.getZ();
|
||||||
float yaw = sender.yaw;
|
float yaw = sender.getYaw();
|
||||||
float pitch = sender.pitch;
|
float pitch = sender.getPitch();
|
||||||
RegistryKey registrykey = sender.getServerWorld().getRegistryKey();
|
RegistryKey registrykey = sender.getWorld().getRegistryKey();
|
||||||
PlayerPosition location = new PlayerPosition(x, y, z, yaw, pitch, registrykey);
|
PlayerPosition location = new PlayerPosition(x, y, z, yaw, pitch, registrykey);
|
||||||
playerdata.setHome(location);
|
playerdata.setHome(location);
|
||||||
source.sendFeedback(new LiteralText("Your home has been updated"), true);
|
source.sendFeedback(new LiteralText("Your home has been updated"), true);
|
||||||
@ -52,9 +52,9 @@ public class HomeCommand {
|
|||||||
double x = sender.getX();
|
double x = sender.getX();
|
||||||
double y = sender.getY();
|
double y = sender.getY();
|
||||||
double z = sender.getZ();
|
double z = sender.getZ();
|
||||||
float yaw = sender.yaw;
|
float yaw = sender.getYaw();
|
||||||
float pitch = sender.pitch;
|
float pitch = sender.getPitch();
|
||||||
RegistryKey registrykey = sender.getServerWorld().getRegistryKey();
|
RegistryKey registrykey = sender.getWorld().getRegistryKey();
|
||||||
PlayerPosition location = new PlayerPosition(x, y, z, yaw, pitch, registrykey);
|
PlayerPosition location = new PlayerPosition(x, y, z, yaw, pitch, registrykey);
|
||||||
playerdata.setHome(location);
|
playerdata.setHome(location);
|
||||||
source.sendFeedback(new LiteralText("User's home has been updated (" + StringArgumentType.getString(ctx, "UUID") + ")"), true);
|
source.sendFeedback(new LiteralText("User's home has been updated (" + StringArgumentType.getString(ctx, "UUID") + ")"), true);
|
||||||
|
@ -37,9 +37,9 @@ public class SpawnCommand {
|
|||||||
double x = sender.getX();
|
double x = sender.getX();
|
||||||
double y = sender.getY();
|
double y = sender.getY();
|
||||||
double z = sender.getZ();
|
double z = sender.getZ();
|
||||||
float yaw = sender.yaw;
|
float yaw = sender.getYaw();
|
||||||
float pitch = sender.pitch;
|
float pitch = sender.getPitch();
|
||||||
RegistryKey registrykey = sender.getServerWorld().getRegistryKey();
|
RegistryKey registrykey = sender.getWorld().getRegistryKey();
|
||||||
PlayerPosition location = new PlayerPosition(x, y, z, yaw, pitch, registrykey);
|
PlayerPosition location = new PlayerPosition(x, y, z, yaw, pitch, registrykey);
|
||||||
Config.setData("spawn", location.getJSON());
|
Config.setData("spawn", location.getJSON());
|
||||||
source.sendFeedback(new LiteralText("Spawn has been set"), true);
|
source.sendFeedback(new LiteralText("Spawn has been set"), true);
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package party._2a03.mc.mixin;
|
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.ServerCommandSource;
|
||||||
import net.minecraft.server.command.GameModeCommand;
|
import net.minecraft.server.command.GameModeCommand;
|
||||||
import net.minecraft.server.network.ServerPlayerEntity;
|
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.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
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)
|
@Mixin(GameModeCommand.class)
|
||||||
public class MixinGameModeCommand {
|
public class MixinGameModeCommand {
|
||||||
@Inject(method = "setGameMode", at = @At("HEAD"))
|
@Inject(method = "execute", at = @At("HEAD"))
|
||||||
private static void OnSetGameMode(ServerCommandSource source, ServerPlayerEntity player, GameMode gameMode, CallbackInfo ci) {
|
private static void OnExecute(CommandContext<ServerCommandSource> context, Collection<ServerPlayerEntity> targets, GameMode gameMode, CallbackInfoReturnable cir) {
|
||||||
if (gameMode == GameMode.CREATIVE) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -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) {
|
public void disableFlightIfSafe(GameMode gameMode, CallbackInfo ci) {
|
||||||
if (gameMode != GameMode.CREATIVE && gameMode != GameMode.SPECTATOR) {
|
if (gameMode != GameMode.CREATIVE && gameMode != GameMode.SPECTATOR) {
|
||||||
this.abilities.allowFlying = false;
|
this.abilities.allowFlying = false;
|
||||||
this.abilities.flying = false;
|
this.abilities.flying = false;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
@ -13,13 +13,9 @@ import party._2a03.mc.util.Config;
|
|||||||
|
|
||||||
@Mixin(TntEntity.class)
|
@Mixin(TntEntity.class)
|
||||||
public abstract class MixinTntEntity extends Entity {
|
public abstract class MixinTntEntity extends Entity {
|
||||||
@Shadow
|
|
||||||
private int fuseTimer;
|
|
||||||
|
|
||||||
public MixinTntEntity(EntityType<? extends TntEntity> entityType, World world) {
|
public MixinTntEntity(EntityType<? extends TntEntity> entityType, World world) {
|
||||||
super(entityType, world);
|
super(entityType, world);
|
||||||
this.fuseTimer = 80;
|
this.intersectionChecked = true;
|
||||||
this.inanimate = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "explode", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "explode", at = @At("HEAD"), cancellable = true)
|
||||||
|
@ -24,7 +24,7 @@ public class PlayerPosition {
|
|||||||
this.z = data.getDouble(2);
|
this.z = data.getDouble(2);
|
||||||
this.yaw = data.getNumber(3).floatValue();
|
this.yaw = data.getNumber(3).floatValue();
|
||||||
this.pitch = data.getNumber(4).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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,17 +2,17 @@
|
|||||||
"schemaVersion": 1,
|
"schemaVersion": 1,
|
||||||
"id": "minecraft-tweaks-2a03",
|
"id": "minecraft-tweaks-2a03",
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"name": "2a03.party Tweaks",
|
"name": "minecraft-tweaks-2a03",
|
||||||
"description": "Simple modifications for the 2a03.party Minecraft server.",
|
"description": "Simple modifications for mc.2a03.party.",
|
||||||
"authors": [
|
"authors": [
|
||||||
"flewkey"
|
"flewkey"
|
||||||
],
|
],
|
||||||
"contact": {
|
"contact": {
|
||||||
"homepage": "https://flewkey.com/",
|
"homepage": "https://flewkey.com/",
|
||||||
"sources": "https://github.com/flewkey/minecraft-tweaks-2a03"
|
"sources": "https://git.sdf.org/flewkey/minecraft-tweaks-2a03"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"icon": "assets/2a03-minecraft-tweaks/icon.png",
|
"icon": "assets/minecraft-tweaks-2a03/icon.png",
|
||||||
"environment": "*",
|
"environment": "*",
|
||||||
"entrypoints": {
|
"entrypoints": {
|
||||||
"main": [
|
"main": [
|
||||||
@ -23,8 +23,8 @@
|
|||||||
"minecraft-tweaks-2a03.mixins.json"
|
"minecraft-tweaks-2a03.mixins.json"
|
||||||
],
|
],
|
||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": ">=0.8.2",
|
"fabricloader": ">=0.12.12",
|
||||||
"fabric": "*",
|
"fabric": "*",
|
||||||
"minecraft": "1.16.x"
|
"minecraft": "1.18.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"required": true,
|
"required": true,
|
||||||
"package": "party._2a03.mc.mixin",
|
"package": "party._2a03.mc.mixin",
|
||||||
"compatibilityLevel": "JAVA_8",
|
"compatibilityLevel": "JAVA_17",
|
||||||
"server": [
|
"server": [
|
||||||
"MixinGameMode",
|
"MixinGameMode",
|
||||||
"MixinGameModeCommand",
|
"MixinGameModeCommand",
|
||||||
|
Loading…
Reference in New Issue
Block a user