Apply some suggestions from Camotoy

This commit is contained in:
davchoo 2022-07-10 18:42:38 -04:00
parent 86c822631c
commit a577512dac
No known key found for this signature in database
GPG key ID: A0168C8E45799B7D
8 changed files with 11 additions and 7 deletions

View file

@ -31,6 +31,6 @@ import org.geysermc.geyser.api.event.Event;
public abstract class GeyserDefineCustomBlocksEvent implements Event {
public abstract boolean registerCustomBlock(@NonNull CustomBlockData customBlockData);
public abstract void registerCustomBlock(@NonNull CustomBlockData customBlockData);
}

View file

@ -39,6 +39,8 @@ public final class Constants {
static final String SAVED_REFRESH_TOKEN_FILE = "saved-refresh-tokens.json";
public static final String GEYSER_NAMESPACE = "geyser:";
static {
URI wsUri = null;
try {

View file

@ -32,6 +32,7 @@ import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Value;
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.CustomBlockPermutation;
import org.geysermc.geyser.api.block.custom.CustomBlockState;
@ -46,8 +47,6 @@ import java.util.Map;
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public class GeyserCustomBlockData implements CustomBlockData {
public static final String GEYSER_NAMESPACE = "geyser:";
String name;
CustomBlockComponents components;
Map<String, CustomBlockProperty<?>> properties;
@ -60,7 +59,7 @@ public class GeyserCustomBlockData implements CustomBlockData {
@Override
public @NonNull String identifier() {
return GEYSER_NAMESPACE + name;
return Constants.GEYSER_NAMESPACE + name;
}
@Override

View file

@ -169,6 +169,11 @@ public class SkullResourcePackManager {
}
zipOS.closeEntry();
}
ZipEntry entry = new ZipEntry("skull_resource_pack/pack_icon.png");
zipOS.putNextEntry(entry);
zipOS.write(FileUtils.readAllBytes("icon.png"));
zipOS.closeEntry();
}
}

View file

@ -94,9 +94,8 @@ public class BlockRegistryPopulator {
List<CustomBlockData> customBlocks = new ArrayList<>();
GeyserImpl.getInstance().getEventBus().fire(new GeyserDefineCustomBlocksEvent() {
@Override
public boolean registerCustomBlock(@NonNull CustomBlockData customBlockData) {
public void registerCustomBlock(@NonNull CustomBlockData customBlockData) {
customBlocks.add(customBlockData);
return true;
}
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

View file

@ -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_wall.geo.json
skull_resource_pack/textures/terrain_texture.json
skull_resource_pack/pack_icon.png
skull_resource_pack/manifest.json

View file

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 113 KiB