Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-19 22:40:18 +01:00
Apply some suggestions from Camotoy
Dieser Commit ist enthalten in:
Ursprung
86c822631c
Commit
a577512dac
@ -31,6 +31,6 @@ import org.geysermc.geyser.api.event.Event;
|
|||||||
|
|
||||||
public abstract class GeyserDefineCustomBlocksEvent implements Event {
|
public abstract class GeyserDefineCustomBlocksEvent implements Event {
|
||||||
|
|
||||||
public abstract boolean registerCustomBlock(@NonNull CustomBlockData customBlockData);
|
public abstract void registerCustomBlock(@NonNull CustomBlockData customBlockData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,8 @@ public final class Constants {
|
|||||||
|
|
||||||
static final String SAVED_REFRESH_TOKEN_FILE = "saved-refresh-tokens.json";
|
static final String SAVED_REFRESH_TOKEN_FILE = "saved-refresh-tokens.json";
|
||||||
|
|
||||||
|
public static final String GEYSER_NAMESPACE = "geyser:";
|
||||||
|
|
||||||
static {
|
static {
|
||||||
URI wsUri = null;
|
URI wsUri = null;
|
||||||
try {
|
try {
|
||||||
|
@ -32,6 +32,7 @@ import lombok.AccessLevel;
|
|||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Value;
|
import lombok.Value;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
|
import org.geysermc.geyser.Constants;
|
||||||
import org.geysermc.geyser.api.block.custom.CustomBlockData;
|
import org.geysermc.geyser.api.block.custom.CustomBlockData;
|
||||||
import org.geysermc.geyser.api.block.custom.CustomBlockPermutation;
|
import org.geysermc.geyser.api.block.custom.CustomBlockPermutation;
|
||||||
import org.geysermc.geyser.api.block.custom.CustomBlockState;
|
import org.geysermc.geyser.api.block.custom.CustomBlockState;
|
||||||
@ -46,8 +47,6 @@ import java.util.Map;
|
|||||||
@AllArgsConstructor(access = AccessLevel.PRIVATE)
|
@AllArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
public class GeyserCustomBlockData implements CustomBlockData {
|
public class GeyserCustomBlockData implements CustomBlockData {
|
||||||
|
|
||||||
public static final String GEYSER_NAMESPACE = "geyser:";
|
|
||||||
|
|
||||||
String name;
|
String name;
|
||||||
CustomBlockComponents components;
|
CustomBlockComponents components;
|
||||||
Map<String, CustomBlockProperty<?>> properties;
|
Map<String, CustomBlockProperty<?>> properties;
|
||||||
@ -60,7 +59,7 @@ public class GeyserCustomBlockData implements CustomBlockData {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @NonNull String identifier() {
|
public @NonNull String identifier() {
|
||||||
return GEYSER_NAMESPACE + name;
|
return Constants.GEYSER_NAMESPACE + name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -169,6 +169,11 @@ public class SkullResourcePackManager {
|
|||||||
}
|
}
|
||||||
zipOS.closeEntry();
|
zipOS.closeEntry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ZipEntry entry = new ZipEntry("skull_resource_pack/pack_icon.png");
|
||||||
|
zipOS.putNextEntry(entry);
|
||||||
|
zipOS.write(FileUtils.readAllBytes("icon.png"));
|
||||||
|
zipOS.closeEntry();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,9 +94,8 @@ public class BlockRegistryPopulator {
|
|||||||
List<CustomBlockData> customBlocks = new ArrayList<>();
|
List<CustomBlockData> customBlocks = new ArrayList<>();
|
||||||
GeyserImpl.getInstance().getEventBus().fire(new GeyserDefineCustomBlocksEvent() {
|
GeyserImpl.getInstance().getEventBus().fire(new GeyserDefineCustomBlocksEvent() {
|
||||||
@Override
|
@Override
|
||||||
public boolean registerCustomBlock(@NonNull CustomBlockData customBlockData) {
|
public void registerCustomBlock(@NonNull CustomBlockData customBlockData) {
|
||||||
customBlocks.add(customBlockData);
|
customBlocks.add(customBlockData);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Binäre Datei nicht angezeigt.
Vorher Breite: | Höhe: | Größe: 35 KiB |
@ -8,5 +8,4 @@ skull_resource_pack/models/blocks/player_skull_floor_d.geo.json
|
|||||||
skull_resource_pack/models/blocks/player_skull_hand.geo.json
|
skull_resource_pack/models/blocks/player_skull_hand.geo.json
|
||||||
skull_resource_pack/models/blocks/player_skull_wall.geo.json
|
skull_resource_pack/models/blocks/player_skull_wall.geo.json
|
||||||
skull_resource_pack/textures/terrain_texture.json
|
skull_resource_pack/textures/terrain_texture.json
|
||||||
skull_resource_pack/pack_icon.png
|
|
||||||
skull_resource_pack/manifest.json
|
skull_resource_pack/manifest.json
|
||||||
|
Vorher Breite: | Höhe: | Größe: 113 KiB Nachher Breite: | Höhe: | Größe: 113 KiB |
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren