Skip to content

Commit

Permalink
Removed Painter (to be replaced with dedicated mod), added some shade…
Browse files Browse the repository at this point in the history
…r things
  • Loading branch information
LatvianModder committed Jun 15, 2024
1 parent 6979aed commit ff6df65
Show file tree
Hide file tree
Showing 55 changed files with 656 additions and 1,650 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ modrinth_id=umyGl7zF
minecraft_version=1.21
mod_version=2100.7.0

neoforge_version=21.0.6-beta
neoforge_version=21.0.8-beta
parchment_version=2024.06.02
rhino_version=2100.2.5-build.28
architectury_version=13.0.1
Expand Down
22 changes: 0 additions & 22 deletions src/main/java/dev/latvian/mods/kubejs/BuiltinKubeJSPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@
import dev.latvian.mods.kubejs.block.entity.BlockEntityAttachmentType;
import dev.latvian.mods.kubejs.block.entity.InventoryAttachment;
import dev.latvian.mods.kubejs.block.state.BlockStatePredicate;
import dev.latvian.mods.kubejs.client.painter.Painter;
import dev.latvian.mods.kubejs.client.painter.screen.AtlasTextureObject;
import dev.latvian.mods.kubejs.client.painter.screen.GradientObject;
import dev.latvian.mods.kubejs.client.painter.screen.ItemObject;
import dev.latvian.mods.kubejs.client.painter.screen.LineObject;
import dev.latvian.mods.kubejs.client.painter.screen.RectangleObject;
import dev.latvian.mods.kubejs.client.painter.screen.ScreenGroup;
import dev.latvian.mods.kubejs.client.painter.screen.TextObject;
import dev.latvian.mods.kubejs.color.Color;
import dev.latvian.mods.kubejs.core.PlayerSelector;
import dev.latvian.mods.kubejs.event.EventGroupRegistry;
Expand Down Expand Up @@ -194,8 +186,6 @@
import net.minecraft.world.level.storage.loot.providers.number.NumberProvider;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.api.distmarker.OnlyIn;
import net.neoforged.neoforge.common.NeoForge;
import net.neoforged.neoforge.common.ToolAction;
import net.neoforged.neoforge.common.crafting.SizedIngredient;
Expand Down Expand Up @@ -631,18 +621,6 @@ public void registerIngredientActionTypes(IngredientActionTypeRegistry registry)
registry.register(ReplaceAction.TYPE);
}

@Override
@OnlyIn(Dist.CLIENT)
public void painterRegistry(Painter painter) {
painter.registerObject("screen_group", ScreenGroup::new);
painter.registerObject("rectangle", RectangleObject::new);
painter.registerObject("text", TextObject::new);
painter.registerObject("atlas_texture", AtlasTextureObject::new);
painter.registerObject("gradient", GradientObject::new);
painter.registerObject("item", ItemObject::new);
painter.registerObject("line", LineObject::new);
}

@Override
public void clearCaches() {
ItemStackJS.CACHED_ITEM_MAP.forget();
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/dev/latvian/mods/kubejs/KubeJSCommon.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ public Player getClientPlayer() {
return null;
}

public void paint(CompoundTag tag) {
}

public void reloadTextures() {
}

Expand Down
7 changes: 0 additions & 7 deletions src/main/java/dev/latvian/mods/kubejs/KubeJSPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import dev.latvian.mods.kubejs.block.entity.BlockEntityAttachmentType;
import dev.latvian.mods.kubejs.client.LangKubeEvent;
import dev.latvian.mods.kubejs.client.painter.Painter;
import dev.latvian.mods.kubejs.core.RecipeManagerKJS;
import dev.latvian.mods.kubejs.event.EventGroup;
import dev.latvian.mods.kubejs.event.EventGroupRegistry;
Expand All @@ -27,8 +26,6 @@
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.crafting.RecipeHolder;
import net.minecraft.world.level.Level;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.api.distmarker.OnlyIn;

import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -82,10 +79,6 @@ default void registerBlockEntityAttachments(List<BlockEntityAttachmentType> type
default void registerIngredientActionTypes(IngredientActionTypeRegistry registry) {
}

@OnlyIn(Dist.CLIENT)
default void painterRegistry(Painter painter) {
}

default void attachServerData(AttachedData<MinecraftServer> event) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import dev.latvian.mods.kubejs.client.DebugInfoKubeEvent;
import dev.latvian.mods.kubejs.client.GenerateClientAssetsKubeEvent;
import dev.latvian.mods.kubejs.client.LangKubeEvent;
import dev.latvian.mods.kubejs.client.painter.screen.PaintScreenKubeEvent;
import dev.latvian.mods.kubejs.event.EventGroup;
import dev.latvian.mods.kubejs.event.EventHandler;
import dev.latvian.mods.kubejs.event.Extra;
Expand All @@ -25,7 +24,6 @@ public interface ClientEvents {
EventHandler PAINTER_UPDATED = GROUP.client("painterUpdated", () -> ClientKubeEvent.class);
EventHandler DEBUG_LEFT = GROUP.client("leftDebugInfo", () -> DebugInfoKubeEvent.class);
EventHandler DEBUG_RIGHT = GROUP.client("rightDebugInfo", () -> DebugInfoKubeEvent.class);
EventHandler PAINT_SCREEN = GROUP.client("paintScreen", () -> PaintScreenKubeEvent.class);
SpecializedEventHandler<ResourceLocation> ATLAS_SPRITE_REGISTRY = GROUP.client("atlasSpriteRegistry", Extra.ID, () -> AtlasSpriteRegistryKubeEvent.class).required();
SpecializedEventHandler<String> LANG = GROUP.client("lang", Extra.STRING, () -> LangKubeEvent.class).required();
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
import dev.latvian.mods.kubejs.KubeJS;
import dev.latvian.mods.kubejs.KubeJSPlugin;
import dev.latvian.mods.kubejs.bindings.event.ClientEvents;
import dev.latvian.mods.kubejs.client.painter.Painter;
import dev.latvian.mods.kubejs.event.EventGroupRegistry;
import dev.latvian.mods.kubejs.script.BindingRegistry;
import dev.latvian.mods.kubejs.script.PlatformWrapper;
import dev.latvian.mods.kubejs.script.TypeWrapperRegistry;
import dev.latvian.mods.kubejs.util.ScheduledEvents;
import dev.latvian.mods.unit.Unit;
import net.minecraft.client.Minecraft;
import net.neoforged.fml.ModList;

Expand All @@ -22,7 +19,6 @@ public void registerEvents(EventGroupRegistry registry) {
@Override
public void registerBindings(BindingRegistry bindings) {
bindings.add("Client", Minecraft.getInstance());
bindings.add("Painter", Painter.getGlobal());

if (bindings.type().isClient()) {
var se = Minecraft.getInstance().kjs$getScheduledEvents();
Expand All @@ -34,11 +30,6 @@ public void registerBindings(BindingRegistry bindings) {
}
}

@Override
public void registerTypeWrappers(TypeWrapperRegistry registry) {
registry.register(Unit.class, (ctx, from) -> Painter.getGlobal().unitOf(ctx, from));
}

@Override
public void generateLang(LangKubeEvent event) {
event.add(KubeJS.MOD_ID, "key.kubejs", "KubeJS Info");
Expand Down
Loading

0 comments on commit ff6df65

Please sign in to comment.