-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated rhino, added ServerEvents.modifyRecipeResult replacing callba…
…ck function in recipe with ID
- Loading branch information
1 parent
8367c89
commit 37dcf00
Showing
63 changed files
with
371 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/main/java/dev/latvian/mods/kubejs/core/EnchantmentKJS.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package dev.latvian.mods.kubejs.core; | ||
|
||
import dev.latvian.mods.kubejs.registry.RegistryInfo; | ||
import dev.latvian.mods.rhino.util.RemapPrefixForJS; | ||
import net.minecraft.world.item.enchantment.Enchantment; | ||
|
||
@RemapPrefixForJS("kjs$") | ||
public interface EnchantmentKJS extends RegistryObjectKJS<Enchantment> { | ||
@Override | ||
default RegistryInfo<Enchantment> kjs$getKubeRegistry() { | ||
return RegistryInfo.ENCHANTMENT; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/main/java/dev/latvian/mods/kubejs/core/mixin/EnchantmentMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package dev.latvian.mods.kubejs.core.mixin; | ||
|
||
import dev.latvian.mods.kubejs.core.EnchantmentKJS; | ||
import net.minecraft.core.Holder; | ||
import net.minecraft.resources.ResourceKey; | ||
import net.minecraft.world.item.enchantment.Enchantment; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.Unique; | ||
|
||
@Mixin(Enchantment.class) | ||
public abstract class EnchantmentMixin implements EnchantmentKJS { | ||
@Shadow | ||
@Final | ||
private Holder.Reference<Enchantment> builtInRegistryHolder; | ||
|
||
@Unique | ||
private ResourceKey<Enchantment> kjs$registryKey; | ||
|
||
@Unique | ||
private String kjs$id; | ||
|
||
@Override | ||
public Holder<Enchantment> kjs$asHolder() { | ||
return builtInRegistryHolder; | ||
} | ||
|
||
@Override | ||
public ResourceKey<Enchantment> kjs$getRegistryKey() { | ||
if (kjs$registryKey == null) { | ||
kjs$registryKey = EnchantmentKJS.super.kjs$getRegistryKey(); | ||
} | ||
|
||
return kjs$registryKey; | ||
} | ||
|
||
@Override | ||
public String kjs$getId() { | ||
if (kjs$id == null) { | ||
kjs$id = EnchantmentKJS.super.kjs$getId(); | ||
} | ||
|
||
return kjs$id; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.