mirror of
https://github.com/italicsjenga/valence.git
synced 2024-12-23 06:21:31 +11:00
Update to Minecraft 1.20.1 (#358)
## Description Updates valence to Minecraft 1.20.1, which is protocol compatible with 1.20. closes #357 --------- Co-authored-by: Ryan Johnson <ryanj00a@gmail.com> Co-authored-by: AviiNL <me@avii.nl>
This commit is contained in:
parent
c4741b68b8
commit
09fbd9b7e7
|
@ -4,7 +4,7 @@ exclude = ["rust-mc-bot", "tools/stresser", "tools/packet_inspector"]
|
|||
resolver = "2"
|
||||
|
||||
[workspace.package]
|
||||
version = "0.2.0-dev+mc.1.19.4"
|
||||
version = "0.2.0-dev+mc.1.20.1"
|
||||
edition = "2021"
|
||||
repository = "https://github.com/valence-rs/valence"
|
||||
documentation = "https://docs.rs/valence/"
|
||||
|
|
|
@ -28,7 +28,6 @@ pub fn packet(c: &mut Criterion) {
|
|||
}),
|
||||
blocks_and_biomes: BLOCKS_AND_BIOMES.as_slice(),
|
||||
block_entities: Cow::Borrowed(&[]),
|
||||
trust_edges: false,
|
||||
sky_light_mask: Cow::Borrowed(&[]),
|
||||
block_light_mask: Cow::Borrowed(&[]),
|
||||
empty_sky_light_mask: Cow::Borrowed(&[]),
|
||||
|
|
|
@ -68,7 +68,7 @@ fn squat_and_die(mut clients: Query<&mut Client>, mut events: EventReader<Sneaki
|
|||
for event in events.iter() {
|
||||
if event.state == SneakState::Start {
|
||||
if let Ok(mut client) = clients.get_mut(event.client) {
|
||||
client.kill(None, "Squatted too hard.");
|
||||
client.kill("Squatted too hard.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,6 +105,7 @@ impl<'w, 's> UpdateAdvancementCachedBytesQuery<'w, 's> {
|
|||
display_data: None,
|
||||
criteria: vec![],
|
||||
requirements: vec![],
|
||||
sends_telemetry_data: false,
|
||||
};
|
||||
|
||||
if let Some(a_parent) = a_parent {
|
||||
|
|
|
@ -25,6 +25,7 @@ pub struct Advancement<'a, I> {
|
|||
pub display_data: Option<AdvancementDisplay<'a, I>>,
|
||||
pub criteria: Vec<(Ident<Cow<'a, str>>, ())>,
|
||||
pub requirements: Vec<AdvancementRequirements<'a>>,
|
||||
pub sends_telemetry_data: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Encode, Decode)]
|
||||
|
|
|
@ -330,10 +330,9 @@ impl Client {
|
|||
|
||||
/// Kills the client and shows `message` on the death screen. If an entity
|
||||
/// killed the player, you should supply it as `killer`.
|
||||
pub fn kill(&mut self, killer: Option<EntityId>, message: impl Into<Text>) {
|
||||
pub fn kill(&mut self, message: impl Into<Text>) {
|
||||
self.write_packet(&DeathMessageS2c {
|
||||
player_id: VarInt(0),
|
||||
entity_id: killer.map(|id| id.get()).unwrap_or(-1),
|
||||
message: message.into().into(),
|
||||
});
|
||||
}
|
||||
|
@ -725,6 +724,7 @@ fn initial_join(
|
|||
is_debug: q.is_debug.0,
|
||||
is_flat: q.is_flat.0,
|
||||
last_death_location,
|
||||
portal_cooldown: VarInt(0), // TODO.
|
||||
});
|
||||
|
||||
q.client.enc.append_bytes(tags.sync_tags_packet());
|
||||
|
@ -785,6 +785,7 @@ fn respawn(
|
|||
is_flat: is_flat.0,
|
||||
copy_metadata: true,
|
||||
last_death_location,
|
||||
portal_cooldown: VarInt(0), // TODO
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -179,6 +179,7 @@ pub enum UpdatePlayerAbilitiesC2s {
|
|||
#[packet(id = packet_id::UPDATE_SIGN_C2S)]
|
||||
pub struct UpdateSignC2s<'a> {
|
||||
pub position: BlockPos,
|
||||
pub is_front_text: bool,
|
||||
pub lines: [&'a str; 4],
|
||||
}
|
||||
|
||||
|
@ -249,8 +250,6 @@ pub mod structure_block {
|
|||
#[packet(id = packet_id::DEATH_MESSAGE_S2C)]
|
||||
pub struct DeathMessageS2c<'a> {
|
||||
pub player_id: VarInt,
|
||||
/// Killer's entity ID, -1 if no killer
|
||||
pub entity_id: i32,
|
||||
pub message: Cow<'a, Text>,
|
||||
}
|
||||
|
||||
|
@ -286,7 +285,6 @@ pub struct EnterCombatS2c;
|
|||
#[packet(id = packet_id::END_COMBAT_S2C)]
|
||||
pub struct EndCombatS2c {
|
||||
pub duration: VarInt,
|
||||
pub entity_id: i32,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, Encode, Decode, Packet)]
|
||||
|
@ -324,6 +322,7 @@ pub struct GameJoinS2c<'a> {
|
|||
pub is_debug: bool,
|
||||
pub is_flat: bool,
|
||||
pub last_death_location: Option<GlobalPos<'a>>,
|
||||
pub portal_cooldown: VarInt,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, Encode, Decode, Packet)]
|
||||
|
@ -388,6 +387,7 @@ pub struct PlayerRespawnS2c<'a> {
|
|||
pub is_flat: bool,
|
||||
pub copy_metadata: bool,
|
||||
pub last_death_location: Option<GlobalPos<'a>>,
|
||||
pub portal_cooldown: VarInt,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, Encode, Decode, Packet)]
|
||||
|
|
|
@ -59,11 +59,11 @@ pub mod __private {
|
|||
extern crate self as valence_core;
|
||||
|
||||
/// The Minecraft protocol version this library currently targets.
|
||||
pub const PROTOCOL_VERSION: i32 = 762;
|
||||
pub const PROTOCOL_VERSION: i32 = 763;
|
||||
|
||||
/// The stringified name of the Minecraft version this library currently
|
||||
/// targets.
|
||||
pub const MINECRAFT_VERSION: &str = "1.19.4";
|
||||
pub const MINECRAFT_VERSION: &str = "1.20.1";
|
||||
|
||||
/// Minecraft's standard ticks per second (TPS).
|
||||
pub const DEFAULT_TPS: NonZeroU32 = match NonZeroU32::new(20) {
|
||||
|
|
|
@ -170,7 +170,7 @@ impl Value {
|
|||
quote!(None)
|
||||
}
|
||||
Value::ItemStack(stack) => {
|
||||
assert_eq!(stack, "1 air");
|
||||
assert_eq!(stack, "0 air");
|
||||
quote!(valence_core::item::ItemStack::default())
|
||||
}
|
||||
Value::Boolean(b) => quote!(#b),
|
||||
|
|
|
@ -357,7 +357,6 @@ impl Chunk<true> {
|
|||
|
||||
writer.write_packet(&ChunkDeltaUpdateS2c {
|
||||
chunk_section_position,
|
||||
invert_trust_edges: false,
|
||||
blocks: Cow::Borrowed(§.section_updates),
|
||||
});
|
||||
}
|
||||
|
@ -457,7 +456,6 @@ impl Chunk<true> {
|
|||
heightmaps: Cow::Owned(heightmaps),
|
||||
blocks_and_biomes: scratch,
|
||||
block_entities: Cow::Borrowed(&block_entities),
|
||||
trust_edges: true,
|
||||
sky_light_mask: Cow::Borrowed(&info.filler_sky_light_mask),
|
||||
block_light_mask: Cow::Borrowed(&[]),
|
||||
empty_sky_light_mask: Cow::Borrowed(&[]),
|
||||
|
|
|
@ -95,7 +95,6 @@ pub struct ChunkDataS2c<'a> {
|
|||
pub heightmaps: Cow<'a, Compound>,
|
||||
pub blocks_and_biomes: &'a [u8],
|
||||
pub block_entities: Cow<'a, [ChunkDataBlockEntity<'a>]>,
|
||||
pub trust_edges: bool,
|
||||
pub sky_light_mask: Cow<'a, [u64]>,
|
||||
pub block_light_mask: Cow<'a, [u64]>,
|
||||
pub empty_sky_light_mask: Cow<'a, [u64]>,
|
||||
|
@ -116,7 +115,6 @@ pub struct ChunkDataBlockEntity<'a> {
|
|||
#[packet(id = packet_id::CHUNK_DELTA_UPDATE_S2C)]
|
||||
pub struct ChunkDeltaUpdateS2c<'a> {
|
||||
pub chunk_section_position: i64,
|
||||
pub invert_trust_edges: bool,
|
||||
pub blocks: Cow<'a, [VarLong]>,
|
||||
}
|
||||
|
||||
|
@ -144,7 +142,6 @@ pub struct ChunkRenderDistanceCenterS2c {
|
|||
pub struct LightUpdateS2c {
|
||||
pub chunk_x: VarInt,
|
||||
pub chunk_z: VarInt,
|
||||
pub trust_edges: bool,
|
||||
pub sky_light_mask: Vec<u64>,
|
||||
pub block_light_mask: Vec<u64>,
|
||||
pub empty_sky_light_mask: Vec<u64>,
|
||||
|
|
|
@ -395,12 +395,19 @@ pub mod synchronize_recipes {
|
|||
ingredient: Ingredient,
|
||||
result: Option<ItemStack>,
|
||||
},
|
||||
Smithing {
|
||||
SmithingTransform {
|
||||
recipe_id: Ident<Cow<'a, str>>,
|
||||
template: Ingredient,
|
||||
base: Ingredient,
|
||||
addition: Ingredient,
|
||||
result: Option<ItemStack>,
|
||||
},
|
||||
SmithingTrim {
|
||||
recipe_id: Ident<Cow<'a, str>>,
|
||||
template: Ingredient,
|
||||
base: Ingredient,
|
||||
addition: Ingredient,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||
|
@ -600,17 +607,31 @@ pub mod synchronize_recipes {
|
|||
ingredient.encode(&mut w)?;
|
||||
result.encode(w)
|
||||
}
|
||||
Recipe::Smithing {
|
||||
Recipe::SmithingTransform {
|
||||
recipe_id,
|
||||
template,
|
||||
base,
|
||||
addition,
|
||||
result,
|
||||
} => {
|
||||
"smithing".encode(&mut w)?;
|
||||
"smithing_transform".encode(&mut w)?;
|
||||
recipe_id.encode(&mut w)?;
|
||||
template.encode(&mut w)?;
|
||||
base.encode(&mut w)?;
|
||||
addition.encode(&mut w)?;
|
||||
result.encode(w)
|
||||
result.encode(&mut w)
|
||||
}
|
||||
Recipe::SmithingTrim {
|
||||
recipe_id,
|
||||
template,
|
||||
base,
|
||||
addition,
|
||||
} => {
|
||||
"smithing_trim".encode(&mut w)?;
|
||||
recipe_id.encode(&mut w)?;
|
||||
template.encode(&mut w)?;
|
||||
base.encode(&mut w)?;
|
||||
addition.encode(&mut w)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -690,12 +711,19 @@ pub mod synchronize_recipes {
|
|||
ingredient: Decode::decode(r)?,
|
||||
result: Decode::decode(r)?,
|
||||
},
|
||||
"minecraft:smithing" => Self::Smithing {
|
||||
"minecraft:smithing_transform" => Self::SmithingTransform {
|
||||
recipe_id: Decode::decode(r)?,
|
||||
template: Decode::decode(r)?,
|
||||
base: Decode::decode(r)?,
|
||||
addition: Decode::decode(r)?,
|
||||
result: Decode::decode(r)?,
|
||||
},
|
||||
"minecraft:smithing_trim" => Self::SmithingTrim {
|
||||
recipe_id: Decode::decode(r)?,
|
||||
template: Decode::decode(r)?,
|
||||
base: Decode::decode(r)?,
|
||||
addition: Decode::decode(r)?,
|
||||
},
|
||||
other => Self::CraftingSpecial {
|
||||
kind: match other {
|
||||
"minecraft:crafting_special_armordye" => SpecialCraftingKind::ArmorDye,
|
||||
|
|
|
@ -51,7 +51,7 @@ impl RegistryCodec {
|
|||
|
||||
impl Default for RegistryCodec {
|
||||
fn default() -> Self {
|
||||
let codec = include_bytes!("../../../extracted/registry_codec_1.19.4.dat");
|
||||
let codec = include_bytes!("../../../extracted/registry_codec_1.20.dat");
|
||||
let compound = Compound::from_binary(&mut codec.as_slice())
|
||||
.expect("failed to decode vanilla registry codec")
|
||||
.0;
|
||||
|
|
162660
extracted/blocks.json
162660
extracted/blocks.json
File diff suppressed because it is too large
Load diff
|
@ -21,7 +21,7 @@
|
|||
"name": "item",
|
||||
"index": 8,
|
||||
"type": "item_stack",
|
||||
"default_value": "1 air"
|
||||
"default_value": "0 air"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -997,7 +997,7 @@
|
|||
"name": "item",
|
||||
"index": 8,
|
||||
"type": "item_stack",
|
||||
"default_value": "1 air"
|
||||
"default_value": "0 air"
|
||||
}
|
||||
],
|
||||
"default_bounding_box": {
|
||||
|
@ -1048,7 +1048,7 @@
|
|||
"name": "item",
|
||||
"index": 8,
|
||||
"type": "item_stack",
|
||||
"default_value": "1 air"
|
||||
"default_value": "0 air"
|
||||
},
|
||||
{
|
||||
"name": "shooter_entity_id",
|
||||
|
@ -1436,7 +1436,7 @@
|
|||
"name": "item",
|
||||
"index": 22,
|
||||
"type": "item_stack",
|
||||
"default_value": "1 air"
|
||||
"default_value": "0 air"
|
||||
},
|
||||
{
|
||||
"name": "item_display",
|
||||
|
@ -1460,7 +1460,7 @@
|
|||
"name": "stack",
|
||||
"index": 8,
|
||||
"type": "item_stack",
|
||||
"default_value": "1 air"
|
||||
"default_value": "0 air"
|
||||
}
|
||||
],
|
||||
"default_bounding_box": {
|
||||
|
@ -1478,7 +1478,7 @@
|
|||
"name": "item_stack",
|
||||
"index": 8,
|
||||
"type": "item_stack",
|
||||
"default_value": "1 air"
|
||||
"default_value": "0 air"
|
||||
},
|
||||
{
|
||||
"name": "rotation",
|
||||
|
@ -1528,7 +1528,7 @@
|
|||
"name": "health",
|
||||
"index": 9,
|
||||
"type": "float",
|
||||
"default_value": 20.0
|
||||
"default_value": 200.0
|
||||
},
|
||||
{
|
||||
"name": "potion_swirls_color",
|
||||
|
@ -2302,9 +2302,9 @@
|
|||
}
|
||||
],
|
||||
"default_bounding_box": {
|
||||
"size_x": 0.699999988079071,
|
||||
"size_y": 0.5,
|
||||
"size_z": 0.699999988079071
|
||||
"size_x": 1.399999976158142,
|
||||
"size_y": 0.8999999761581421,
|
||||
"size_z": 1.399999976158142
|
||||
}
|
||||
},
|
||||
"SquidEntity": {
|
||||
|
@ -2448,7 +2448,7 @@
|
|||
"name": "item",
|
||||
"index": 8,
|
||||
"type": "item_stack",
|
||||
"default_value": "1 air"
|
||||
"default_value": "0 air"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -2863,7 +2863,7 @@
|
|||
"type": "villager_data",
|
||||
"default_value": {
|
||||
"type": "plains",
|
||||
"profession": "none",
|
||||
"profession": "toolsmith",
|
||||
"level": 1
|
||||
}
|
||||
}
|
||||
|
|
2621
extracted/items.json
2621
extracted/items.json
File diff suppressed because it is too large
Load diff
|
@ -182,7 +182,7 @@
|
|||
"add_death_particles": 60,
|
||||
"ears_twitch": 61,
|
||||
"sonic_boom": 62,
|
||||
"field_42621": 63
|
||||
"start_digging": 63
|
||||
},
|
||||
"entity_animation": {
|
||||
"swing_main_hand": 0,
|
||||
|
@ -442,73 +442,72 @@
|
|||
"firework": 26,
|
||||
"fishing": 27,
|
||||
"flame": 28,
|
||||
"dripping_cherry_leaves": 29,
|
||||
"falling_cherry_leaves": 30,
|
||||
"landing_cherry_leaves": 31,
|
||||
"sculk_soul": 32,
|
||||
"sculk_charge": 33,
|
||||
"sculk_charge_pop": 34,
|
||||
"soul_fire_flame": 35,
|
||||
"soul": 36,
|
||||
"flash": 37,
|
||||
"happy_villager": 38,
|
||||
"composter": 39,
|
||||
"heart": 40,
|
||||
"instant_effect": 41,
|
||||
"item": 42,
|
||||
"vibration": 43,
|
||||
"item_slime": 44,
|
||||
"item_snowball": 45,
|
||||
"large_smoke": 46,
|
||||
"lava": 47,
|
||||
"mycelium": 48,
|
||||
"note": 49,
|
||||
"poof": 50,
|
||||
"portal": 51,
|
||||
"rain": 52,
|
||||
"smoke": 53,
|
||||
"sneeze": 54,
|
||||
"spit": 55,
|
||||
"squid_ink": 56,
|
||||
"sweep_attack": 57,
|
||||
"totem_of_undying": 58,
|
||||
"underwater": 59,
|
||||
"splash": 60,
|
||||
"witch": 61,
|
||||
"bubble_pop": 62,
|
||||
"current_down": 63,
|
||||
"bubble_column_up": 64,
|
||||
"nautilus": 65,
|
||||
"dolphin": 66,
|
||||
"campfire_cosy_smoke": 67,
|
||||
"campfire_signal_smoke": 68,
|
||||
"dripping_honey": 69,
|
||||
"falling_honey": 70,
|
||||
"landing_honey": 71,
|
||||
"falling_nectar": 72,
|
||||
"falling_spore_blossom": 73,
|
||||
"ash": 74,
|
||||
"crimson_spore": 75,
|
||||
"warped_spore": 76,
|
||||
"spore_blossom_air": 77,
|
||||
"dripping_obsidian_tear": 78,
|
||||
"falling_obsidian_tear": 79,
|
||||
"landing_obsidian_tear": 80,
|
||||
"reverse_portal": 81,
|
||||
"white_ash": 82,
|
||||
"small_flame": 83,
|
||||
"snowflake": 84,
|
||||
"dripping_dripstone_lava": 85,
|
||||
"falling_dripstone_lava": 86,
|
||||
"dripping_dripstone_water": 87,
|
||||
"falling_dripstone_water": 88,
|
||||
"glow_squid_ink": 89,
|
||||
"glow": 90,
|
||||
"wax_on": 91,
|
||||
"wax_off": 92,
|
||||
"electric_spark": 93,
|
||||
"scrape": 94,
|
||||
"shriek": 95
|
||||
"cherry_leaves": 29,
|
||||
"sculk_soul": 30,
|
||||
"sculk_charge": 31,
|
||||
"sculk_charge_pop": 32,
|
||||
"soul_fire_flame": 33,
|
||||
"soul": 34,
|
||||
"flash": 35,
|
||||
"happy_villager": 36,
|
||||
"composter": 37,
|
||||
"heart": 38,
|
||||
"instant_effect": 39,
|
||||
"item": 40,
|
||||
"vibration": 41,
|
||||
"item_slime": 42,
|
||||
"item_snowball": 43,
|
||||
"large_smoke": 44,
|
||||
"lava": 45,
|
||||
"mycelium": 46,
|
||||
"note": 47,
|
||||
"poof": 48,
|
||||
"portal": 49,
|
||||
"rain": 50,
|
||||
"smoke": 51,
|
||||
"sneeze": 52,
|
||||
"spit": 53,
|
||||
"squid_ink": 54,
|
||||
"sweep_attack": 55,
|
||||
"totem_of_undying": 56,
|
||||
"underwater": 57,
|
||||
"splash": 58,
|
||||
"witch": 59,
|
||||
"bubble_pop": 60,
|
||||
"current_down": 61,
|
||||
"bubble_column_up": 62,
|
||||
"nautilus": 63,
|
||||
"dolphin": 64,
|
||||
"campfire_cosy_smoke": 65,
|
||||
"campfire_signal_smoke": 66,
|
||||
"dripping_honey": 67,
|
||||
"falling_honey": 68,
|
||||
"landing_honey": 69,
|
||||
"falling_nectar": 70,
|
||||
"falling_spore_blossom": 71,
|
||||
"ash": 72,
|
||||
"crimson_spore": 73,
|
||||
"warped_spore": 74,
|
||||
"spore_blossom_air": 75,
|
||||
"dripping_obsidian_tear": 76,
|
||||
"falling_obsidian_tear": 77,
|
||||
"landing_obsidian_tear": 78,
|
||||
"reverse_portal": 79,
|
||||
"white_ash": 80,
|
||||
"small_flame": 81,
|
||||
"snowflake": 82,
|
||||
"dripping_dripstone_lava": 83,
|
||||
"falling_dripstone_lava": 84,
|
||||
"dripping_dripstone_water": 85,
|
||||
"falling_dripstone_water": 86,
|
||||
"glow_squid_ink": 87,
|
||||
"glow": 88,
|
||||
"wax_on": 89,
|
||||
"wax_off": 90,
|
||||
"electric_spark": 91,
|
||||
"scrape": 92,
|
||||
"shriek": 93,
|
||||
"egg_crack": 94
|
||||
},
|
||||
"sniffer_state": {
|
||||
"idling": 0,
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
12112
extracted/tags.json
12112
extracted/tags.json
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -12,7 +12,7 @@ From this directory, run the following
|
|||
./gradlew runServer
|
||||
```
|
||||
|
||||
This will run the extractor and immediately exit, outputting the files that are listed in the logs.
|
||||
This will run the extractor and immediately exit, outputting the files that are listed in the logs.
|
||||
|
||||
Next, run `copy_extractor_output.sh`. This copies the files to `extracted` so that they can be comitted.
|
||||
|
||||
|
@ -20,6 +20,28 @@ Next, run `copy_extractor_output.sh`. This copies the files to `extracted` so th
|
|||
./copy_extractor_output.sh
|
||||
```
|
||||
|
||||
## How to update valence to a new version of Minecraft
|
||||
|
||||
The general process should go something like this:
|
||||
1. Update `gradle.properties` to the new version of Minecraft using https://fabricmc.net/develop
|
||||
2. Update `src/main/resources/fabric.mod.json` to reference new version of Minecraft
|
||||
3. Update `PROTOCOL_VERSION` and `MINECRAFT_VERSION` constants in `valence_core/src/lib.rs`
|
||||
4. Attempt to run `./gradlew runServer` and fix any errors that come up
|
||||
5. Run `./copy_extractor_output.sh`
|
||||
6. In `*.toml`s, replace all strings of the old mc version with the new mc version
|
||||
7. Try all the examples. If they work, you're probably done.
|
||||
|
||||
|
||||
If you need to update gradle, running this will automatically update the wrapper to the specified version, and update `gradle/gradle-wrapper.properties`.
|
||||
```sh
|
||||
./gradlew wrapper --gradle-version VERSION
|
||||
```
|
||||
|
||||
You may also need to update the fabric mappings in the mod.
|
||||
```sh
|
||||
./gradlew migrateMappings --mappings "VERSION"
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Run `./gradlew genSources` to generate Minecraft Java source files for your IDE.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
plugins {
|
||||
id 'fabric-loom' version '1.0-SNAPSHOT'
|
||||
id 'fabric-loom' version '1.2-SNAPSHOT'
|
||||
}
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
org.gradle.jvmargs=-Xmx1G
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/develop
|
||||
minecraft_version=1.19.4
|
||||
yarn_mappings=1.19.4+build.1
|
||||
loader_version=0.14.18
|
||||
minecraft_version=1.20.1
|
||||
yarn_mappings=1.20.1+build.1
|
||||
loader_version=0.14.21
|
||||
# Mod Properties
|
||||
mod_version=1.0.0
|
||||
maven_group=dev.00a
|
||||
archives_base_name=valence-extractor
|
||||
# Dependencies
|
||||
fabric_version=0.76.0+1.19.4
|
||||
fabric_version=0.83.0+1.20.1
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package rs.valence.extractor;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import java.lang.reflect.Field;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.data.DataTracker;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
|
|
|
@ -31,7 +31,7 @@ import net.minecraft.world.entity.EntityLookup;
|
|||
import net.minecraft.world.event.GameEvent;
|
||||
import net.minecraft.world.tick.QueryableTickScheduler;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
|
@ -159,7 +159,7 @@ public class DummyWorld extends World {
|
|||
|
||||
@Override
|
||||
public FeatureSet getEnabledFeatures() {
|
||||
return FeatureSet.of(FeatureFlags.VANILLA, FeatureFlags.BUNDLE, FeatureFlags.UPDATE_1_20);
|
||||
return FeatureSet.of(FeatureFlags.VANILLA, FeatureFlags.BUNDLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
package rs.valence.extractor;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonElement;
|
||||
import io.netty.handler.codec.EncoderException;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.nbt.NbtIo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -13,6 +15,7 @@ import sun.reflect.ReflectionFactory;
|
|||
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
|
|
@ -4,8 +4,13 @@ import com.google.gson.JsonArray;
|
|||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.state.property.Property;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.item.VerticallyAttachableBlockItem;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.world.EmptyBlockView;
|
||||
import rs.valence.extractor.Main;
|
||||
import rs.valence.extractor.mixin.ExposeWallBlock;
|
||||
|
@ -69,7 +74,7 @@ public class Blocks implements Main.Extractor {
|
|||
stateJson.addProperty("id", id);
|
||||
stateJson.addProperty("luminance", state.getLuminance());
|
||||
stateJson.addProperty("opaque", state.isOpaque());
|
||||
stateJson.addProperty("replaceable", state.getMaterial().isReplaceable());
|
||||
stateJson.addProperty("replaceable", state.isReplaceable());
|
||||
|
||||
if (block.getDefaultState().equals(state)) {
|
||||
blockJson.addProperty("default_state_id", id);
|
||||
|
|
|
@ -3,6 +3,7 @@ package rs.valence.extractor.extractors;
|
|||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.registry.Registries;
|
||||
import rs.valence.extractor.Main;
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ import net.minecraft.entity.EntityPose;
|
|||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.data.DataTracker;
|
||||
import net.minecraft.entity.data.TrackedData;
|
||||
import net.minecraft.entity.data.TrackedDataHandler;
|
||||
import net.minecraft.entity.data.TrackedDataHandlerRegistry;
|
||||
import net.minecraft.entity.passive.CatVariant;
|
||||
import net.minecraft.entity.passive.FrogVariant;
|
||||
|
@ -17,7 +18,9 @@ import net.minecraft.particle.ParticleEffect;
|
|||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.entry.RegistryEntry;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.EulerAngle;
|
||||
import net.minecraft.util.math.GlobalPos;
|
||||
import net.minecraft.village.VillagerData;
|
||||
|
@ -30,9 +33,10 @@ import rs.valence.extractor.DummyPlayerEntity;
|
|||
import rs.valence.extractor.DummyWorld;
|
||||
import rs.valence.extractor.Main;
|
||||
import rs.valence.extractor.Main.Pair;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
public class Entities implements Main.Extractor {
|
||||
public Entities() {
|
||||
|
|
|
@ -3,6 +3,10 @@ package rs.valence.extractor.extractors;
|
|||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.mojang.datafixers.util.Pair;
|
||||
import net.minecraft.entity.effect.StatusEffectInstance;
|
||||
import net.minecraft.item.FoodComponent;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.registry.Registries;
|
||||
import rs.valence.extractor.Main;
|
||||
|
||||
|
|
|
@ -4,14 +4,22 @@ import com.google.gson.JsonElement;
|
|||
import com.google.gson.JsonObject;
|
||||
import net.minecraft.entity.EntityPose;
|
||||
import net.minecraft.entity.EntityStatuses;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.data.TrackedDataHandler;
|
||||
import net.minecraft.entity.data.TrackedDataHandlerRegistry;
|
||||
import net.minecraft.entity.decoration.painting.PaintingVariant;
|
||||
import net.minecraft.entity.passive.CatVariant;
|
||||
import net.minecraft.entity.passive.FrogVariant;
|
||||
import net.minecraft.entity.passive.SnifferEntity;
|
||||
import net.minecraft.entity.passive.SnifferEntity.State;
|
||||
import net.minecraft.network.packet.s2c.play.EntityAnimationS2CPacket;
|
||||
import net.minecraft.particle.ParticleType;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.village.VillagerProfession;
|
||||
import net.minecraft.village.VillagerType;
|
||||
import rs.valence.extractor.Main;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.Locale;
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package rs.valence.extractor.extractors;
|
|||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.network.NetworkSide;
|
||||
import net.minecraft.network.NetworkState;
|
||||
import rs.valence.extractor.Main;
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.google.gson.JsonArray;
|
|||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import rs.valence.extractor.Main;
|
||||
|
||||
public class Sounds implements Main.Extractor {
|
||||
|
|
|
@ -24,6 +24,7 @@ import net.minecraft.registry.entry.RegistryEntryList;
|
|||
import net.minecraft.registry.SerializableRegistries;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.HashMap;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ import rs.valence.extractor.Main;
|
|||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
public class TranslationKeys implements Main.Extractor {
|
||||
|
||||
|
|
|
@ -22,10 +22,10 @@
|
|||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.14.6",
|
||||
"minecraft": "~1.19",
|
||||
"minecraft": "~1.20.1",
|
||||
"java": ">=17"
|
||||
},
|
||||
"suggests": {
|
||||
"another-mod": "*"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue