Improve custom blocks API docs
This commit is contained in:
1 parent
6d382761b3
commit
cef98f46b3
1 file changed
+10
-10
@@ -348,7 +348,7 @@ public class RedstoneDot implements Extension {
|
|||||||
public void onDefineCustomBlocks(GeyserDefineCustomBlocksEvent event) {
|
public void onDefineCustomBlocks(GeyserDefineCustomBlocksEvent event) {
|
||||||
BoxComponent selectionBox = new BoxComponent(-5, 0, -5, 10, 1f, 10);
|
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)
|
.collisionBox(BoxComponent.EMPTY_BOX)
|
||||||
.selectionBox(selectionBox)
|
.selectionBox(selectionBox)
|
||||||
.geometry(new GeometryComponentBuilder()
|
.geometry(new GeometryComponentBuilder()
|
||||||
@@ -360,7 +360,7 @@ public class RedstoneDot implements Extension {
|
|||||||
.friction(1f)
|
.friction(1f)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
CustomBlockData redstoneDot = GeyserApi.api().provider(CustomBlockData.Builder.class)
|
CustomBlockData redstoneDot = CustomBlockData.builder()
|
||||||
.name("redstone_dot")
|
.name("redstone_dot")
|
||||||
.intProperty(POWER_PROPERTY, IntStream.range(0, 16).boxed().toList())
|
.intProperty(POWER_PROPERTY, IntStream.range(0, 16).boxed().toList())
|
||||||
.components(components)
|
.components(components)
|
||||||
@@ -374,14 +374,14 @@ public class RedstoneDot implements Extension {
|
|||||||
List<CustomBlockPermutation> permutations = new ArrayList<>();
|
List<CustomBlockPermutation> permutations = new ArrayList<>();
|
||||||
for (int power = 0; power < 16; power++) {
|
for (int power = 0; power < 16; power++) {
|
||||||
String texture = "amberichu.redstone_dot" + power;
|
String texture = "amberichu.redstone_dot" + power;
|
||||||
MaterialInstance invisMaterialInstance = new MaterialInstanceBuilder()
|
MaterialInstance invisMaterialInstance = MaterialInstance.builder()
|
||||||
.texture("amberichu.invisible")
|
.texture("amberichu.invisible")
|
||||||
.renderMethod("alpha_test")
|
.renderMethod("alpha_test")
|
||||||
.faceDimming(false)
|
.faceDimming(false)
|
||||||
.ambientOcclusion(false)
|
.ambientOcclusion(false)
|
||||||
.build();
|
.build();
|
||||||
CustomBlockComponents components = GeyserApi.api().provider(CustomBlockComponents.Builder.class)
|
CustomBlockComponents components = CustomBlockComponents.builder()
|
||||||
.materialInstance("up", new MaterialInstanceBuilder()
|
.materialInstance("up", MaterialInstance.builder()
|
||||||
.texture(texture)
|
.texture(texture)
|
||||||
.renderMethod("alpha_test")
|
.renderMethod("alpha_test")
|
||||||
.faceDimming(false)
|
.faceDimming(false)
|
||||||
@@ -409,7 +409,7 @@ public class RedstoneDot implements Extension {
|
|||||||
public void onDefineCustomBlocks(GeyserDefineCustomBlocksEvent event) {
|
public void onDefineCustomBlocks(GeyserDefineCustomBlocksEvent event) {
|
||||||
BoxComponent selectionBox = new BoxComponent(-5, 0, -5, 10, 1f, 10);
|
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)
|
.collisionBox(BoxComponent.EMPTY_BOX)
|
||||||
.selectionBox(selectionBox)
|
.selectionBox(selectionBox)
|
||||||
.geometry(new GeometryComponentBuilder()
|
.geometry(new GeometryComponentBuilder()
|
||||||
@@ -421,7 +421,7 @@ public class RedstoneDot implements Extension {
|
|||||||
.friction(1f)
|
.friction(1f)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
CustomBlockData redstoneDot = GeyserApi.api().provider(CustomBlockData.Builder.class)
|
CustomBlockData redstoneDot = CustomBlockData.builder()
|
||||||
.name("redstone_dot")
|
.name("redstone_dot")
|
||||||
.intProperty(POWER_PROPERTY, IntStream.range(0, 16).boxed().toList())
|
.intProperty(POWER_PROPERTY, IntStream.range(0, 16).boxed().toList())
|
||||||
.components(components)
|
.components(components)
|
||||||
@@ -443,14 +443,14 @@ public class RedstoneDot implements Extension {
|
|||||||
List<CustomBlockPermutation> permutations = new ArrayList<>();
|
List<CustomBlockPermutation> permutations = new ArrayList<>();
|
||||||
for (int power = 0; power < 16; power++) {
|
for (int power = 0; power < 16; power++) {
|
||||||
String texture = "amberichu.redstone_dot" + power;
|
String texture = "amberichu.redstone_dot" + power;
|
||||||
MaterialInstance invisMaterialInstance = new MaterialInstanceBuilder()
|
MaterialInstance invisMaterialInstance = MaterialInstance.builder()
|
||||||
.texture("amberichu.invisible")
|
.texture("amberichu.invisible")
|
||||||
.renderMethod("alpha_test")
|
.renderMethod("alpha_test")
|
||||||
.faceDimming(false)
|
.faceDimming(false)
|
||||||
.ambientOcclusion(false)
|
.ambientOcclusion(false)
|
||||||
.build();
|
.build();
|
||||||
CustomBlockComponents components = GeyserApi.api().provider(CustomBlockComponents.Builder.class)
|
CustomBlockComponents components = CustomBlockComponents.builder()
|
||||||
.materialInstance("up", new MaterialInstanceBuilder()
|
.materialInstance("up", MaterialInstance.builder()
|
||||||
.texture(texture)
|
.texture(texture)
|
||||||
.renderMethod("alpha_test")
|
.renderMethod("alpha_test")
|
||||||
.faceDimming(false)
|
.faceDimming(false)
|
||||||
|
|||||||
Reference in new issue
Block a user