Skip to content
iglée42 edited this page Apr 15, 2024 · 3 revisions

The KubeJs api is disabled

Introduction

Create Encased has a KubeJs integration.

For 1.19.2 & 1.20.1, events are in the form CreateCasingEvents.<event-name>(e=>{})

For 1.18.2, events are in the form onEvent('createencased.<event-name>, function(e){})

Some methods will require a CTSpriteShiftEntry So to obtain it you have two methods :

const $AllSpriteShifts = Java.loadClass("com.simibubi.create.AllSpriteShifts") //java("com.simibubi.create.AllSpriteShifts") for 1.18.2
//To get a SpriteShiftEntry :
$AllSpriteShifts.ANDESITE_CASING
//you can replace "ANDESITE_CASING" by what you want while it is in the code
//All Sprite Shift Entry can be find at https://github.com/Creators-of-Create/Create/blob/mc1.18/dev/src/main/java/com/simibubi/create/AllSpriteShifts.java
  1. Create Encased integrate a Js Util class to create your SpriteShiftEntry
const $CreateCasingUtilsJS = Java.loadClass("fr.iglee42.createcasing.compat.kubejs.CreateCasingUtilsJS")//java("fr.iglee42.createcasing.compat.kubejs.CreateCasingUtilsJS") for 1.18.2
//So to create Sprite Shift Entry use: 
$CreateCasingUtilsJS.omni("kubejs:block/<yourTextureName>")
//All Sprite Shift Entry require two texture , one is the texture which is enter in the method and the other is the texture is enter in the method + "_connected"

Casing

To Create Casing, the event is CreateCasingEvents.casing(e=>{}) (onEvent('createencased.casing',function(e){}' for 1.18.2)

The method to create a casing is e.create('<casing-name>'). There are methods after the creation to customize your casing :

connectedTexture(CTSpriteShiftEntry) Used for connected texture of casing

To finish the creation of your casing you need to add .build() at the end of your code

Clone this wiki locally