aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoranhgelus <anhgelus.morhtuuzh@proton.me>2024-10-27 12:51:55 +0000
committeranhgelus <anhgelus.morhtuuzh@proton.me>2024-10-27 12:51:55 +0000
commitce4dbfaa07d4c980fc9bd0aea6c4435a154b4113 (patch)
tree0968c5bebf2788775a1003d0395aa79a7f9bbcb6 /src
parentc984c9c43727659c80f24779c0fbd7b83cde12d0 (diff)
feat(minecraft): supports minecraft 1.21.2 and 1.21.3
#4
Diffstat (limited to 'src')
-rw-r--r--src/main/java/world/anhgelus/manhunt/Manhunt.java16
-rw-r--r--src/main/resources/fabric.mod.json6
2 files changed, 13 insertions, 9 deletions
diff --git a/src/main/java/world/anhgelus/manhunt/Manhunt.java b/src/main/java/world/anhgelus/manhunt/Manhunt.java
index cf09dc1..17aed6c 100644
--- a/src/main/java/world/anhgelus/manhunt/Manhunt.java
+++ b/src/main/java/world/anhgelus/manhunt/Manhunt.java
@@ -27,7 +27,9 @@ import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.GlobalPos;
+import net.minecraft.util.math.Vec3d;
import net.minecraft.world.GameMode;
+import net.minecraft.world.TeleportTarget;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -112,10 +114,10 @@ public class Manhunt implements ModInitializer {
player.setExperienceLevel(0);
player.getInventory().clear();
player.getHungerManager().eat(
- new FoodComponent(20, 20.0f, true, 0f, Optional.empty(), new ArrayList<>())
+ new FoodComponent(20, 20.0f, true)
);
final var spawn = player.getServerWorld().getSpawnPos();
- player.teleport(player.getServerWorld(), spawn.getX(), spawn.getY(), spawn.getZ(), 0f, 0f);
+ player.teleport(spawn.getX(), spawn.getY(), spawn.getZ(), false);
}
state = State.ON;
for (final UUID uuid : hunters) {
@@ -124,7 +126,7 @@ public class Manhunt implements ModInitializer {
final var isACompass = new ItemStack(Items.COMPASS);
hunter.giveItemStack(isACompass);
hunter.addStatusEffect(new StatusEffectInstance(StatusEffects.MINING_FATIGUE, Config.secondsBeforeRelease*20, 255, false, false));
- var attr = hunter.getAttributeInstance(EntityAttributes.GENERIC_MOVEMENT_SPEED);
+ var attr = hunter.getAttributeInstance(EntityAttributes.MOVEMENT_SPEED);
if (attr != null) {
final var modifier = new EntityAttributeModifier(
Identifier.of("manhunt.speed"),
@@ -133,7 +135,7 @@ public class Manhunt implements ModInitializer {
);
attr.addTemporaryModifier(modifier);
}
- attr = hunter.getAttributeInstance(EntityAttributes.GENERIC_GRAVITY);
+ attr = hunter.getAttributeInstance(EntityAttributes.GRAVITY);
if (attr != null) {
final var modifier = new EntityAttributeModifier(
Identifier.of("manhunt.gravity"),
@@ -151,17 +153,17 @@ public class Manhunt implements ModInitializer {
for (final UUID uuid : hunters) {
final var hunter = pm.getPlayer(uuid);
assert hunter != null;
- var attr = hunter.getAttributeInstance(EntityAttributes.GENERIC_MOVEMENT_SPEED);
+ var attr = hunter.getAttributeInstance(EntityAttributes.MOVEMENT_SPEED);
if (attr != null) {
attr.removeModifier(Identifier.of("manhunt.speed"));
}
- attr = hunter.getAttributeInstance(EntityAttributes.GENERIC_GRAVITY);
+ attr = hunter.getAttributeInstance(EntityAttributes.GRAVITY);
if (attr != null) {
attr.removeModifier(Identifier.of("manhunt.gravity"));
}
}
}
- }, Config.secondsBeforeRelease*1000);
+ }, Config.secondsBeforeRelease*1000L);
setTimer(pm);
context.getSource().sendFeedback(() -> Text.literal("Game started!"), true);
return Command.SINGLE_SUCCESS;
diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json
index d20a285..fe49b5f 100644
--- a/src/main/resources/fabric.mod.json
+++ b/src/main/resources/fabric.mod.json
@@ -8,7 +8,9 @@
"Anhgelus Morhtuuzh"
],
"contact": {
- "sources": "https://github.com/anhgelus/manhunt-mod"
+ "sources": "https://github.com/anhgelus/manhunt-mod",
+ "issues": "https://github.com/anhgelus/manhunt-mod/issues",
+ "homepage": "https://modrinth.com/mod/manhunt-remastered"
},
"license": "AGPL-3.0",
"icon": "assets/manhunt/icon.png",
@@ -22,7 +24,7 @@
"manhunt.mixins.json"
],
"depends": {
- "fabricloader": ">=0.15.11",
+ "fabricloader": ">=0.16.7",
"minecraft": "~1.21",
"java": ">=21",
"fabric": "*"