blocks: fix redundant_field_names

cat src/lib.rs|perl -pe's/\b(\w+): \1\b/$1/g'|sponge src/lib.rs
This commit is contained in:
ice_iix 2020-06-28 17:45:15 -07:00
parent e9d2e4691c
commit ac1dad12df
1 changed files with 37 additions and 37 deletions

View File

@ -570,9 +570,9 @@ define_blocks! {
} }
}, },
update_state (world, pos) => if variant == DirtVariant::Podzol { update_state (world, pos) => if variant == DirtVariant::Podzol {
Block::Dirt{snowy: is_snowy(world, pos), variant: variant} Block::Dirt{snowy: is_snowy(world, pos), variant}
} else { } else {
Block::Dirt{snowy: snowy, variant: variant} Block::Dirt{snowy, variant}
}, },
} }
Cobblestone { Cobblestone {
@ -1337,7 +1337,7 @@ define_blocks! {
collision vec![], collision vec![],
update_state (world, pos) => { update_state (world, pos) => {
Fire{ Fire{
age: age, age,
up: can_burn(world, pos.shift(Direction::Up)), up: can_burn(world, pos.shift(Direction::Up)),
north: can_burn(world, pos.shift(Direction::North)), north: can_burn(world, pos.shift(Direction::North)),
south: can_burn(world, pos.shift(Direction::South)), south: can_burn(world, pos.shift(Direction::South)),
@ -1438,7 +1438,7 @@ define_blocks! {
south: can_connect_redstone(world, pos, Direction::South), south: can_connect_redstone(world, pos, Direction::South),
west: can_connect_redstone(world, pos, Direction::West), west: can_connect_redstone(world, pos, Direction::West),
east: can_connect_redstone(world, pos, Direction::East), east: can_connect_redstone(world, pos, Direction::East),
power: power power
}, },
multipart (key, val) => match key { multipart (key, val) => match key {
"north" => val.contains(north.as_string()), "north" => val.contains(north.as_string()),
@ -1565,7 +1565,7 @@ define_blocks! {
collision door_collision(facing, hinge, open), collision door_collision(facing, hinge, open),
update_state (world, pos) => { update_state (world, pos) => {
let (facing, hinge, open, powered) = update_door_state(world, pos, half, facing, hinge, open, powered); let (facing, hinge, open, powered) = update_door_state(world, pos, half, facing, hinge, open, powered);
Block::WoodenDoor{facing: facing, half: half, hinge: hinge, open: open, powered: powered} Block::WoodenDoor{facing, half, hinge, open, powered}
}, },
} }
Ladder { Ladder {
@ -1702,7 +1702,7 @@ define_blocks! {
collision door_collision(facing, hinge, open), collision door_collision(facing, hinge, open),
update_state (world, pos) => { update_state (world, pos) => {
let (facing, hinge, open, powered) = update_door_state(world, pos, half, facing, hinge, open, powered); let (facing, hinge, open, powered) = update_door_state(world, pos, half, facing, hinge, open, powered);
Block::IronDoor{facing: facing, half: half, hinge: hinge, open: open, powered: powered} Block::IronDoor{facing, half, hinge, open, powered}
}, },
} }
WoodenPressurePlate { WoodenPressurePlate {
@ -2088,7 +2088,7 @@ define_blocks! {
Point3::new(0.0, 0.0, 0.0), Point3::new(0.0, 0.0, 0.0),
Point3::new(1.0, 1.0/8.0, 1.0) Point3::new(1.0, 1.0/8.0, 1.0)
)], )],
update_state (world, pos) => RepeaterPowered{delay: delay, facing: facing, locked: update_repeater_state(world, pos, facing)}, update_state (world, pos) => RepeaterPowered{delay, facing, locked: update_repeater_state(world, pos, facing)},
} }
StainedGlass { StainedGlass {
props { props {
@ -2380,7 +2380,7 @@ define_blocks! {
_ => Direction::Up, _ => Direction::Up,
}; };
Block::PumpkinStem{age: age, facing: facing} Block::PumpkinStem{age, facing}
}, },
} }
MelonStem { MelonStem {
@ -2416,7 +2416,7 @@ define_blocks! {
_ => Direction::Up, _ => Direction::Up,
}; };
Block::MelonStem{age: age, facing: facing} Block::MelonStem{age, facing}
}, },
} }
Vine { Vine {
@ -2448,7 +2448,7 @@ define_blocks! {
update_state (world, pos) => { update_state (world, pos) => {
let mat = world.get_block(pos.shift(Direction::Up)).get_material(); let mat = world.get_block(pos.shift(Direction::Up)).get_material();
let up = mat.renderable && (mat.should_cull_against || mat.never_cull /* Because leaves */); let up = mat.renderable && (mat.should_cull_against || mat.never_cull /* Because leaves */);
Vine{up: up, south: south, west: west, north: north, east: east} Vine{up, south, west, north, east}
}, },
} }
FenceGate { FenceGate {
@ -2470,10 +2470,10 @@ define_blocks! {
variant format!("facing={},in_wall={},open={}", facing.as_string(), in_wall, open), variant format!("facing={},in_wall={},open={}", facing.as_string(), in_wall, open),
collision fence_gate_collision(facing, in_wall, open), collision fence_gate_collision(facing, in_wall, open),
update_state (world, pos) => Block::FenceGate{ update_state (world, pos) => Block::FenceGate{
facing: facing, facing,
in_wall: fence_gate_update_state(world, pos, facing), in_wall: fence_gate_update_state(world, pos, facing),
open: open, open,
powered: powered powered
}, },
} }
BrickStairs { BrickStairs {
@ -2930,14 +2930,14 @@ define_blocks! {
}; };
Tripwire{ Tripwire{
powered: powered, powered,
attached: attached, attached,
disarmed: disarmed, disarmed,
north: f(Direction::North), north: f(Direction::North),
south: f(Direction::South), south: f(Direction::South),
west: f(Direction::West), west: f(Direction::West),
east: f(Direction::East), east: f(Direction::East),
mojang_cant_even: mojang_cant_even mojang_cant_even
} }
}, },
} }
@ -4206,10 +4206,10 @@ define_blocks! {
variant format!("facing={},in_wall={},open={}", facing.as_string(), in_wall, open), variant format!("facing={},in_wall={},open={}", facing.as_string(), in_wall, open),
collision fence_gate_collision(facing, in_wall, open), collision fence_gate_collision(facing, in_wall, open),
update_state (world, pos) => Block::SpruceFenceGate{ update_state (world, pos) => Block::SpruceFenceGate{
facing: facing, facing,
in_wall: fence_gate_update_state(world, pos, facing), in_wall: fence_gate_update_state(world, pos, facing),
open: open, open,
powered: powered powered
}, },
} }
BirchFenceGate { BirchFenceGate {
@ -4231,10 +4231,10 @@ define_blocks! {
variant format!("facing={},in_wall={},open={}", facing.as_string(), in_wall, open), variant format!("facing={},in_wall={},open={}", facing.as_string(), in_wall, open),
collision fence_gate_collision(facing, in_wall, open), collision fence_gate_collision(facing, in_wall, open),
update_state (world, pos) => Block::BirchFenceGate{ update_state (world, pos) => Block::BirchFenceGate{
facing: facing, facing,
in_wall: fence_gate_update_state(world, pos, facing), in_wall: fence_gate_update_state(world, pos, facing),
open: open, open,
powered: powered powered
}, },
} }
JungleFenceGate { JungleFenceGate {
@ -4256,10 +4256,10 @@ define_blocks! {
variant format!("facing={},in_wall={},open={}", facing.as_string(), in_wall, open), variant format!("facing={},in_wall={},open={}", facing.as_string(), in_wall, open),
collision fence_gate_collision(facing, in_wall, open), collision fence_gate_collision(facing, in_wall, open),
update_state (world, pos) => Block::JungleFenceGate{ update_state (world, pos) => Block::JungleFenceGate{
facing: facing, facing,
in_wall: fence_gate_update_state(world, pos, facing), in_wall: fence_gate_update_state(world, pos, facing),
open: open, open,
powered: powered powered
}, },
} }
DarkOakFenceGate { DarkOakFenceGate {
@ -4281,10 +4281,10 @@ define_blocks! {
variant format!("facing={},in_wall={},open={}", facing.as_string(), in_wall, open), variant format!("facing={},in_wall={},open={}", facing.as_string(), in_wall, open),
collision fence_gate_collision(facing, in_wall, open), collision fence_gate_collision(facing, in_wall, open),
update_state (world, pos) => Block::DarkOakFenceGate{ update_state (world, pos) => Block::DarkOakFenceGate{
facing: facing, facing,
in_wall: fence_gate_update_state(world, pos, facing), in_wall: fence_gate_update_state(world, pos, facing),
open: open, open,
powered: powered powered
}, },
} }
AcaciaFenceGate { AcaciaFenceGate {
@ -4306,10 +4306,10 @@ define_blocks! {
variant format!("facing={},in_wall={},open={}", facing.as_string(), in_wall, open), variant format!("facing={},in_wall={},open={}", facing.as_string(), in_wall, open),
collision fence_gate_collision(facing, in_wall, open), collision fence_gate_collision(facing, in_wall, open),
update_state (world, pos) => Block::AcaciaFenceGate{ update_state (world, pos) => Block::AcaciaFenceGate{
facing: facing, facing,
in_wall: fence_gate_update_state(world, pos, facing), in_wall: fence_gate_update_state(world, pos, facing),
open: open, open,
powered: powered powered
}, },
} }
SpruceFence { SpruceFence {
@ -4478,7 +4478,7 @@ define_blocks! {
collision door_collision(facing, hinge, open), collision door_collision(facing, hinge, open),
update_state (world, pos) => { update_state (world, pos) => {
let (facing, hinge, open, powered) = update_door_state(world, pos, half, facing, hinge, open, powered); let (facing, hinge, open, powered) = update_door_state(world, pos, half, facing, hinge, open, powered);
Block::SpruceDoor{facing: facing, half: half, hinge: hinge, open: open, powered: powered} Block::SpruceDoor{facing, half, hinge, open, powered}
}, },
} }
BirchDoor { BirchDoor {
@ -4502,7 +4502,7 @@ define_blocks! {
collision door_collision(facing, hinge, open), collision door_collision(facing, hinge, open),
update_state (world, pos) => { update_state (world, pos) => {
let (facing, hinge, open, powered) = update_door_state(world, pos, half, facing, hinge, open, powered); let (facing, hinge, open, powered) = update_door_state(world, pos, half, facing, hinge, open, powered);
Block::BirchDoor{facing: facing, half: half, hinge: hinge, open: open, powered: powered} Block::BirchDoor{facing, half, hinge, open, powered}
}, },
} }
JungleDoor { JungleDoor {
@ -4526,7 +4526,7 @@ define_blocks! {
collision door_collision(facing, hinge, open), collision door_collision(facing, hinge, open),
update_state (world, pos) => { update_state (world, pos) => {
let (facing, hinge, open, powered) = update_door_state(world, pos, half, facing, hinge, open, powered); let (facing, hinge, open, powered) = update_door_state(world, pos, half, facing, hinge, open, powered);
Block::JungleDoor{facing: facing, half: half, hinge: hinge, open: open, powered: powered} Block::JungleDoor{facing, half, hinge, open, powered}
}, },
} }
AcaciaDoor { AcaciaDoor {
@ -4550,7 +4550,7 @@ define_blocks! {
collision door_collision(facing, hinge, open), collision door_collision(facing, hinge, open),
update_state (world, pos) => { update_state (world, pos) => {
let (facing, hinge, open, powered) = update_door_state(world, pos, half, facing, hinge, open, powered); let (facing, hinge, open, powered) = update_door_state(world, pos, half, facing, hinge, open, powered);
Block::AcaciaDoor{facing: facing, half: half, hinge: hinge, open: open, powered: powered} Block::AcaciaDoor{facing, half, hinge, open, powered}
}, },
} }
DarkOakDoor { DarkOakDoor {
@ -4574,7 +4574,7 @@ define_blocks! {
collision door_collision(facing, hinge, open), collision door_collision(facing, hinge, open),
update_state (world, pos) => { update_state (world, pos) => {
let (facing, hinge, open, powered) = update_door_state(world, pos, half, facing, hinge, open, powered); let (facing, hinge, open, powered) = update_door_state(world, pos, half, facing, hinge, open, powered);
Block::DarkOakDoor{facing: facing, half: half, hinge: hinge, open: open, powered: powered} Block::DarkOakDoor{facing, half, hinge, open, powered}
}, },
} }
EndRod { EndRod {