9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-19 15:09:15 +00:00

Merge pull request #497 from Xiao-MoMi/dev

1.21.11准备
This commit is contained in:
XiaoMoMi
2025-12-09 18:41:21 +08:00
committed by GitHub
17 changed files with 772 additions and 48 deletions

View File

@@ -16,6 +16,7 @@ import net.momirealms.craftengine.core.plugin.CraftEngine;
import net.momirealms.craftengine.core.util.Key; import net.momirealms.craftengine.core.util.Key;
import net.momirealms.craftengine.core.util.StringUtils; import net.momirealms.craftengine.core.util.StringUtils;
import net.momirealms.craftengine.core.util.UniqueKey; import net.momirealms.craftengine.core.util.UniqueKey;
import net.momirealms.craftengine.core.util.VersionHelper;
import net.momirealms.sparrow.nbt.Tag; import net.momirealms.sparrow.nbt.Tag;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@@ -33,27 +34,20 @@ public abstract class BukkitItemFactory<W extends ItemWrapper<ItemStack>> extend
public static BukkitItemFactory<? extends ItemWrapper<ItemStack>> create(CraftEngine plugin) { public static BukkitItemFactory<? extends ItemWrapper<ItemStack>> create(CraftEngine plugin) {
Objects.requireNonNull(plugin, "plugin"); Objects.requireNonNull(plugin, "plugin");
switch (plugin.serverVersion()) { if (VersionHelper.isOrAbove1_21_5()) {
case "1.20", "1.20.1", "1.20.2", "1.20.3", "1.20.4" -> { return new ComponentItemFactory1_21_5(plugin);
} else if (VersionHelper.isOrAbove1_21_4()) {
return new ComponentItemFactory1_21_4(plugin);
} else if (VersionHelper.isOrAbove1_21_2()) {
return new ComponentItemFactory1_21_2(plugin);
} else if (VersionHelper.isOrAbove1_21()) {
return new ComponentItemFactory1_21(plugin);
} else if (VersionHelper.isOrAbove1_20_5()) {
return new ComponentItemFactory1_20_5(plugin);
} else if (VersionHelper.isOrAbove1_20()) {
return new UniversalItemFactory(plugin); return new UniversalItemFactory(plugin);
} }
case "1.20.5", "1.20.6"-> { throw new IllegalStateException("Unsupported server version: " + VersionHelper.MINECRAFT_VERSION.version());
return new ComponentItemFactory1_20_5(plugin);
}
case "1.21", "1.21.1" -> {
return new ComponentItemFactory1_21(plugin);
}
case "1.21.2", "1.21.3" -> {
return new ComponentItemFactory1_21_2(plugin);
}
case "1.21.4" -> {
return new ComponentItemFactory1_21_4(plugin);
}
case "1.21.5", "1.21.6", "1.21.7", "1.21.8", "1.21.9", "1.21.10" -> {
return new ComponentItemFactory1_21_5(plugin);
}
default -> throw new IllegalStateException("Unsupported server version: " + plugin.serverVersion());
}
} }
public void resetRecipeIngredientSources(ExternalItemSource<ItemStack>[] recipeIngredientSources) { public void resetRecipeIngredientSources(ExternalItemSource<ItemStack>[] recipeIngredientSources) {

View File

@@ -66,8 +66,8 @@ public final class CoreReflections {
public static final Class<?> clazz$ResourceLocation = requireNonNull( public static final Class<?> clazz$ResourceLocation = requireNonNull(
BukkitReflectionUtils.findReobfOrMojmapClass( BukkitReflectionUtils.findReobfOrMojmapClass(
"resources.MinecraftKey", List.of("resources.MinecraftKey", "resources.Identifier"), // todo 确认 spigot 映射命名
"resources.ResourceLocation" List.of("resources.ResourceLocation", "resources.Identifier")
) )
); );
@@ -2956,8 +2956,8 @@ public final class CoreReflections {
public static final Class<?> clazz$AbstractArrow = requireNonNull( public static final Class<?> clazz$AbstractArrow = requireNonNull(
BukkitReflectionUtils.findReobfOrMojmapClass( BukkitReflectionUtils.findReobfOrMojmapClass(
"world.entity.projectile.EntityArrow", List.of("world.entity.projectile.EntityArrow", "world.entity.projectile.arrow.AbstractArrow"), // todo 确认 spigot 映射命名
"world.entity.projectile.AbstractArrow" List.of("world.entity.projectile.AbstractArrow", "world.entity.projectile.arrow.AbstractArrow")
) )
); );
@@ -2995,8 +2995,8 @@ public final class CoreReflections {
public static final Class<?> clazz$AbstractArrow$Pickup = requireNonNull( public static final Class<?> clazz$AbstractArrow$Pickup = requireNonNull(
BukkitReflectionUtils.findReobfOrMojmapClass( BukkitReflectionUtils.findReobfOrMojmapClass(
"world.entity.projectile.EntityArrow$PickupStatus", List.of("world.entity.projectile.EntityArrow$PickupStatus", "world.entity.projectile.arrow.AbstractArrow$a"), // todo 确认 spigot 映射命名
"world.entity.projectile.AbstractArrow$Pickup" List.of("world.entity.projectile.AbstractArrow$Pickup", "world.entity.projectile.arrow.AbstractArrow$Pickup")
) )
); );
@@ -4405,8 +4405,8 @@ public final class CoreReflections {
public static final Class<?> clazz$ImpossibleTrigger = requireNonNull( public static final Class<?> clazz$ImpossibleTrigger = requireNonNull(
BukkitReflectionUtils.findReobfOrMojmapClass( BukkitReflectionUtils.findReobfOrMojmapClass(
"advancements.critereon.CriterionTriggerImpossible", List.of("advancements.critereon.CriterionTriggerImpossible", "advancements.criterion.CriterionTriggerImpossible"), // todo 确认 spigot 映射命名
"advancements.critereon.ImpossibleTrigger" List.of("advancements.critereon.ImpossibleTrigger", "advancements.criterion.ImpossibleTrigger")
) )
); );
@@ -4416,8 +4416,8 @@ public final class CoreReflections {
public static final Class<?> clazz$ImpossibleTrigger$TriggerInstance = requireNonNull( public static final Class<?> clazz$ImpossibleTrigger$TriggerInstance = requireNonNull(
BukkitReflectionUtils.findReobfOrMojmapClass( BukkitReflectionUtils.findReobfOrMojmapClass(
"advancements.critereon.CriterionTriggerImpossible$a", List.of("advancements.critereon.CriterionTriggerImpossible$a", "advancements.criterion.CriterionTriggerImpossible$a"), // todo 确认 spigot 映射命名
"advancements.critereon.ImpossibleTrigger$TriggerInstance" List.of("advancements.critereon.ImpossibleTrigger$TriggerInstance", "advancements.criterion.ImpossibleTrigger$TriggerInstance")
) )
); );

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1033,7 +1033,10 @@
}, },
"block.anvil.destroy": { "block.anvil.destroy": {
"sounds": [ "sounds": [
"random/anvil_break" {
"name": "random/anvil_break",
"volume": 0.5
}
], ],
"subtitle": "subtitles.block.anvil.destroy" "subtitle": "subtitles.block.anvil.destroy"
}, },
@@ -1061,13 +1064,19 @@
}, },
"block.anvil.land": { "block.anvil.land": {
"sounds": [ "sounds": [
"random/anvil_land" {
"name": "random/anvil_land",
"volume": 0.5
}
], ],
"subtitle": "subtitles.block.anvil.land" "subtitle": "subtitles.block.anvil.land"
}, },
"block.anvil.place": { "block.anvil.place": {
"sounds": [ "sounds": [
"random/anvil_land" {
"name": "random/anvil_land",
"volume": 0.5
}
], ],
"subtitle": "subtitles.block.generic.place" "subtitle": "subtitles.block.generic.place"
}, },
@@ -1084,7 +1093,10 @@
}, },
"block.anvil.use": { "block.anvil.use": {
"sounds": [ "sounds": [
"random/anvil_use" {
"name": "random/anvil_use",
"volume": 0.5
}
], ],
"subtitle": "subtitles.block.anvil.use" "subtitle": "subtitles.block.anvil.use"
}, },
@@ -12876,6 +12888,77 @@
], ],
"subtitle": "subtitles.entity.axolotl.swim" "subtitle": "subtitles.entity.axolotl.swim"
}, },
"entity.baby_nautilus.ambient": {
"sounds": [
"mob/baby_nautilus/ambient1",
"mob/baby_nautilus/ambient2",
"mob/baby_nautilus/ambient3",
"mob/baby_nautilus/ambient4",
"mob/baby_nautilus/ambient5",
"mob/baby_nautilus/ambient6"
],
"subtitle": "subtitles.entity.baby_nautilus.ambient"
},
"entity.baby_nautilus.ambient_land": {
"sounds": [
"mob/baby_nautilus/ambient_land1",
"mob/baby_nautilus/ambient_land2",
"mob/baby_nautilus/ambient_land3",
"mob/baby_nautilus/ambient_land4"
],
"subtitle": "subtitles.entity.baby_nautilus.ambient_land"
},
"entity.baby_nautilus.death": {
"sounds": [
"mob/baby_nautilus/death"
],
"subtitle": "subtitles.entity.baby_nautilus.death"
},
"entity.baby_nautilus.death_land": {
"sounds": [
"mob/baby_nautilus/death_land"
],
"subtitle": "subtitles.entity.baby_nautilus.death_land"
},
"entity.baby_nautilus.eat": {
"sounds": [
"mob/baby_nautilus/eat1",
"mob/baby_nautilus/eat2"
],
"subtitle": "subtitles.entity.baby_nautilus.eat"
},
"entity.baby_nautilus.hurt": {
"sounds": [
"mob/baby_nautilus/hurt1",
"mob/baby_nautilus/hurt2",
"mob/baby_nautilus/hurt3",
"mob/baby_nautilus/hurt4"
],
"subtitle": "subtitles.entity.baby_nautilus.hurt"
},
"entity.baby_nautilus.hurt_land": {
"sounds": [
"mob/baby_nautilus/hurt_land1",
"mob/baby_nautilus/hurt_land2",
"mob/baby_nautilus/hurt_land3",
"mob/baby_nautilus/hurt_land4"
],
"subtitle": "subtitles.entity.baby_nautilus.hurt_land"
},
"entity.baby_nautilus.swim": {
"sounds": [
"mob/nautilus/swim1",
"mob/nautilus/swim2",
"mob/nautilus/swim3",
"mob/nautilus/swim4",
"mob/nautilus/swim5",
"mob/nautilus/swim6",
"mob/nautilus/swim7",
"mob/nautilus/swim8",
"mob/nautilus/swim9"
],
"subtitle": "subtitles.entity.baby_nautilus.swim"
},
"entity.bat.ambient": { "entity.bat.ambient": {
"sounds": [ "sounds": [
"mob/bat/idle1", "mob/bat/idle1",
@@ -13488,6 +13571,145 @@
], ],
"subtitle": "subtitles.block.generic.footsteps" "subtitle": "subtitles.block.generic.footsteps"
}, },
"entity.camel_husk.ambient": {
"sounds": [
"mob/camel_husk/ambient1",
"mob/camel_husk/ambient2",
"mob/camel_husk/ambient3",
"mob/camel_husk/ambient4",
"mob/camel_husk/ambient5",
"mob/camel_husk/ambient6",
"mob/camel_husk/ambient7",
"mob/camel_husk/ambient8"
],
"subtitle": "subtitles.entity.camel_husk.ambient"
},
"entity.camel_husk.dash": {
"sounds": [
"mob/camel_husk/dash1",
"mob/camel_husk/dash2",
"mob/camel_husk/dash3",
"mob/camel_husk/dash4",
"mob/camel_husk/dash5",
"mob/camel_husk/dash6"
],
"subtitle": "subtitles.entity.camel_husk.dash"
},
"entity.camel_husk.dash_ready": {
"sounds": [
"mob/camel_husk/dash_ready"
],
"subtitle": "subtitles.entity.camel_husk.dash_ready"
},
"entity.camel_husk.death": {
"sounds": [
"mob/camel_husk/death1",
"mob/camel_husk/death2"
],
"subtitle": "subtitles.entity.camel_husk.death"
},
"entity.camel_husk.eat": {
"sounds": [
"mob/camel_husk/eat1",
"mob/camel_husk/eat2",
"mob/camel_husk/eat3",
"mob/camel_husk/eat4",
"mob/camel_husk/eat5"
],
"subtitle": "subtitles.entity.camel_husk.eat"
},
"entity.camel_husk.hurt": {
"sounds": [
"mob/camel_husk/hurt1",
"mob/camel_husk/hurt2",
"mob/camel_husk/hurt3",
"mob/camel_husk/hurt4"
],
"subtitle": "subtitles.entity.camel_husk.hurt"
},
"entity.camel_husk.saddle": {
"sounds": [
"mob/horse/leather"
],
"subtitle": "subtitles.entity.camel_husk.saddle"
},
"entity.camel_husk.sit": {
"sounds": [
"mob/camel_husk/sit1",
"mob/camel_husk/sit2",
"mob/camel_husk/sit3",
"mob/camel_husk/sit4"
],
"subtitle": "subtitles.entity.camel_husk.sit"
},
"entity.camel_husk.stand": {
"sounds": [
"mob/camel_husk/stand1",
"mob/camel_husk/stand2",
"mob/camel_husk/stand3",
"mob/camel_husk/stand4",
"mob/camel_husk/stand5"
],
"subtitle": "subtitles.entity.camel_husk.stand"
},
"entity.camel_husk.step": {
"sounds": [
{
"name": "mob/camel_husk/step1",
"volume": 0.3
},
{
"name": "mob/camel_husk/step2",
"volume": 0.3
},
{
"name": "mob/camel_husk/step3",
"volume": 0.3
},
{
"name": "mob/camel_husk/step4",
"volume": 0.3
},
{
"name": "mob/camel_husk/step5",
"volume": 0.3
},
{
"name": "mob/camel_husk/step6",
"volume": 0.3
}
],
"subtitle": "subtitles.block.generic.footsteps"
},
"entity.camel_husk.step_sand": {
"sounds": [
{
"name": "mob/camel_husk/step_sand1",
"volume": 0.3
},
{
"name": "mob/camel_husk/step_sand2",
"volume": 0.3
},
{
"name": "mob/camel_husk/step_sand3",
"volume": 0.3
},
{
"name": "mob/camel_husk/step_sand4",
"volume": 0.3
},
{
"name": "mob/camel_husk/step_sand5",
"volume": 0.3
},
{
"name": "mob/camel_husk/step_sand6",
"volume": 0.3
}
],
"subtitle": "subtitles.block.generic.footsteps"
},
"entity.cat.ambient": { "entity.cat.ambient": {
"sounds": [ "sounds": [
{ {
@@ -16931,6 +17153,122 @@
], ],
"subtitle": "subtitles.entity.mule.jump" "subtitle": "subtitles.entity.mule.jump"
}, },
"entity.nautilus.ambient": {
"sounds": [
"mob/nautilus/ambient1",
"mob/nautilus/ambient2",
"mob/nautilus/ambient3",
"mob/nautilus/ambient4",
"mob/nautilus/ambient5",
"mob/nautilus/ambient6",
"mob/nautilus/ambient7",
"mob/nautilus/ambient8"
],
"subtitle": "subtitles.entity.nautilus.ambient"
},
"entity.nautilus.ambient_land": {
"sounds": [
"mob/nautilus/ambient_land1",
"mob/nautilus/ambient_land2",
"mob/nautilus/ambient_land3",
"mob/nautilus/ambient_land4",
"mob/nautilus/ambient_land5",
"mob/nautilus/ambient_land6",
"mob/nautilus/ambient_land7"
],
"subtitle": "subtitles.entity.nautilus.ambient_land"
},
"entity.nautilus.dash": {
"sounds": [
"mob/nautilus/dash1",
"mob/nautilus/dash2",
"mob/nautilus/dash3",
"mob/nautilus/dash4"
],
"subtitle": "subtitles.entity.nautilus.dash"
},
"entity.nautilus.dash_land": {
"sounds": [
"mob/nautilus/dash_land1",
"mob/nautilus/dash_land2",
"mob/nautilus/dash_land3",
"mob/nautilus/dash_land4"
],
"subtitle": "subtitles.entity.nautilus.dash_land"
},
"entity.nautilus.dash_ready": {
"sounds": [
"mob/nautilus/dash_ready1",
"mob/nautilus/dash_ready2",
"mob/nautilus/dash_ready3"
],
"subtitle": "subtitles.entity.nautilus.dash_ready"
},
"entity.nautilus.dash_ready_land": {
"sounds": [
"mob/nautilus/dash_ready_land1",
"mob/nautilus/dash_ready_land2",
"mob/nautilus/dash_ready_land3",
"mob/nautilus/dash_ready_land4"
],
"subtitle": "subtitles.entity.nautilus.dash_ready_land"
},
"entity.nautilus.death": {
"sounds": [
"mob/nautilus/death"
],
"subtitle": "subtitles.entity.nautilus.death"
},
"entity.nautilus.death_land": {
"sounds": [
"mob/nautilus/death_land"
],
"subtitle": "subtitles.entity.nautilus.death_land"
},
"entity.nautilus.eat": {
"sounds": [
"mob/nautilus/eat1",
"mob/nautilus/eat2"
],
"subtitle": "subtitles.entity.nautilus.eat"
},
"entity.nautilus.hurt": {
"sounds": [
"mob/nautilus/hurt1",
"mob/nautilus/hurt2",
"mob/nautilus/hurt3",
"mob/nautilus/hurt4"
],
"subtitle": "subtitles.entity.nautilus.hurt"
},
"entity.nautilus.hurt_land": {
"sounds": [
"mob/nautilus/hurt_land1",
"mob/nautilus/hurt_land2",
"mob/nautilus/hurt_land3",
"mob/nautilus/hurt_land4"
],
"subtitle": "subtitles.entity.nautilus.hurt_land"
},
"entity.nautilus.riding": {
"sounds": [
"mob/nautilus/ride"
]
},
"entity.nautilus.swim": {
"sounds": [
"mob/nautilus/swim1",
"mob/nautilus/swim2",
"mob/nautilus/swim3",
"mob/nautilus/swim4",
"mob/nautilus/swim5",
"mob/nautilus/swim6",
"mob/nautilus/swim7",
"mob/nautilus/swim8",
"mob/nautilus/swim9"
],
"subtitle": "subtitles.entity.nautilus.swim"
},
"entity.ocelot.ambient": { "entity.ocelot.ambient": {
"sounds": [ "sounds": [
{ {
@@ -17156,6 +17494,39 @@
], ],
"subtitle": "subtitles.entity.panda.worried_ambient" "subtitle": "subtitles.entity.panda.worried_ambient"
}, },
"entity.parched.ambient": {
"sounds": [
"mob/parched/ambient1",
"mob/parched/ambient2",
"mob/parched/ambient3",
"mob/parched/ambient4"
],
"subtitle": "subtitles.entity.parched.ambient"
},
"entity.parched.death": {
"sounds": [
"mob/parched/death"
],
"subtitle": "subtitles.entity.parched.death"
},
"entity.parched.hurt": {
"sounds": [
"mob/parched/hurt1",
"mob/parched/hurt2",
"mob/parched/hurt3",
"mob/parched/hurt4"
],
"subtitle": "subtitles.entity.parched.hurt"
},
"entity.parched.step": {
"sounds": [
"mob/parched/step1",
"mob/parched/step2",
"mob/parched/step3",
"mob/parched/step4"
],
"subtitle": "subtitles.block.generic.footsteps"
},
"entity.parrot.ambient": { "entity.parrot.ambient": {
"sounds": [ "sounds": [
{ {
@@ -17276,6 +17647,17 @@
], ],
"subtitle": "subtitles.entity.parrot.imitate.breeze" "subtitle": "subtitles.entity.parrot.imitate.breeze"
}, },
"entity.parrot.imitate.camel_husk": {
"sounds": [
{
"name": "entity.camel_husk.ambient",
"pitch": 2.0,
"type": "event",
"volume": 0.7
}
],
"subtitle": "subtitles.entity.parrot.imitate.camel_husk"
},
"entity.parrot.imitate.creaking": { "entity.parrot.imitate.creaking": {
"sounds": [ "sounds": [
"mob/creaking/parrot_imitate_creaking" "mob/creaking/parrot_imitate_creaking"
@@ -17414,6 +17796,17 @@
], ],
"subtitle": "subtitles.entity.parrot.imitate.magma_cube" "subtitle": "subtitles.entity.parrot.imitate.magma_cube"
}, },
"entity.parrot.imitate.parched": {
"sounds": [
{
"name": "entity.parched.ambient",
"pitch": 1.8,
"type": "event",
"volume": 0.7
}
],
"subtitle": "subtitles.entity.parrot.imitate.parched"
},
"entity.parrot.imitate.phantom": { "entity.parrot.imitate.phantom": {
"sounds": [ "sounds": [
{ {
@@ -17622,6 +18015,28 @@
], ],
"subtitle": "subtitles.entity.parrot.imitate.zombie" "subtitle": "subtitles.entity.parrot.imitate.zombie"
}, },
"entity.parrot.imitate.zombie_horse": {
"sounds": [
{
"name": "entity.zombie_horse.ambient",
"pitch": 1.8,
"type": "event",
"volume": 0.7
}
],
"subtitle": "subtitles.entity.parrot.imitate.zombie_horse"
},
"entity.parrot.imitate.zombie_nautilus": {
"sounds": [
{
"name": "entity.zombie_nautilus.ambient",
"pitch": 1.8,
"type": "event",
"volume": 0.7
}
],
"subtitle": "subtitles.entity.parrot.imitate.zombie_nautilus"
},
"entity.parrot.imitate.zombie_villager": { "entity.parrot.imitate.zombie_villager": {
"sounds": [ "sounds": [
{ {
@@ -21151,12 +21566,27 @@
], ],
"subtitle": "subtitles.entity.zombie_horse.ambient" "subtitle": "subtitles.entity.zombie_horse.ambient"
}, },
"entity.zombie_horse.angry": {
"sounds": [
"mob/horse/zombie/angry"
],
"subtitle": "subtitles.entity.zombie_horse.angry"
},
"entity.zombie_horse.death": { "entity.zombie_horse.death": {
"sounds": [ "sounds": [
"mob/horse/zombie/death" "mob/horse/zombie/death"
], ],
"subtitle": "subtitles.entity.zombie_horse.death" "subtitle": "subtitles.entity.zombie_horse.death"
}, },
"entity.zombie_horse.eat": {
"sounds": [
{
"name": "entity.horse.eat",
"type": "event"
}
],
"subtitle": "subtitles.entity.zombie_horse.eat"
},
"entity.zombie_horse.hurt": { "entity.zombie_horse.hurt": {
"sounds": [ "sounds": [
"mob/horse/zombie/hit1", "mob/horse/zombie/hit1",
@@ -21166,6 +21596,113 @@
], ],
"subtitle": "subtitles.entity.zombie_horse.hurt" "subtitle": "subtitles.entity.zombie_horse.hurt"
}, },
"entity.zombie_nautilus.ambient": {
"sounds": [
"mob/zombie_nautilus/ambient1",
"mob/zombie_nautilus/ambient2",
"mob/zombie_nautilus/ambient3",
"mob/zombie_nautilus/ambient4",
"mob/zombie_nautilus/ambient5"
],
"subtitle": "subtitles.entity.zombie_nautilus.ambient"
},
"entity.zombie_nautilus.ambient_land": {
"sounds": [
"mob/zombie_nautilus/ambient_land1",
"mob/zombie_nautilus/ambient_land2",
"mob/zombie_nautilus/ambient_land3",
"mob/zombie_nautilus/ambient_land4",
"mob/zombie_nautilus/ambient_land5",
"mob/zombie_nautilus/ambient_land6"
],
"subtitle": "subtitles.entity.zombie_nautilus.ambient_land"
},
"entity.zombie_nautilus.dash": {
"sounds": [
{
"name": "entity.nautilus.dash",
"type": "event"
}
],
"subtitle": "subtitles.entity.zombie_nautilus.dash"
},
"entity.zombie_nautilus.dash_land": {
"sounds": [
"mob/zombie_nautilus/dash_land1",
"mob/zombie_nautilus/dash_land2",
"mob/zombie_nautilus/dash_land3",
"mob/zombie_nautilus/dash_land4"
],
"subtitle": "subtitles.entity.zombie_nautilus.dash_land"
},
"entity.zombie_nautilus.dash_ready": {
"sounds": [
"mob/zombie_nautilus/dash_ready1",
"mob/zombie_nautilus/dash_ready2",
"mob/zombie_nautilus/dash_ready3"
],
"subtitle": "subtitles.entity.zombie_nautilus.dash_ready"
},
"entity.zombie_nautilus.dash_ready_land": {
"sounds": [
"mob/zombie_nautilus/dash_ready_land1",
"mob/zombie_nautilus/dash_ready_land2",
"mob/zombie_nautilus/dash_ready_land3",
"mob/zombie_nautilus/dash_ready_land4"
],
"subtitle": "subtitles.entity.zombie_nautilus.dash_ready_land"
},
"entity.zombie_nautilus.death": {
"sounds": [
"mob/zombie_nautilus/death"
],
"subtitle": "subtitles.entity.zombie_nautilus.death"
},
"entity.zombie_nautilus.death_land": {
"sounds": [
"mob/zombie_nautilus/death_land"
],
"subtitle": "subtitles.entity.zombie_nautilus.death_land"
},
"entity.zombie_nautilus.eat": {
"sounds": [
"mob/zombie_nautilus/eat1",
"mob/zombie_nautilus/eat2"
],
"subtitle": "subtitles.entity.zombie_nautilus.eat"
},
"entity.zombie_nautilus.hurt": {
"sounds": [
"mob/zombie_nautilus/hurt1",
"mob/zombie_nautilus/hurt2",
"mob/zombie_nautilus/hurt3",
"mob/zombie_nautilus/hurt4"
],
"subtitle": "subtitles.entity.zombie_nautilus.hurt"
},
"entity.zombie_nautilus.hurt_land": {
"sounds": [
"mob/zombie_nautilus/hurt_land1",
"mob/zombie_nautilus/hurt_land2",
"mob/zombie_nautilus/hurt_land3",
"mob/zombie_nautilus/hurt_land4"
],
"subtitle": "subtitles.entity.zombie_nautilus.hurt_land"
},
"entity.zombie_nautilus.swim": {
"sounds": [
"mob/nautilus/swim1",
"mob/nautilus/swim2",
"mob/nautilus/swim3",
"mob/nautilus/swim4",
"mob/nautilus/swim5",
"mob/nautilus/swim6",
"mob/nautilus/swim7",
"mob/nautilus/swim8",
"mob/nautilus/swim9"
],
"subtitle": "subtitles.entity.zombie_nautilus.swim"
},
"entity.zombie_villager.ambient": { "entity.zombie_villager.ambient": {
"sounds": [ "sounds": [
"mob/zombie_villager/say1", "mob/zombie_villager/say1",
@@ -21367,6 +21904,13 @@
], ],
"subtitle": "subtitles.item.armor.equip_leather" "subtitle": "subtitles.item.armor.equip_leather"
}, },
"item.armor.equip_nautilus": {
"sounds": [
"item/armor/equip_wolf1",
"item/armor/equip_wolf2"
],
"subtitle": "subtitles.item.armor.equip_nautilus"
},
"item.armor.equip_netherite": { "item.armor.equip_netherite": {
"sounds": [ "sounds": [
{ {
@@ -21437,6 +21981,13 @@
], ],
"subtitle": "subtitles.item.armor.equip_wolf" "subtitle": "subtitles.item.armor.equip_wolf"
}, },
"item.armor.unequip_nautilus": {
"sounds": [
"item/armor/unequip_wolf1",
"item/armor/unequip_wolf2"
],
"subtitle": "subtitles.item.armor.unequip_nautilus"
},
"item.armor.unequip_wolf": { "item.armor.unequip_wolf": {
"sounds": [ "sounds": [
"item/armor/unequip_wolf1", "item/armor/unequip_wolf1",
@@ -22574,6 +23125,18 @@
], ],
"subtitle": "subtitles.item.mace.smash_ground" "subtitle": "subtitles.item.mace.smash_ground"
}, },
"item.nautilus_saddle_equip": {
"sounds": [
"mob/nautilus/nautilus_saddle_equip"
],
"subtitle": "subtitles.item.nautilus_saddle_equip"
},
"item.nautilus_saddle_underwater_equip": {
"sounds": [
"mob/nautilus/nautilus_saddle_underwater_equip"
],
"subtitle": "subtitles.item.nautilus_saddle_underwater_equip"
},
"item.nether_wart.plant": { "item.nether_wart.plant": {
"sounds": [ "sounds": [
{ {
@@ -22676,6 +23239,68 @@
], ],
"subtitle": "subtitles.item.shovel.flatten" "subtitle": "subtitles.item.shovel.flatten"
}, },
"item.spear.attack": {
"sounds": [
"item/spear/attack1",
"item/spear/attack2",
"item/spear/attack3"
],
"subtitle": "subtitles.item.spear.attack"
},
"item.spear.hit": {
"sounds": [
"item/spear/hit1",
"item/spear/hit2",
"item/spear/hit3"
],
"subtitle": "subtitles.item.spear.hit"
},
"item.spear.lunge_1": {
"sounds": [
"item/spear/lunge1"
],
"subtitle": "subtitles.item.spear.lunge"
},
"item.spear.lunge_2": {
"sounds": [
"item/spear/lunge2"
],
"subtitle": "subtitles.item.spear.lunge"
},
"item.spear.lunge_3": {
"sounds": [
"item/spear/lunge3"
],
"subtitle": "subtitles.item.spear.lunge"
},
"item.spear.use": {
"sounds": [
"item/spear/use"
],
"subtitle": "subtitles.item.spear.use"
},
"item.spear_wood.attack": {
"sounds": [
"item/spear/wood/attack1",
"item/spear/wood/attack2",
"item/spear/wood/attack3"
],
"subtitle": "subtitles.item.spear_wood.attack"
},
"item.spear_wood.hit": {
"sounds": [
"item/spear/wood/hit1",
"item/spear/wood/hit2",
"item/spear/wood/hit3"
],
"subtitle": "subtitles.item.spear_wood.hit"
},
"item.spear_wood.use": {
"sounds": [
"item/spear/wood/use"
],
"subtitle": "subtitles.item.spear_wood.use"
},
"item.spyglass.stop_using": { "item.spyglass.stop_using": {
"sounds": [ "sounds": [
{ {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -787,7 +787,8 @@ public abstract class AbstractItemManager<I> extends AbstractModelGenerator impl
map.put(customModelData, new ModernItemModel( map.put(customModelData, new ModernItemModel(
modernModel, modernModel,
ResourceConfigUtils.getAsBoolean(section.getOrDefault("oversized-in-gui", true), "oversized-in-gui"), ResourceConfigUtils.getAsBoolean(section.getOrDefault("oversized-in-gui", true), "oversized-in-gui"),
ResourceConfigUtils.getAsBoolean(section.getOrDefault("hand-animation-on-swap", true), "hand-animation-on-swap") ResourceConfigUtils.getAsBoolean(section.getOrDefault("hand-animation-on-swap", true), "hand-animation-on-swap"),
ResourceConfigUtils.getAsFloat(section.getOrDefault("swap-animation-scale", 1f), "swap-animation-scale")
)); ));
} }
// 添加旧版 overrides // 添加旧版 overrides
@@ -805,7 +806,8 @@ public abstract class AbstractItemManager<I> extends AbstractModelGenerator impl
AbstractItemManager.this.modernItemModels1_21_4.put(itemModel, new ModernItemModel( AbstractItemManager.this.modernItemModels1_21_4.put(itemModel, new ModernItemModel(
modernModel, modernModel,
ResourceConfigUtils.getAsBoolean(section.getOrDefault("oversized-in-gui", true), "oversized-in-gui"), ResourceConfigUtils.getAsBoolean(section.getOrDefault("oversized-in-gui", true), "oversized-in-gui"),
ResourceConfigUtils.getAsBoolean(section.getOrDefault("hand-animation-on-swap", true), "hand-animation-on-swap") ResourceConfigUtils.getAsBoolean(section.getOrDefault("hand-animation-on-swap", true), "hand-animation-on-swap"),
ResourceConfigUtils.getAsFloat(section.getOrDefault("swap-animation-scale", 1f), "swap-animation-scale")
)); ));
} }
if (needsItemModelCompatibility() && needsLegacyCompatibility() && hasLegacyModel) { if (needsItemModelCompatibility() && needsLegacyCompatibility() && hasLegacyModel) {
@@ -819,7 +821,8 @@ public abstract class AbstractItemManager<I> extends AbstractModelGenerator impl
AbstractItemManager.this.modernItemModels1_21_4.put(id, new ModernItemModel( AbstractItemManager.this.modernItemModels1_21_4.put(id, new ModernItemModel(
modernModel, modernModel,
ResourceConfigUtils.getAsBoolean(section.getOrDefault("oversized-in-gui", true), "oversized-in-gui"), ResourceConfigUtils.getAsBoolean(section.getOrDefault("oversized-in-gui", true), "oversized-in-gui"),
ResourceConfigUtils.getAsBoolean(section.getOrDefault("hand-animation-on-swap", true), "hand-animation-on-swap") ResourceConfigUtils.getAsBoolean(section.getOrDefault("hand-animation-on-swap", true), "hand-animation-on-swap"),
ResourceConfigUtils.getAsFloat(section.getOrDefault("swap-animation-scale", 1f), "swap-animation-scale")
)); ));
} }
} }

View File

@@ -25,6 +25,7 @@ public final class DataComponentKeys {
public static final Key CUSTOM_MODEL_DATA = Key.of("minecraft", "custom_model_data"); public static final Key CUSTOM_MODEL_DATA = Key.of("minecraft", "custom_model_data");
public static final Key CUSTOM_NAME = Key.of("minecraft", "custom_name"); public static final Key CUSTOM_NAME = Key.of("minecraft", "custom_name");
public static final Key DAMAGE = Key.of("minecraft", "damage"); public static final Key DAMAGE = Key.of("minecraft", "damage");
public static final Key DAMAGE_TYPE = Key.of("minecraft", "damage_type");
public static final Key DAMAGE_RESISTANT = Key.of("minecraft", "damage_resistant"); public static final Key DAMAGE_RESISTANT = Key.of("minecraft", "damage_resistant");
public static final Key DEBUG_STICK_STATE = Key.of("minecraft", "debug_stick_state"); public static final Key DEBUG_STICK_STATE = Key.of("minecraft", "debug_stick_state");
public static final Key DEATH_PROTECTION = Key.of("minecraft", "death_protection"); public static final Key DEATH_PROTECTION = Key.of("minecraft", "death_protection");
@@ -43,6 +44,7 @@ public final class DataComponentKeys {
public static final Key ITEM_MODEL = Key.of("minecraft", "item_model"); public static final Key ITEM_MODEL = Key.of("minecraft", "item_model");
public static final Key ITEM_NAME = Key.of("minecraft", "item_name"); public static final Key ITEM_NAME = Key.of("minecraft", "item_name");
public static final Key JUKEBOX_PLAYABLE = Key.of("minecraft", "jukebox_playable"); public static final Key JUKEBOX_PLAYABLE = Key.of("minecraft", "jukebox_playable");
public static final Key KINETIC_WEAPON = Key.of("minecraft", "kinetic_weapon");
public static final Key LOCK = Key.of("minecraft", "lock"); public static final Key LOCK = Key.of("minecraft", "lock");
public static final Key LODESTONE_TRACKER = Key.of("minecraft", "lodestone_tracker"); public static final Key LODESTONE_TRACKER = Key.of("minecraft", "lodestone_tracker");
public static final Key LORE = Key.of("minecraft", "lore"); public static final Key LORE = Key.of("minecraft", "lore");
@@ -51,8 +53,10 @@ public final class DataComponentKeys {
public static final Key MAP_ID = Key.of("minecraft", "map_id"); public static final Key MAP_ID = Key.of("minecraft", "map_id");
public static final Key MAX_DAMAGE = Key.of("minecraft", "max_damage"); public static final Key MAX_DAMAGE = Key.of("minecraft", "max_damage");
public static final Key MAX_STACK_SIZE = Key.of("minecraft", "max_stack_size"); public static final Key MAX_STACK_SIZE = Key.of("minecraft", "max_stack_size");
public static final Key MINIUM_ATTACK_CHARGE = Key.of("minecraft", "minimum_attack_charge");
public static final Key NOTE_BLOCK_SOUND = Key.of("minecraft", "note_block_sound"); public static final Key NOTE_BLOCK_SOUND = Key.of("minecraft", "note_block_sound");
public static final Key OMINOUS_BOTTLE_AMPLIFIER = Key.of("minecraft", "ominous_bottle_amplifier"); public static final Key OMINOUS_BOTTLE_AMPLIFIER = Key.of("minecraft", "ominous_bottle_amplifier");
public static final Key PIERCING_WEAPON = Key.of("minecraft", "piercing_weapon");
public static final Key POT_DECORATIONS = Key.of("minecraft", "pot_decorations"); public static final Key POT_DECORATIONS = Key.of("minecraft", "pot_decorations");
public static final Key POTION_CONTENTS = Key.of("minecraft", "potion_contents"); public static final Key POTION_CONTENTS = Key.of("minecraft", "potion_contents");
public static final Key POTION_DURATION_SCALE = Key.of("minecraft", "potion_duration_scale"); public static final Key POTION_DURATION_SCALE = Key.of("minecraft", "potion_duration_scale");
@@ -65,12 +69,14 @@ public final class DataComponentKeys {
public static final Key REPAIR_COST = Key.of("minecraft", "repair_cost"); public static final Key REPAIR_COST = Key.of("minecraft", "repair_cost");
public static final Key STORED_ENCHANTMENTS = Key.of("minecraft", "stored_enchantments"); public static final Key STORED_ENCHANTMENTS = Key.of("minecraft", "stored_enchantments");
public static final Key SUSPICIOUS_STEW_EFFECTS = Key.of("minecraft", "suspicious_stew_effects"); public static final Key SUSPICIOUS_STEW_EFFECTS = Key.of("minecraft", "suspicious_stew_effects");
public static final Key SWING_ANIMATION = Key.of("minecraft", "swing_animation");
public static final Key TOOL = Key.of("minecraft", "tool"); public static final Key TOOL = Key.of("minecraft", "tool");
public static final Key TOOLTIP_DISPLAY = Key.of("minecraft", "tooltip_display"); public static final Key TOOLTIP_DISPLAY = Key.of("minecraft", "tooltip_display");
public static final Key TOOLTIP_STYLE = Key.of("minecraft", "tooltip_style"); public static final Key TOOLTIP_STYLE = Key.of("minecraft", "tooltip_style");
public static final Key TRIM = Key.of("minecraft", "trim"); public static final Key TRIM = Key.of("minecraft", "trim");
public static final Key UNBREAKABLE = Key.of("minecraft", "unbreakable"); public static final Key UNBREAKABLE = Key.of("minecraft", "unbreakable");
public static final Key USE_COOLDOWN = Key.of("minecraft", "use_cooldown"); public static final Key USE_COOLDOWN = Key.of("minecraft", "use_cooldown");
public static final Key USE_EFFECTS = Key.of("minecraft", "use_effects");
public static final Key USE_REMAINDER = Key.of("minecraft", "use_remainder"); public static final Key USE_REMAINDER = Key.of("minecraft", "use_remainder");
public static final Key WEAPON = Key.of("minecraft", "weapon"); public static final Key WEAPON = Key.of("minecraft", "weapon");
public static final Key WRITABLE_BOOK_CONTENT = Key.of("minecraft", "writable_book_content"); public static final Key WRITABLE_BOOK_CONTENT = Key.of("minecraft", "writable_book_content");

View File

@@ -13,9 +13,11 @@ public enum EquipmentLayerType {
PIG_SADDLE("pig_saddle"), PIG_SADDLE("pig_saddle"),
STRIDER_SADDLE("strider_saddle"), STRIDER_SADDLE("strider_saddle"),
CAMEL_SADDLE("camel_saddle"), CAMEL_SADDLE("camel_saddle"),
CAMEL_HUSK_SADDLE("camel_husk_saddle"),
HORSE_SADDLE("horse_saddle"), HORSE_SADDLE("horse_saddle"),
DONKEY_SADDLE("donkey_saddle"), DONKEY_SADDLE("donkey_saddle"),
MULE_SADDLE("mule_saddle"), MULE_SADDLE("mule_saddle"),
NAUTILUS_BODY("nautilus_body"),
SKELETON_HORSE_SADDLE("skeleton_horse_saddle"), SKELETON_HORSE_SADDLE("skeleton_horse_saddle"),
ZOMBIE_HORSE_SADDLE("zombie_horse_saddle"), ZOMBIE_HORSE_SADDLE("zombie_horse_saddle"),
HAPPY_GHAST_BODY("happy_ghast_body"); HAPPY_GHAST_BODY("happy_ghast_body");

View File

@@ -2545,6 +2545,7 @@ public abstract class AbstractPackManager implements PackManager {
boolean handAnimationOnSwap = originalItemModel.handAnimationOnSwap(); boolean handAnimationOnSwap = originalItemModel.handAnimationOnSwap();
boolean oversizedInGui = originalItemModel.oversizedInGui(); boolean oversizedInGui = originalItemModel.oversizedInGui();
float swapAnimationScale = originalItemModel.swapAnimationScale();
Map<Float, ItemModel> entries = new TreeMap<>(); Map<Float, ItemModel> entries = new TreeMap<>();
for (Map.Entry<Integer, ModernItemModel> modelWithDataEntry : entry.getValue().entrySet()) { for (Map.Entry<Integer, ModernItemModel> modelWithDataEntry : entry.getValue().entrySet()) {
@@ -2565,7 +2566,7 @@ public abstract class AbstractPackManager implements PackManager {
entries entries
); );
ModernItemModel newItemModel = new ModernItemModel(rangeDispatch, handAnimationOnSwap, oversizedInGui); ModernItemModel newItemModel = new ModernItemModel(rangeDispatch, handAnimationOnSwap, oversizedInGui, swapAnimationScale);
try { try {
Files.createDirectories(overridedItemPath.getParent()); Files.createDirectories(overridedItemPath.getParent());
} catch (IOException e) { } catch (IOException e) {

View File

@@ -2,7 +2,9 @@ package net.momirealms.craftengine.core.pack.model;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import net.momirealms.craftengine.core.pack.revision.Revision; import net.momirealms.craftengine.core.pack.revision.Revision;
import net.momirealms.craftengine.core.util.GsonHelper;
import net.momirealms.craftengine.core.util.MinecraftVersion; import net.momirealms.craftengine.core.util.MinecraftVersion;
import net.momirealms.craftengine.core.util.MinecraftVersions;
import java.util.List; import java.util.List;
@@ -10,30 +12,36 @@ public class ModernItemModel {
private final ItemModel itemModel; private final ItemModel itemModel;
private final boolean oversizedInGui; private final boolean oversizedInGui;
private final boolean handAnimationOnSwap; private final boolean handAnimationOnSwap;
private final float swapAnimationScale;
public ModernItemModel(ItemModel itemModel, boolean handAnimationOnSwap, boolean oversizedInGui) { public ModernItemModel(ItemModel itemModel, boolean handAnimationOnSwap, boolean oversizedInGui, float swapAnimationScale) {
this.handAnimationOnSwap = handAnimationOnSwap; this.handAnimationOnSwap = handAnimationOnSwap;
this.itemModel = itemModel; this.itemModel = itemModel;
this.oversizedInGui = oversizedInGui; this.oversizedInGui = oversizedInGui;
this.swapAnimationScale = swapAnimationScale;
} }
public static ModernItemModel fromJson(JsonObject json) { public static ModernItemModel fromJson(JsonObject json) {
ItemModel model = ItemModels.fromJson(json.getAsJsonObject("model")); ItemModel model = ItemModels.fromJson(json.getAsJsonObject("model"));
return new ModernItemModel( return new ModernItemModel(
model, model,
!json.has("hand_animation_on_swap") || json.get("hand_animation_on_swap").getAsBoolean(), GsonHelper.getAsBoolean(json.get("hand_animation_on_swap"), true),
json.has("oversized_in_gui") && json.get("oversized_in_gui").getAsBoolean() GsonHelper.getAsBoolean(json.get("oversized_in_gui"), false),
GsonHelper.getAsFloat(json.get("swap_animation_scale"), 1.0f)
); );
} }
public JsonObject toJson(MinecraftVersion version) { public JsonObject toJson(MinecraftVersion version) {
JsonObject json = new JsonObject(); JsonObject json = new JsonObject();
if (this.oversizedInGui) { if (this.oversizedInGui && version.isAtOrAbove(MinecraftVersions.V1_21_6)) {
json.addProperty("oversized_in_gui", true); json.addProperty("oversized_in_gui", true);
} }
if (!this.handAnimationOnSwap) { if (!this.handAnimationOnSwap) {
json.addProperty("hand_animation_on_swap", false); json.addProperty("hand_animation_on_swap", false);
} }
if (this.swapAnimationScale != 1.0f && version.isAtOrAbove(MinecraftVersions.V1_21_11)) {
json.addProperty("swap_animation_scale", this.swapAnimationScale);
}
json.add("model", this.itemModel.apply(version)); json.add("model", this.itemModel.apply(version));
return json; return json;
} }
@@ -53,4 +61,8 @@ public class ModernItemModel {
public boolean oversizedInGui() { public boolean oversizedInGui() {
return oversizedInGui; return oversizedInGui;
} }
public float swapAnimationScale() {
return swapAnimationScale;
}
} }

View File

@@ -19,7 +19,8 @@ public enum ProtocolVersion {
V1_21_7(772, "1.21.7"), V1_21_7(772, "1.21.7"),
V1_21_8(772, "1.21.8"), V1_21_8(772, "1.21.8"),
V1_21_9(773, "1.21.9"), V1_21_9(773, "1.21.9"),
V1_21_10(773, "1.21.10"); V1_21_10(773, "1.21.10"),
V1_21_11(774, "1.21.11");
private final int id; private final int id;
private final String name; private final String name;

View File

@@ -122,4 +122,76 @@ public final class GsonHelper {
return ja; return ja;
} }
} }
public static float getAsFloat(JsonElement json, float defaultValue) {
if (json == null || json.isJsonNull()) return defaultValue;
try {
return json.getAsFloat();
} catch (Exception e) {
return defaultValue;
}
}
public static double getAsDouble(JsonElement json, double defaultValue) {
if (json == null || json.isJsonNull()) return defaultValue;
try {
return json.getAsDouble();
} catch (Exception e) {
return defaultValue;
}
}
public static int getAsInt(JsonElement json, int defaultValue) {
if (json == null || json.isJsonNull()) return defaultValue;
try {
return json.getAsInt();
} catch (Exception e) {
return defaultValue;
}
}
public static long getAsLong(JsonElement json, long defaultValue) {
if (json == null || json.isJsonNull()) return defaultValue;
try {
return json.getAsLong();
} catch (Exception e) {
return defaultValue;
}
}
public static short getAsShort(JsonElement json, short defaultValue) {
if (json == null || json.isJsonNull()) return defaultValue;
try {
return json.getAsShort();
} catch (Exception e) {
return defaultValue;
}
}
public static byte getAsByte(JsonElement json, byte defaultValue) {
if (json == null || json.isJsonNull()) return defaultValue;
try {
return json.getAsByte();
} catch (Exception e) {
return defaultValue;
}
}
public static boolean getAsBoolean(JsonElement json, boolean defaultValue) {
if (json == null || json.isJsonNull()) return defaultValue;
try {
return json.getAsBoolean();
} catch (Exception e) {
return defaultValue;
}
}
public static String getAsString(JsonElement json, String defaultValue) {
if (json == null || json.isJsonNull()) return defaultValue;
try {
return json.getAsString();
} catch (Exception e) {
return defaultValue;
}
}
} }

View File

@@ -24,6 +24,7 @@ public final class MinecraftVersion implements Comparable<MinecraftVersion> {
PACK_FORMATS.put(1_21_08, 64); PACK_FORMATS.put(1_21_08, 64);
PACK_FORMATS.put(1_21_09, 69); PACK_FORMATS.put(1_21_09, 69);
PACK_FORMATS.put(1_21_10, 69); PACK_FORMATS.put(1_21_10, 69);
PACK_FORMATS.put(1_21_11, 75);
PACK_FORMATS.put(1_99_99, 1000); PACK_FORMATS.put(1_99_99, 1000);
} }

View File

@@ -21,5 +21,6 @@ public final class MinecraftVersions {
public static final MinecraftVersion V1_21_8 = new MinecraftVersion("1.21.8"); public static final MinecraftVersion V1_21_8 = new MinecraftVersion("1.21.8");
public static final MinecraftVersion V1_21_9 = new MinecraftVersion("1.21.9"); public static final MinecraftVersion V1_21_9 = new MinecraftVersion("1.21.9");
public static final MinecraftVersion V1_21_10 = new MinecraftVersion("1.21.10"); public static final MinecraftVersion V1_21_10 = new MinecraftVersion("1.21.10");
public static final MinecraftVersion V1_21_11 = new MinecraftVersion("1.21.11");
public static final MinecraftVersion FUTURE = new MinecraftVersion("1.99.99"); public static final MinecraftVersion FUTURE = new MinecraftVersion("1.99.99");
} }

View File

@@ -9,7 +9,7 @@ import java.util.Objects;
public class VersionHelper { public class VersionHelper {
public static final boolean IS_RUNNING_IN_DEV = Boolean.getBoolean("net.momirealms.craftengine.dev"); public static final boolean IS_RUNNING_IN_DEV = Boolean.getBoolean("net.momirealms.craftengine.dev");
public static final boolean PREMIUM = false; public static final boolean PREMIUM = true;
public static final MinecraftVersion MINECRAFT_VERSION; public static final MinecraftVersion MINECRAFT_VERSION;
public static final boolean COMPONENT_RELEASE; public static final boolean COMPONENT_RELEASE;
private static final int version; private static final int version;
@@ -37,6 +37,7 @@ public class VersionHelper {
private static final boolean v1_21_8; private static final boolean v1_21_8;
private static final boolean v1_21_9; private static final boolean v1_21_9;
private static final boolean v1_21_10; private static final boolean v1_21_10;
private static final boolean v1_21_11;
private static final Class<?> UNOBFUSCATED_CLAZZ = Objects.requireNonNull(ReflectionUtils.getClazz( private static final Class<?> UNOBFUSCATED_CLAZZ = Objects.requireNonNull(ReflectionUtils.getClazz(
"net.minecraft.obfuscate.DontObfuscate", // 因为无混淆版本没有这个类所以说多写几个防止找不到了 "net.minecraft.obfuscate.DontObfuscate", // 因为无混淆版本没有这个类所以说多写几个防止找不到了
"net.minecraft.data.Main", "net.minecraft.data.Main",
@@ -84,6 +85,7 @@ public class VersionHelper {
v1_21_8 = version >= 12108; v1_21_8 = version >= 12108;
v1_21_9 = version >= 12109; v1_21_9 = version >= 12109;
v1_21_10 = version >= 12110; v1_21_10 = version >= 12110;
v1_21_11 = version >= 12111;
majorVersion = major; majorVersion = major;
minorVersion = minor; minorVersion = minor;
@@ -263,4 +265,8 @@ public class VersionHelper {
public static boolean isOrAbove1_21_10() { public static boolean isOrAbove1_21_10() {
return v1_21_10; return v1_21_10;
} }
public static boolean isOrAbove1_21_11() {
return v1_21_11;
}
} }