mirror of
https://github.com/GeyserMC/Geyser.git
synced 2026-01-04 15:31:36 +00:00
API 2.9.1: Support 1.21.124, add tint/isotropic method to custom block material, allowing updating entity properties immediately (#5991)
* Prepare for 1.21.124 * Add tint method and isotropic properties to block material instances (#5977) * Add tint method and isotropic properties to block material instances * Check if tint method is null before including it * Lets cover the null check on render method too * Allow updating properties immediately (#5961) --------- Co-authored-by: rtm516 <rtm516@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
|
||||
* Copyright (c) 2019-2025 GeyserMC. http://geysermc.org
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -46,6 +46,13 @@ public interface MaterialInstance {
|
||||
*/
|
||||
@Nullable String renderMethod();
|
||||
|
||||
/**
|
||||
* Gets the tint method of the block
|
||||
*
|
||||
* @return The tint method of the block.
|
||||
*/
|
||||
@Nullable String tintMethod();
|
||||
|
||||
/**
|
||||
* Gets if the block should be dimmed on certain faces
|
||||
*
|
||||
@@ -60,6 +67,13 @@ public interface MaterialInstance {
|
||||
*/
|
||||
boolean ambientOcclusion();
|
||||
|
||||
/**
|
||||
* Gets if the block is isotropic
|
||||
*
|
||||
* @return If the block is isotropic.
|
||||
*/
|
||||
boolean isotropic();
|
||||
|
||||
/**
|
||||
* Creates a builder for MaterialInstance.
|
||||
*
|
||||
@@ -74,10 +88,14 @@ public interface MaterialInstance {
|
||||
|
||||
Builder renderMethod(@Nullable String renderMethod);
|
||||
|
||||
Builder tintMethod(@Nullable String tintMethod);
|
||||
|
||||
Builder faceDimming(boolean faceDimming);
|
||||
|
||||
Builder ambientOcclusion(boolean ambientOcclusion);
|
||||
|
||||
Builder isotropic(boolean isotropic);
|
||||
|
||||
MaterialInstance build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,23 @@ public interface GeyserEntity {
|
||||
/**
|
||||
* Updates multiple properties with just one update packet.
|
||||
* @see BatchPropertyUpdater
|
||||
*
|
||||
* @param consumer a batch updater
|
||||
* @since 2.9.0
|
||||
*/
|
||||
void updatePropertiesBatched(Consumer<BatchPropertyUpdater> consumer);
|
||||
default void updatePropertiesBatched(Consumer<BatchPropertyUpdater> consumer) {
|
||||
this.updatePropertiesBatched(consumer, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates multiple properties with just one update packet, which can be sent immediately to the client.
|
||||
* Usually, sending updates immediately is not required except for specific situations where packet batching
|
||||
* would result in update order issues.
|
||||
* @see BatchPropertyUpdater
|
||||
*
|
||||
* @param consumer a batch updater
|
||||
* @param immediate whether this update should be sent immediately
|
||||
* @since 2.9.1
|
||||
*/
|
||||
void updatePropertiesBatched(Consumer<BatchPropertyUpdater> consumer, boolean immediate);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user