Skip to content

Commit

Permalink
Finish choose screen, modded entries
Browse files Browse the repository at this point in the history
  • Loading branch information
Dueris committed Nov 9, 2024
1 parent 058e285 commit 556f3dc
Show file tree
Hide file tree
Showing 45 changed files with 1,110 additions and 498 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
id("io.papermc.paperweight.userdev") version "1.7.3" apply true
id("xyz.jpenilla.run-paper") version "2.2.3"
id("com.gradleup.shadow") version "8.3.3" apply true
id("io.github.dueris.eclipse.gradle") version "1.1.0-beta75" apply true
id("io.github.dueris.eclipse.gradle") version "1.1.0-beta82" apply true
}

val paperweightVersion: String = "1.21-R0.1-SNAPSHOT"
Expand Down
3 changes: 2 additions & 1 deletion calio/src/main/resources/calio.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"ReloadableServerResourcesMixin",
"ShufflingListAccessor",
"TagEntryAccessor"
]
],
"compatibilityLevel": "JAVA_21"
}
Binary file not shown.
2 changes: 1 addition & 1 deletion origins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies {
implementation("org.mineskin:java-client-jsoup:2.0.0-SNAPSHOT")
compileOnly("com.jeff-media:MorePersistentDataTypes:2.4.0") // - in DependencyLoader

compileOnly(files("../depends/eclipse.jar")) // Dependency
compileOnly(files("../depends/eclipse-1.3.2-all.jar")) // Dependency

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.papermc.paper.plugin.bootstrap.BootstrapContext;
import io.papermc.paper.plugin.bootstrap.PluginBootstrap;
import me.dueris.eclipse.ignite.IgniteBootstrap;
import org.jetbrains.annotations.NotNull;

@SuppressWarnings("UnstableApiUsage")
Expand All @@ -10,7 +11,8 @@ public class Bootstrap implements PluginBootstrap {
@Override
public void bootstrap(@NotNull BootstrapContext bootContext) {
try {
OriginsPaper.init(bootContext);
if (!IgniteBootstrap.BOOTED.get()) return;
OriginsPaper.bootstrap(bootContext);
} catch (Throwable e) {
throw new RuntimeException("An error occurred when loading OriginsPaper!", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import io.github.dueris.originspaper.command.PowerCommand;
import io.github.dueris.originspaper.command.ResourceCommand;
import io.github.dueris.originspaper.condition.type.*;
import io.github.dueris.originspaper.entity.EnderianPearlEntity;
import io.github.dueris.originspaper.content.entity.EnderianPearlEntity;
import io.github.dueris.originspaper.global.GlobalPowerSetManager;
import io.github.dueris.originspaper.loot.condition.ApoliLootConditionTypes;
import io.github.dueris.originspaper.loot.function.ApoliLootFunctionTypes;
Expand All @@ -20,6 +20,9 @@
import io.github.dueris.originspaper.power.PowerManager;
import io.github.dueris.originspaper.power.type.PowerTypes;
import io.github.dueris.originspaper.registry.ApoliClassData;
import io.github.dueris.originspaper.registry.ModBlocks;
import io.github.dueris.originspaper.registry.ModItems;
import io.github.dueris.originspaper.registry.ModTags;
import io.github.dueris.originspaper.util.fabric.resource.FabricResourceManagerImpl;
import io.github.dueris.originspaper.util.modifier.ModifierOperations;
import io.papermc.paper.command.brigadier.PaperCommands;
Expand Down Expand Up @@ -62,7 +65,7 @@ public static OriginsPlugin getPlugin() {
return OriginsPlugin.plugin;
}

public static void init(@NotNull BootstrapContext context) throws Throwable {
public static void bootstrap(@NotNull BootstrapContext context) throws Throwable {
jarFile = context.getPluginSource();
OriginsPaper.bootContext = context;
PluginInstances.init();
Expand All @@ -76,40 +79,48 @@ public static void init(@NotNull BootstrapContext context) throws Throwable {
contextCommands.register(PluginInstances.APOLI_META, ResourceCommand.node(), null, new ArrayList<>());
contextCommands.register(context.getPluginMeta(), OriginCommand.node(), null, new ArrayList<>());
}).priority(1));
EnderianPearlEntity.bootstrap();

reload();
init();
}

public static void reload() throws Throwable {
OriginConfiguration.load();
showCommandOutput = OriginConfiguration.getConfiguration().getBoolean("show-command-output", false);
LANGUAGE = OriginConfiguration.getConfiguration().getString("language", LANGUAGE);
ApoliLootConditionTypes.register();
ApoliLootFunctionTypes.register();
ApoliClassData.registerAll();

ModifierOperations.register();
PowerTypes.register();
EntityConditionTypes.register();
BiEntityConditionTypes.register();
ItemConditionTypes.register();
BlockConditionTypes.register();
DamageConditionTypes.register();
FluidConditionTypes.register();
BiomeConditionTypes.register();
EntityActionTypes.register();
ItemActionTypes.register();
BlockActionTypes.register();
BiEntityActionTypes.register();

FabricResourceManagerImpl.registerResourceReload(new PowerManager());
FabricResourceManagerImpl.registerResourceReload(new GlobalPowerSetManager());
FabricResourceManagerImpl.registerResourceReload(new OriginManager());
FabricResourceManagerImpl.registerResourceReload(new OriginLayerManager());
IdentifierAlias.GLOBAL.addNamespaceAlias("apoli", "calio");
IdentifierAlias.GLOBAL.addNamespaceAlias("origins", "apoli");
LOGGER.info("OriginsPaper, version {}, is initialized and ready to power up your game!", version);
private static void init() {
try {
OriginConfiguration.load();
showCommandOutput = OriginConfiguration.getConfiguration().getBoolean("show-command-output", false);
LANGUAGE = OriginConfiguration.getConfiguration().getString("language", LANGUAGE);
ApoliLootConditionTypes.register();
ApoliLootFunctionTypes.register();
ApoliClassData.registerAll();

ModifierOperations.register();
PowerTypes.register();
EntityConditionTypes.register();
BiEntityConditionTypes.register();
ItemConditionTypes.register();
BlockConditionTypes.register();
DamageConditionTypes.register();
FluidConditionTypes.register();
BiomeConditionTypes.register();
EntityActionTypes.register();
ItemActionTypes.register();
BlockActionTypes.register();
BiEntityActionTypes.register();

FabricResourceManagerImpl.registerResourceReload(new PowerManager());
FabricResourceManagerImpl.registerResourceReload(new GlobalPowerSetManager());
FabricResourceManagerImpl.registerResourceReload(new OriginManager());
FabricResourceManagerImpl.registerResourceReload(new OriginLayerManager());
IdentifierAlias.GLOBAL.addNamespaceAlias("apoli", "calio");
IdentifierAlias.GLOBAL.addNamespaceAlias("origins", "apoli");

ModBlocks.register();
ModTags.register();
ModItems.register();
EnderianPearlEntity.bootstrap();
LOGGER.info("OriginsPaper, version {}, is initialized and ready to power up your game!", version);
} catch (Throwable throwable) {
LOGGER.error("Unable to start OriginsPaper!", throwable);
}
}

public static class OriginConfiguration {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package io.github.dueris.originspaper.access;

public interface ThrownEnderianPearlEntity {
void originspaper$setEnderianPearl();
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static void action(Level world, BlockPos pos, EntityType<?> entityType, C
return;
}

Entity entityToSpawn = Util.getEntityWithPassengers(
Entity entityToSpawn = Util.getEntityWithPassengersSafe(
serverWorld,
entityType,
entityNbt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static void action(Entity entity, EntityType<?> entityType, Consumer<Enti
for (int i = 0; i < count; i++) {

Entity entityToSpawn = Util
.getEntityWithPassengers(serverWorld, entityType, entityNbt, verticalOffset, yaw, pitch)
.getEntityWithPassengersSafe(serverWorld, entityType, entityNbt, verticalOffset, yaw, pitch)
.orElse(null);

if (entityToSpawn == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static void action(Entity entity, EntityType<?> entityType, Consumer<Enti
return;
}

Entity entityToSpawn = Util.getEntityWithPassengers(
Entity entityToSpawn = Util.getEntityWithPassengersSafe(
serverWorld,
entityType,
entityNbt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public Component makeIconPixels(@NotNull BufferedImage image) {
for (int x = 0; x < 8; ++x) {
for (int y = 0; y < 8; ++y) {
int col = iconImage.getRGB(x, y);
if (col == 0) {
if ((new Color(col, true)).getAlpha() < 255) {
icon = icon.append(Component.text("\uf002"));
} else {
icon = icon.append(Component.text(pixels.charAt(y)).color(TextColor.color(col)));
Expand Down
Loading

0 comments on commit 556f3dc

Please sign in to comment.