forked from Pumpkin-MC/Pumpkin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Pumpkin-MC:master' into chunk_bulk_api_v2
- Loading branch information
Showing
212 changed files
with
1,656 additions
and
947 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[ | ||
"speed", | ||
"slowness", | ||
"haste", | ||
"mining_fatigue", | ||
"strength", | ||
"instant_health", | ||
"instant_damage", | ||
"jump_boost", | ||
"nausea", | ||
"regeneration", | ||
"resistance", | ||
"fire_resistance", | ||
"water_breathing", | ||
"invisibility", | ||
"blindness", | ||
"night_vision", | ||
"hunger", | ||
"weakness", | ||
"poison", | ||
"wither", | ||
"health_boost", | ||
"absorption", | ||
"saturation", | ||
"glowing", | ||
"levitation", | ||
"luck", | ||
"unluck", | ||
"slow_falling", | ||
"conduit_power", | ||
"dolphins_grace", | ||
"bad_omen", | ||
"hero_of_the_village", | ||
"darkness", | ||
"trial_omen", | ||
"raid_omen", | ||
"wind_charged", | ||
"weaving", | ||
"oozing", | ||
"infested" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
use heck::ToPascalCase; | ||
use proc_macro2::TokenStream; | ||
use quote::{format_ident, quote}; | ||
|
||
pub(crate) fn build() -> TokenStream { | ||
println!("cargo:rerun-if-changed=../assets/status_effects.json"); | ||
|
||
let chunk_status: Vec<String> = | ||
serde_json::from_str(include_str!("../../assets/status_effects.json")) | ||
.expect("Failed to parse status_effects.json"); | ||
let mut variants = TokenStream::new(); | ||
let mut type_from_name = TokenStream::new(); | ||
let mut type_to_name = TokenStream::new(); | ||
|
||
for status in chunk_status.iter() { | ||
let const_ident = format_ident!("{}", status.to_pascal_case()); | ||
let resource_name = status.to_lowercase(); | ||
|
||
variants.extend([quote! { | ||
#const_ident, | ||
}]); | ||
type_from_name.extend(quote! { | ||
#resource_name => Some(Self::#const_ident), | ||
}); | ||
type_to_name.extend(quote! { | ||
Self::#const_ident => #resource_name, | ||
}); | ||
} | ||
quote! { | ||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] | ||
pub enum EffectType { | ||
#variants | ||
} | ||
|
||
impl EffectType { | ||
#[doc = r" Try to parse a Effect Type from a resource location string"] | ||
pub fn from_name(name: &str) -> Option<Self> { | ||
match name { | ||
#type_from_name | ||
_ => None | ||
} | ||
} | ||
|
||
pub const fn to_name(&self) -> &'static str { | ||
match self { | ||
#type_to_name | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,7 @@ | ||
use pumpkin_data::packet::clientbound::CONFIG_FINISH_CONFIGURATION; | ||
use pumpkin_macros::client_packet; | ||
use pumpkin_macros::packet; | ||
use serde::Serialize; | ||
|
||
#[derive(serde::Serialize)] | ||
#[client_packet(CONFIG_FINISH_CONFIGURATION)] | ||
pub struct CFinishConfig {} | ||
|
||
impl Default for CFinishConfig { | ||
fn default() -> Self { | ||
Self::new() | ||
} | ||
} | ||
|
||
impl CFinishConfig { | ||
pub fn new() -> Self { | ||
Self {} | ||
} | ||
} | ||
#[derive(Serialize)] | ||
#[packet(CONFIG_FINISH_CONFIGURATION)] | ||
pub struct CFinishConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.