Skip to content

Commit 8b0b667

Browse files
committed
Run reformat and prefer TagHelper#getHashed
1 parent 3ffb421 commit 8b0b667

File tree

292 files changed

+25839
-24567
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

292 files changed

+25839
-24567
lines changed

.github/CONTRIBUTING.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
#### **Did you find a bug?**
44

5-
* Ensure that the associated system is implemented first. E.g. Don't report entities not spawning from spawners, if the
5+
* Ensure that the associated system is implemented first. E.g. Don't report entities not spawning
6+
from spawners, if the
67
spawner logic has not been implemented.
78

89
* Open a new GitHub issue if it's not already reported.
@@ -13,11 +14,13 @@
1314

1415
* Open a new GitHub pull-request with the commits if it hasn't already been proposed.
1516

16-
* Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
17+
* Ensure the PR description clearly describes the problem and solution. Include the relevant issue
18+
number if applicable.
1719

1820
#### **Do you intend to add a new feature or change an existing one?**
1921

20-
* Do not open a pull-request on GitHub until you have collected positive feedback about the change from a maintainer.
22+
* Do not open a pull-request on GitHub until you have collected positive feedback about the change
23+
from a maintainer.
2124
You can do this in the [minestom discord](https://discord.gg/pkFRvqB).
2225

2326
#### **Do you have questions about the source code?**
@@ -26,12 +29,14 @@
2629

2730
#### **Do you want to contribute to the Minestom documentation?**
2831

29-
* Feel free to do so! Just make sure to conform to the [standard-readme](https://github.com/RichardLitt/standard-readme)
32+
* Feel free to do so! Just make sure to conform to
33+
the [standard-readme](https://github.com/RichardLitt/standard-readme)
3034
specification when editing the README.md.
3135

3236
## General Contribution Rules
3337

34-
* By contributing to the Vanilla Reimplementation project your code/contribution will be licensed under
38+
* By contributing to the Vanilla Reimplementation project your code/contribution will be licensed
39+
under
3540
the [Apache Version 2.0](../LICENSE) license.
3641

3742
Minestom & VRI are community projects. We encourage you to contribute! :)

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# NOT READY FOR PRODUCTION
22

3-
Priority is currently on the core of Minestom (see below). This project has only a very limited list of features.
3+
Priority is currently on the core of Minestom (see below). This project has only a very limited list
4+
of features.
45
Make sure to check out the project board [here](https://github.com/orgs/Minestom/projects/1).
56

67
# About Minestom
@@ -13,15 +14,19 @@ See [Minestom Project on GitHub](https://github.com/Minestom/Minestom)
1314

1415
# How to use
1516

16-
You can use this repo by finding the latest release [here](https://jitpack.io/#Minestom/VanillaReimplementation).
17+
You can use this repo by finding the latest
18+
release [here](https://jitpack.io/#Minestom/VanillaReimplementation).
1719
After selecting your release, make sure to choose which modules (vanila features) you want.
1820
The "core" module is required. Everything else is optional and up to you.
1921

20-
Once you have added your modules to your classpath, you can initiate vri in your server's startup using this snippet:
22+
Once you have added your modules to your classpath, you can initiate vri in your server's startup
23+
using this snippet:
2124
`VanillaReimplementation vri = VanillaReimplementation.hook(MinecraftServer.process());`.
2225

23-
See [here](https://github.com/Minestom/VanillaReimplementation/blob/93f29ab67ffff7d78e34b12ab5f00619109c84c7/server/src/main/java/net/minestom/vanilla/server/VanillaServer.java#L44) for an example.
26+
See [here](https://github.com/Minestom/VanillaReimplementation/blob/93f29ab67ffff7d78e34b12ab5f00619109c84c7/server/src/main/java/net/minestom/vanilla/server/VanillaServer.java#L44)
27+
for an example.
2428

2529
# How to contribute
2630

27-
See [the github project](https://github.com/orgs/Minestom/projects/1) for a list of relevant tasks that need to be done.
31+
See [the github project](https://github.com/orgs/Minestom/projects/1) for a list of relevant tasks
32+
that need to be done.

blocks/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
dependencies {
2-
api(project(":core"))
2+
api(project(":core"))
33
}

blocks/src/main/java/net/minestom/vanilla/blocks/BlockBehaviorRuleRegistrations.java

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,51 +6,52 @@
66
import net.minestom.vanilla.blocks.group.behaviour.BehaviourGroup;
77

88
/**
9-
* This file contains code ported from Kotlin to Java, adapted from the Blocks and Stuff project.
10-
* Original source: https://github.com/everbuild-org/blocks-and-stuff
9+
* This file contains code ported from Kotlin to Java, adapted from the Blocks and Stuff project. Original source:
10+
* https://github.com/everbuild-org/blocks-and-stuff
1111
* <p>
1212
* Original authors: ChrisB, AEinNico, CreepyX
1313
* <p>
1414
* Ported from Kotlin to Java and adapted for use in this project with modifications.
1515
*/
1616
public class BlockBehaviorRuleRegistrations {
17-
private static final ComponentLogger logger = MinecraftServer.LOGGER;
18-
19-
private static final VanillaBlockBehaviour BLOCK_BEHAVIOUR = VanillaBlockBehaviour.INSTANCE;
20-
21-
public static void registerDefault() {
22-
register(VanillaBlockBehaviour.CRAFTING_TABLE);
23-
register(VanillaBlockBehaviour.ANVIL);
24-
register(VanillaBlockBehaviour.BREWING_STAND);
25-
register(VanillaBlockBehaviour.LOOM);
26-
register(VanillaBlockBehaviour.GRINDSTONE);
27-
register(VanillaBlockBehaviour.SMITHING_TABLE);
28-
register(VanillaBlockBehaviour.CARTOGRAPHY_TABLE);
29-
register(VanillaBlockBehaviour.STONECUTTER);
30-
register(VanillaBlockBehaviour.ENCHANTING_TABLE);
31-
register(VanillaBlockBehaviour.TRAPDOOR);
32-
register(VanillaBlockBehaviour.FENCE_GATE);
33-
register(VanillaBlockBehaviour.COPPER);
34-
register(VanillaBlockBehaviour.WOODEN_DOORS);
35-
register(VanillaBlockBehaviour.SIGNS);
36-
register(VanillaBlockBehaviour.CAKE);
37-
register(VanillaBlockBehaviour.CANDLE_CAKE);
38-
register(VanillaBlockBehaviour.STRIPPABLE_WOOD);
39-
}
4017

41-
public static void register(BehaviourGroup... blockGroups) {
42-
var blockManager = MinecraftServer.getBlockManager();
43-
int count = 0;
18+
private static final ComponentLogger logger = MinecraftServer.LOGGER;
19+
20+
private static final VanillaBlockBehaviour BLOCK_BEHAVIOUR = VanillaBlockBehaviour.INSTANCE;
4421

45-
for (BehaviourGroup group : blockGroups) {
46-
var blockGroup = group.getBlockGroup();
47-
for (var block : blockGroup.allMatching()) {
48-
count++;
49-
var handler = group.createHandler(block);
50-
blockManager.registerHandler(block.key().asString(), () -> handler);
51-
}
52-
}
22+
public static void registerDefault() {
23+
register(VanillaBlockBehaviour.CRAFTING_TABLE);
24+
register(VanillaBlockBehaviour.ANVIL);
25+
register(VanillaBlockBehaviour.BREWING_STAND);
26+
register(VanillaBlockBehaviour.LOOM);
27+
register(VanillaBlockBehaviour.GRINDSTONE);
28+
register(VanillaBlockBehaviour.SMITHING_TABLE);
29+
register(VanillaBlockBehaviour.CARTOGRAPHY_TABLE);
30+
register(VanillaBlockBehaviour.STONECUTTER);
31+
register(VanillaBlockBehaviour.ENCHANTING_TABLE);
32+
register(VanillaBlockBehaviour.TRAPDOOR);
33+
register(VanillaBlockBehaviour.FENCE_GATE);
34+
register(VanillaBlockBehaviour.COPPER);
35+
register(VanillaBlockBehaviour.WOODEN_DOORS);
36+
register(VanillaBlockBehaviour.SIGNS);
37+
register(VanillaBlockBehaviour.CAKE);
38+
register(VanillaBlockBehaviour.CANDLE_CAKE);
39+
register(VanillaBlockBehaviour.STRIPPABLE_WOOD);
40+
}
5341

54-
logger.info("Registered {} handlers", count);
42+
public static void register(BehaviourGroup... blockGroups) {
43+
var blockManager = MinecraftServer.getBlockManager();
44+
int count = 0;
45+
46+
for (BehaviourGroup group : blockGroups) {
47+
var blockGroup = group.getBlockGroup();
48+
for (var block : blockGroup.allMatching()) {
49+
count++;
50+
var handler = group.createHandler(block);
51+
blockManager.registerHandler(block.key().asString(), () -> handler);
52+
}
5553
}
54+
55+
logger.info("Registered {} handlers", count);
56+
}
5657
}

blocks/src/main/java/net/minestom/vanilla/blocks/BlockPlacementRuleRegistrations.java

Lines changed: 73 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -6,88 +6,89 @@
66
import net.minestom.vanilla.blocks.group.placement.PlacementGroup;
77

88
/**
9-
* This file contains code ported from Kotlin to Java, adapted from the Blocks and Stuff project.
10-
* Original source: https://github.com/everbuild-org/blocks-and-stuff
9+
* This file contains code ported from Kotlin to Java, adapted from the Blocks and Stuff project. Original source:
10+
* https://github.com/everbuild-org/blocks-and-stuff
1111
* <p>
1212
* Original authors: ChrisB, AEinNico, CreepyX
1313
* <p>
1414
* Ported from Kotlin to Java and adapted for use in this project with modifications.
1515
*/
1616
public class BlockPlacementRuleRegistrations {
17-
private static final ComponentLogger logger = MinecraftServer.LOGGER;
1817

19-
private static final VanillaPlacementRules PLACEMENT_RULES = VanillaPlacementRules.INSTANCE;
18+
private static final ComponentLogger logger = MinecraftServer.LOGGER;
2019

21-
public static void registerDefault() {
22-
register(
23-
VanillaPlacementRules.ROTATED_PILLARS,
24-
VanillaPlacementRules.SLAB,
25-
VanillaPlacementRules.VERTICALLY_ROTATED,
26-
VanillaPlacementRules.ROTATED_WORKSTATIONS,
27-
VanillaPlacementRules.AMETHYST,
28-
VanillaPlacementRules.BAMBOO,
29-
VanillaPlacementRules.BANNER,
30-
VanillaPlacementRules.FACING,
31-
VanillaPlacementRules.OBSERVER,
32-
VanillaPlacementRules.SIMPLE_WATERLOGGABLE,
33-
VanillaPlacementRules.BEDS,
34-
VanillaPlacementRules.CROPS,
35-
VanillaPlacementRules.BELL,
36-
VanillaPlacementRules.BIG_DRIPLEAF,
37-
VanillaPlacementRules.BOTTOM_SUPPORTED,
38-
VanillaPlacementRules.PIN_BOTTOM_SUPPORTED,
39-
VanillaPlacementRules.BUTTONS,
40-
VanillaPlacementRules.CACTUS,
41-
VanillaPlacementRules.CAMPFIRE,
42-
VanillaPlacementRules.CANDLES,
43-
VanillaPlacementRules.VINES_TOP,
44-
VanillaPlacementRules.TRAPDOOR,
45-
VanillaPlacementRules.FENCE,
46-
VanillaPlacementRules.FENCE_GATE,
47-
VanillaPlacementRules.STAIRS,
48-
VanillaPlacementRules.VERTICAL_SLIM,
49-
VanillaPlacementRules.LADDERS,
50-
VanillaPlacementRules.TORCHES,
51-
VanillaPlacementRules.WALLS,
52-
VanillaPlacementRules.DOORS,
53-
VanillaPlacementRules.LANTERNS,
54-
VanillaPlacementRules.GLAZED_TERRACOTTA,
55-
VanillaPlacementRules.CHAINS,
56-
VanillaPlacementRules.TALL_FLOWERS,
57-
VanillaPlacementRules.SIGNS,
58-
VanillaPlacementRules.CHESTS,
59-
VanillaPlacementRules.HOPPERS,
60-
VanillaPlacementRules.SHULKERBOXES,
61-
VanillaPlacementRules.FLOOR_FLOWER,
62-
VanillaPlacementRules.CORALS,
63-
VanillaPlacementRules.WALL_CORALS,
64-
VanillaPlacementRules.HEADS,
65-
VanillaPlacementRules.SUGAR_CANE,
66-
VanillaPlacementRules.GROUNDED_PLANTS,
67-
VanillaPlacementRules.CRAFTER,
68-
VanillaPlacementRules.LEVER,
69-
VanillaPlacementRules.REDSTONE_STUFF,
70-
VanillaPlacementRules.FARMLAND,
71-
VanillaPlacementRules.SNOWY,
72-
VanillaPlacementRules.MUSHROOM,
73-
VanillaPlacementRules.RAIL,
74-
VanillaPlacementRules.FEATURE_RAIL,
75-
VanillaPlacementRules.GRINDSTONE
76-
);
77-
}
20+
private static final VanillaPlacementRules PLACEMENT_RULES = VanillaPlacementRules.INSTANCE;
7821

79-
public static void register(PlacementGroup... blockGroups) {
80-
var blockManager = MinecraftServer.getBlockManager();
81-
int count = 0;
22+
public static void registerDefault() {
23+
register(
24+
VanillaPlacementRules.ROTATED_PILLARS,
25+
VanillaPlacementRules.SLAB,
26+
VanillaPlacementRules.VERTICALLY_ROTATED,
27+
VanillaPlacementRules.ROTATED_WORKSTATIONS,
28+
VanillaPlacementRules.AMETHYST,
29+
VanillaPlacementRules.BAMBOO,
30+
VanillaPlacementRules.BANNER,
31+
VanillaPlacementRules.FACING,
32+
VanillaPlacementRules.OBSERVER,
33+
VanillaPlacementRules.SIMPLE_WATERLOGGABLE,
34+
VanillaPlacementRules.BEDS,
35+
VanillaPlacementRules.CROPS,
36+
VanillaPlacementRules.BELL,
37+
VanillaPlacementRules.BIG_DRIPLEAF,
38+
VanillaPlacementRules.BOTTOM_SUPPORTED,
39+
VanillaPlacementRules.PIN_BOTTOM_SUPPORTED,
40+
VanillaPlacementRules.BUTTONS,
41+
VanillaPlacementRules.CACTUS,
42+
VanillaPlacementRules.CAMPFIRE,
43+
VanillaPlacementRules.CANDLES,
44+
VanillaPlacementRules.VINES_TOP,
45+
VanillaPlacementRules.TRAPDOOR,
46+
VanillaPlacementRules.FENCE,
47+
VanillaPlacementRules.FENCE_GATE,
48+
VanillaPlacementRules.STAIRS,
49+
VanillaPlacementRules.VERTICAL_SLIM,
50+
VanillaPlacementRules.LADDERS,
51+
VanillaPlacementRules.TORCHES,
52+
VanillaPlacementRules.WALLS,
53+
VanillaPlacementRules.DOORS,
54+
VanillaPlacementRules.LANTERNS,
55+
VanillaPlacementRules.GLAZED_TERRACOTTA,
56+
VanillaPlacementRules.CHAINS,
57+
VanillaPlacementRules.TALL_FLOWERS,
58+
VanillaPlacementRules.SIGNS,
59+
VanillaPlacementRules.CHESTS,
60+
VanillaPlacementRules.HOPPERS,
61+
VanillaPlacementRules.SHULKERBOXES,
62+
VanillaPlacementRules.FLOOR_FLOWER,
63+
VanillaPlacementRules.CORALS,
64+
VanillaPlacementRules.WALL_CORALS,
65+
VanillaPlacementRules.HEADS,
66+
VanillaPlacementRules.SUGAR_CANE,
67+
VanillaPlacementRules.GROUNDED_PLANTS,
68+
VanillaPlacementRules.CRAFTER,
69+
VanillaPlacementRules.LEVER,
70+
VanillaPlacementRules.REDSTONE_STUFF,
71+
VanillaPlacementRules.FARMLAND,
72+
VanillaPlacementRules.SNOWY,
73+
VanillaPlacementRules.MUSHROOM,
74+
VanillaPlacementRules.RAIL,
75+
VanillaPlacementRules.FEATURE_RAIL,
76+
VanillaPlacementRules.GRINDSTONE
77+
);
78+
}
8279

83-
for (PlacementGroup placementGroup : blockGroups) {
84-
var blockGroup = placementGroup.getBlockGroup();
85-
for (var block : blockGroup.allMatching()) {
86-
count++;
87-
blockManager.registerBlockPlacementRule(placementGroup.createRule(block));
88-
}
89-
}
80+
public static void register(PlacementGroup... blockGroups) {
81+
var blockManager = MinecraftServer.getBlockManager();
82+
int count = 0;
9083

91-
logger.info("Registered {} block placement rules", count);
84+
for (PlacementGroup placementGroup : blockGroups) {
85+
var blockGroup = placementGroup.getBlockGroup();
86+
for (var block : blockGroup.allMatching()) {
87+
count++;
88+
blockManager.registerBlockPlacementRule(placementGroup.createRule(block));
89+
}
9290
}
91+
92+
logger.info("Registered {} block placement rules", count);
93+
}
9394
}

blocks/src/main/java/net/minestom/vanilla/blocks/PlacedHandlerRegistration.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@
44
import net.minestom.server.event.player.PlayerBlockPlaceEvent;
55

66
/**
7-
* This file contains code ported from Kotlin to Java, adapted from the Blocks and Stuff project.
8-
* Original source: https://github.com/everbuild-org/blocks-and-stuff
7+
* This file contains code ported from Kotlin to Java, adapted from the Blocks and Stuff project. Original source:
8+
* https://github.com/everbuild-org/blocks-and-stuff
99
* <p>
1010
* Original authors: ChrisB, AEinNico, CreepyX
1111
* <p>
1212
* Ported from Kotlin to Java and adapted for use in this project with modifications.
1313
*/
1414
public class PlacedHandlerRegistration {
1515

16-
public static void registerDefault() {
17-
MinecraftServer.getGlobalEventHandler().addListener(PlayerBlockPlaceEvent.class, event -> {
18-
var handler = MinecraftServer.getBlockManager().getHandler(event.getBlock().key().asString());
19-
if (event.getBlock().handler() != handler) {
20-
event.setBlock(event.getBlock().withHandler(handler));
21-
}
22-
});
23-
}
16+
public static void registerDefault() {
17+
MinecraftServer.getGlobalEventHandler().addListener(PlayerBlockPlaceEvent.class, event -> {
18+
var handler = MinecraftServer.getBlockManager().getHandler(event.getBlock().key().asString());
19+
if (event.getBlock().handler() != handler) {
20+
event.setBlock(event.getBlock().withHandler(handler));
21+
}
22+
});
23+
}
2424
}

0 commit comments

Comments
 (0)