Skip to content
This repository has been archived by the owner on Jul 21, 2024. It is now read-only.

Commit

Permalink
Improve custom blocks API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Redned235 authored Sep 30, 2023
1 parent 6d38276 commit cef98f4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions _docs/geyser/custom-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ public class RedstoneDot implements Extension {
public void onDefineCustomBlocks(GeyserDefineCustomBlocksEvent event) {
BoxComponent selectionBox = new BoxComponent(-5, 0, -5, 10, 1f, 10);
CustomBlockComponents components = GeyserApi.api().provider(CustomBlockComponents.Builder.class)
CustomBlockComponents components = CustomBlockComponents.builder()
.collisionBox(BoxComponent.EMPTY_BOX)
.selectionBox(selectionBox)
.geometry(new GeometryComponentBuilder()
Expand All @@ -360,7 +360,7 @@ public class RedstoneDot implements Extension {
.friction(1f)
.build();
CustomBlockData redstoneDot = GeyserApi.api().provider(CustomBlockData.Builder.class)
CustomBlockData redstoneDot = CustomBlockData.builder()
.name("redstone_dot")
.intProperty(POWER_PROPERTY, IntStream.range(0, 16).boxed().toList())
.components(components)
Expand All @@ -374,14 +374,14 @@ public class RedstoneDot implements Extension {
List<CustomBlockPermutation> permutations = new ArrayList<>();
for (int power = 0; power < 16; power++) {
String texture = "amberichu.redstone_dot" + power;
MaterialInstance invisMaterialInstance = new MaterialInstanceBuilder()
MaterialInstance invisMaterialInstance = MaterialInstance.builder()
.texture("amberichu.invisible")
.renderMethod("alpha_test")
.faceDimming(false)
.ambientOcclusion(false)
.build();
CustomBlockComponents components = GeyserApi.api().provider(CustomBlockComponents.Builder.class)
.materialInstance("up", new MaterialInstanceBuilder()
CustomBlockComponents components = CustomBlockComponents.builder()
.materialInstance("up", MaterialInstance.builder()
.texture(texture)
.renderMethod("alpha_test")
.faceDimming(false)
Expand Down Expand Up @@ -409,7 +409,7 @@ public class RedstoneDot implements Extension {
public void onDefineCustomBlocks(GeyserDefineCustomBlocksEvent event) {
BoxComponent selectionBox = new BoxComponent(-5, 0, -5, 10, 1f, 10);
CustomBlockComponents components = GeyserApi.api().provider(CustomBlockComponents.Builder.class)
CustomBlockComponents components = CustomBlockComponents.builder()
.collisionBox(BoxComponent.EMPTY_BOX)
.selectionBox(selectionBox)
.geometry(new GeometryComponentBuilder()
Expand All @@ -421,7 +421,7 @@ public class RedstoneDot implements Extension {
.friction(1f)
.build();
CustomBlockData redstoneDot = GeyserApi.api().provider(CustomBlockData.Builder.class)
CustomBlockData redstoneDot = CustomBlockData.builder()
.name("redstone_dot")
.intProperty(POWER_PROPERTY, IntStream.range(0, 16).boxed().toList())
.components(components)
Expand All @@ -443,14 +443,14 @@ public class RedstoneDot implements Extension {
List<CustomBlockPermutation> permutations = new ArrayList<>();
for (int power = 0; power < 16; power++) {
String texture = "amberichu.redstone_dot" + power;
MaterialInstance invisMaterialInstance = new MaterialInstanceBuilder()
MaterialInstance invisMaterialInstance = MaterialInstance.builder()
.texture("amberichu.invisible")
.renderMethod("alpha_test")
.faceDimming(false)
.ambientOcclusion(false)
.build();
CustomBlockComponents components = GeyserApi.api().provider(CustomBlockComponents.Builder.class)
.materialInstance("up", new MaterialInstanceBuilder()
CustomBlockComponents components = CustomBlockComponents.builder()
.materialInstance("up", MaterialInstance.builder()
.texture(texture)
.renderMethod("alpha_test")
.faceDimming(false)
Expand All @@ -468,4 +468,4 @@ public class RedstoneDot implements Extension {
return permutations;
}
}
```
```

0 comments on commit cef98f4

Please sign in to comment.