Skip to content

Commit 711c608

Browse files
committed
Fix fishing rods
Signed-off-by: notstevy <[email protected]>
1 parent 6a293f2 commit 711c608

File tree

2 files changed

+65
-8
lines changed

2 files changed

+65
-8
lines changed

kitpvpslime-server/minecraft-patches/features/0001-Display-Player.patch

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ index e96d4dee14c05f2fa329bfb1588ec795d4e3d730..b1db40c917b2a69a83c487765a52db74
5151
consumer.accept(addEntityPacket);
5252
if (this.trackedDataValues != null) {
5353
diff --git a/net/minecraft/world/entity/EntityType.java b/net/minecraft/world/entity/EntityType.java
54-
index cdf71340278e05e58bbb4ed51a432336de46e549..1f8ad2b72f300b51ed6f0788372d4a41b05816dc 100644
54+
index cdf71340278e05e58bbb4ed51a432336de46e549..14882cafa7019263169cb36ade4ce3dbb6e5e2d9 100644
5555
--- a/net/minecraft/world/entity/EntityType.java
5656
+++ b/net/minecraft/world/entity/EntityType.java
57-
@@ -1065,6 +1065,18 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
58-
.clientTrackingRange(32)
59-
.updateInterval(2)
57+
@@ -1075,6 +1075,18 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
58+
.clientTrackingRange(4)
59+
.updateInterval(5)
6060
);
6161
+ // kitpvp start - DisplayPlayer
6262
+ public static final EntityType<world.kitpvp.slime.entity.DisplayPlayer> DISPLAY_PLAYER = register(
@@ -70,11 +70,11 @@ index cdf71340278e05e58bbb4ed51a432336de46e549..1f8ad2b72f300b51ed6f0788372d4a41
7070
+ .updateInterval(2)
7171
+ );
7272
+ // kitpvp end - DisplayPlayer
73-
public static final EntityType<FishingHook> FISHING_BOBBER = register(
74-
"fishing_bobber",
75-
EntityType.Builder.<FishingHook>of(FishingHook::new, MobCategory.MISC)
73+
private static final Set<EntityType<?>> OP_ONLY_CUSTOM_DATA = Set.of(FALLING_BLOCK, COMMAND_BLOCK_MINECART, SPAWNER_MINECART);
74+
private final EntityType.EntityFactory<T> factory;
75+
private final MobCategory category;
7676
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
77-
index 769950296fd54787160a621b1230349b5eed681b..a6dd035c2b99a596611b38f2628dbcd5c3201b15 100644
77+
index b9292f7a898af50a037d7e4acb700102bd791a40..e0d571f0af5b5441aa7454dfa20156c630f513ba 100644
7878
--- a/net/minecraft/world/entity/LivingEntity.java
7979
+++ b/net/minecraft/world/entity/LivingEntity.java
8080
@@ -2729,6 +2729,13 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin

test-plugin/src/main/java/world/kitpvp/testplugin/command/TestCommand.java

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,23 @@
99
import io.papermc.paper.command.brigadier.argument.resolvers.BlockPositionResolver;
1010
import io.papermc.paper.math.BlockPosition;
1111
import net.kyori.adventure.text.Component;
12+
import net.kyori.adventure.text.format.TextColor;
13+
import net.kyori.adventure.util.TriState;
1214
import net.minecraft.server.level.ServerLevel;
1315
import net.minecraft.world.level.ChunkPos;
1416
import org.bukkit.Chunk;
1517
import org.bukkit.Location;
18+
import org.bukkit.Material;
1619
import org.bukkit.block.Block;
20+
import org.bukkit.block.BlockFace;
21+
import org.bukkit.block.Sign;
22+
import org.bukkit.block.data.type.WallSign;
23+
import org.bukkit.block.sign.Side;
1724
import org.bukkit.craftbukkit.CraftWorld;
25+
import org.bukkit.entity.EntityType;
26+
import org.bukkit.entity.Mob;
27+
import org.bukkit.event.entity.CreatureSpawnEvent;
28+
import org.bukkit.inventory.ItemType;
1829
import org.slf4j.Logger;
1930
import org.slf4j.LoggerFactory;
2031
import world.kitpvp.testplugin.arena.ArenaResetHandler;
@@ -31,6 +42,52 @@ public class TestCommand {
3142
public static void register(Commands commands) {
3243
commands.register(
3344
Commands.literal("test")
45+
.then(Commands.literal("spawn_all_entities")
46+
.executes((ctx) -> {
47+
EntityType[] entityTypes = EntityType.values();
48+
int index = 0;
49+
for (EntityType entityType : entityTypes) {
50+
if (!entityType.isSpawnable())
51+
continue;
52+
53+
Location location = ctx.getSource().getLocation().add(2 * index, 0, 0);
54+
55+
ctx.getSource().getLocation().getWorld().spawnEntity(location, entityType, CreatureSpawnEvent.SpawnReason.COMMAND, (entity) -> {
56+
entity.setGravity(false);
57+
entity.setCustomNameVisible(true);
58+
entity.setPersistent(true);
59+
entity.customName(Component.text(entityType.name(), TextColor.color(0xffba00)));
60+
if (entity instanceof Mob mob) {
61+
mob.setDespawnInPeacefulOverride(TriState.FALSE);
62+
mob.setAI(false);
63+
64+
65+
mob.getEquipment().setHelmet(ItemType.CHAINMAIL_HELMET.createItemStack((meta) -> {
66+
meta.setUnbreakable(true);
67+
}));
68+
}
69+
70+
});
71+
location.clone().subtract(0, 1, 0).getBlock().setType(Material.STONE);
72+
73+
Block block = location.clone().subtract(0, 1, 1).getBlock();
74+
block.setType(Material.OAK_WALL_SIGN);
75+
76+
if (block.getState() instanceof Sign sign && block.getBlockData() instanceof WallSign wallSign) {
77+
wallSign.setFacing(BlockFace.SOUTH);
78+
sign.getSide(Side.FRONT).setGlowingText(true);
79+
sign.getSide(Side.FRONT).line(0, Component.text(entityType.name(), TextColor.color(0xffba00)));
80+
81+
block.setBlockData(wallSign);
82+
sign.update();
83+
}
84+
85+
index++;
86+
}
87+
88+
89+
return Command.SINGLE_SUCCESS;
90+
}))
3491
.then(Commands.literal("light_level")
3592
.executes((context) -> {
3693
var location = context.getSource().getLocation();

0 commit comments

Comments
 (0)