├── src └── main │ ├── resources │ ├── META-INF │ │ └── randomtweaker_at.cfg │ ├── pack.mcmeta │ ├── assets │ │ ├── base │ │ │ └── models │ │ │ │ └── item │ │ │ │ └── wrench.json │ │ └── randomtweaker │ │ │ ├── textures │ │ │ └── gui │ │ │ │ └── jei │ │ │ │ ├── hydroangeas.png │ │ │ │ ├── jei_default.png │ │ │ │ └── altarattunement.png │ │ │ └── lang │ │ │ ├── zh_cn.lang │ │ │ └── en_us.lang │ ├── mcmod.info │ └── mixins.randomtweaker.mods.json │ └── java │ └── ink │ └── ikx │ └── rt │ ├── impl │ ├── internal │ │ ├── event │ │ │ ├── BaseEvent.java │ │ │ ├── EventHandler.java │ │ │ ├── EventRegister.java │ │ │ └── FTBUltimineEvent.java │ │ ├── core │ │ │ ├── MixinInit.java │ │ │ └── CoreModBoot.java │ │ ├── proxy │ │ │ ├── IProxy.java │ │ │ ├── ServerProxy.java │ │ │ └── ClientProxy.java │ │ ├── utils │ │ │ ├── MCTileData.java │ │ │ ├── ItemStackList.java │ │ │ └── MCInputPattern.java │ │ └── network │ │ │ └── NetworkManager.java │ ├── mods │ │ ├── jei │ │ │ ├── impl │ │ │ │ ├── core │ │ │ │ │ └── MCJeiBackground.java │ │ │ │ ├── elemenet │ │ │ │ │ ├── MCJeiElementLiquid.java │ │ │ │ │ ├── MCJeiElementManaBar.java │ │ │ │ │ └── MCJeiElementArrow.java │ │ │ │ └── MCJeiSlots.java │ │ │ ├── recipe │ │ │ │ └── JEIAttunementRecipe.java │ │ │ ├── JeiAttunements.java │ │ │ └── JeiPlugin.java │ │ ├── botania │ │ │ ├── cocoon │ │ │ │ └── IMixinTileCocoon.java │ │ │ ├── event │ │ │ │ ├── AbstractClassImplement.java │ │ │ │ ├── ElvenTradeEvent.java │ │ │ │ ├── AlfPortalDroppedEvent.java │ │ │ │ └── PoolTradeEvent.java │ │ │ └── module │ │ │ │ ├── SubTileOrechidManager.java │ │ │ │ └── SubTileHydroangeasManager.java │ │ ├── contenttweaker │ │ │ ├── mana │ │ │ │ ├── bauble │ │ │ │ │ ├── MCManaTrinketContent.java │ │ │ │ │ ├── MCManaBaubleRepresentation.java │ │ │ │ │ └── MCManaBauble.java │ │ │ │ └── item │ │ │ │ │ ├── MCManaItemRepresentation.java │ │ │ │ │ └── tool │ │ │ │ │ ├── MCIsUsesManaItemRepresentation.java │ │ │ │ │ └── MCIsUsesManaItemContent.java │ │ │ ├── aspect │ │ │ │ └── MCAspectRepresentation.java │ │ │ ├── potion │ │ │ │ ├── MCPotionRepresentation.java │ │ │ │ └── MCPotionTypeRepresentation.java │ │ │ └── subtile │ │ │ │ └── MCSubTileEntityRepresentation.java │ │ ├── astralsorcery │ │ │ ├── event │ │ │ │ ├── AbstractClassImplement.java │ │ │ │ ├── AttunementStartEvent.java │ │ │ │ └── AttunementRecipeCompleteEvent.java │ │ │ └── CustomAttunementRecipe.java │ │ ├── thaumcraft │ │ │ ├── MCAspect.java │ │ │ └── DreamJournalEvent.java │ │ ├── naturesaura │ │ │ └── MCAuraChunk.java │ │ └── crafttweaker │ │ │ ├── CraftTweakerExtension.java │ │ │ └── brackethandler │ │ │ ├── BracketHandlerJei.java │ │ │ └── BracketHandlerPotion.java │ └── vanilla │ │ └── ItemAttributeModificationEvent.java │ ├── api │ ├── mods │ │ ├── jei │ │ │ ├── core │ │ │ │ ├── IJeiTooltip.java │ │ │ │ ├── IJeiBackground.java │ │ │ │ ├── IJeiRecipe.java │ │ │ │ └── IJeiPanel.java │ │ │ ├── slots │ │ │ │ ├── IJeiSlotItem.java │ │ │ │ ├── IJeiSlot.java │ │ │ │ └── IJeiSlotLiquid.java │ │ │ ├── IJeiUtilsWithBotania.java │ │ │ ├── JEIExpansion.java │ │ │ └── elements │ │ │ │ └── IJeiElement.java │ │ ├── contenttweaker │ │ │ ├── function │ │ │ │ ├── IPotionIsReady.java │ │ │ │ ├── mana │ │ │ │ │ ├── IGetBaubleType.java │ │ │ │ │ ├── IisUsesMana.java │ │ │ │ │ ├── IManaWithItem.java │ │ │ │ │ ├── IGetEntityLifeSpan.java │ │ │ │ │ ├── IBaubleFunction.java │ │ │ │ │ ├── IBaubleRender.java │ │ │ │ │ ├── IBaubleFunctionWithReturn.java │ │ │ │ │ └── IManaWithPool.java │ │ │ │ ├── IPotionPerformEffect.java │ │ │ │ └── subtile │ │ │ │ │ ├── PopulateDropStackNBTs.java │ │ │ │ │ ├── CanGeneratePassively.java │ │ │ │ │ ├── Update.java │ │ │ │ │ ├── BlockAdded.java │ │ │ │ │ ├── CanSelect.java │ │ │ │ │ ├── BlockHarvested.java │ │ │ │ │ ├── BlockPlacedBy.java │ │ │ │ │ └── BlockActivated.java │ │ │ ├── mana │ │ │ │ ├── IManaBauble.java │ │ │ │ ├── item │ │ │ │ │ └── tool │ │ │ │ │ │ └── IIsUsesManaItemRepresentation.java │ │ │ │ ├── IManaItem.java │ │ │ │ ├── bauble │ │ │ │ │ └── IManaBaubleRepresentation.java │ │ │ │ └── IManaHelper.java │ │ │ ├── ExpandVanillaFactoryWithThaumcraft.java │ │ │ ├── potion │ │ │ │ ├── IPotionTypeRepresentation.java │ │ │ │ └── IPotionRepresentation.java │ │ │ ├── subtile │ │ │ │ ├── functional │ │ │ │ │ └── ISubTileEntityFunctionalRepresentation.java │ │ │ │ ├── ExpandWorldForSubTile.java │ │ │ │ ├── generating │ │ │ │ │ └── ISubTileEntityGeneratingRepresentation.java │ │ │ │ ├── ISubTileEntityInGame.java │ │ │ │ └── ISubTileEntityRepresentation.java │ │ │ ├── ExpandVanillaFactory.java │ │ │ ├── render │ │ │ │ └── IBaubleRenderHelper.java │ │ │ ├── aspect │ │ │ │ └── IAspectRepresentation.java │ │ │ └── ExpandVanillaFactoryWithBotania.java │ │ ├── botania │ │ │ ├── function │ │ │ │ ├── DynamicSpawnTable.java │ │ │ │ └── ICocoonTileEntity.java │ │ │ ├── ITileAlfPortal.java │ │ │ ├── event │ │ │ │ ├── CTElvenTradeEvent.java │ │ │ │ ├── CTAlfPortalDroppedEvent.java │ │ │ │ ├── CTEventManager.java │ │ │ │ └── CTPoolTradeEvent.java │ │ │ └── render │ │ │ │ └── IBotaniaFXHelper.java │ │ ├── modtweaker │ │ │ └── ExpandCTAspect.java │ │ ├── naturesaura │ │ │ ├── IAuraChunk.java │ │ │ └── IWorldExpansionNa.java │ │ ├── thaumcraft │ │ │ ├── expand │ │ │ │ ├── ExpandIItemStack.java │ │ │ │ ├── ExpandIEntity.java │ │ │ │ ├── ExpandIAspect.java │ │ │ │ ├── ExpandIAspectList.java │ │ │ │ └── ExpandIPlayer.java │ │ │ ├── IAspect.java │ │ │ └── IAspectList.java │ │ ├── draconicevolution │ │ │ └── IDraconicEvolutionFXHelper.java │ │ ├── astralsorcery │ │ │ └── event │ │ │ │ ├── CTAttunementStartEvent.java │ │ │ │ └── CTEventManagerAS.java │ │ └── ftbultimine │ │ │ └── IPlayerExpansionFTBU.java │ ├── internal │ │ ├── item │ │ │ └── IItemStackExpansion.java │ │ ├── utils │ │ │ ├── IInputPattern.java │ │ │ └── ITileData.java │ │ └── world │ │ │ └── IBlockPosExpansion.java │ └── vanilla │ │ ├── IItemAttributeModificationEvent.java │ │ ├── CTEventHandler.java │ │ └── AttributeModificationListeners.java │ ├── classTransforms │ ├── vanilla │ │ ├── Hooks.java │ │ └── ASMBreakableEnchantmentType.java │ ├── RandomTweakerClassWriter.java │ └── mods │ │ └── tconstruct │ │ └── AbstractMaterialSectionTransformerHooks.java │ └── mixins │ ├── ftbultimine │ ├── MixinFTBUltimineClient.java │ └── MixinFTBUltimine.java │ ├── tconstruct │ └── MixinContentMaterial.java │ └── botania │ ├── MixinBotaniaAPI.java │ ├── MixinBlockSpecialFlower.java │ ├── MixinTilePool.java │ └── MixinBlockCocoon.java ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── libs └── CraftTweaker2-MC1120-Mod-JEI-1.12-4.1.20.670-deobf.jar ├── .gitignore ├── settings.gradle ├── gradle.properties ├── LICENSE ├── README.md └── gradlew.bat /src/main/resources/META-INF/randomtweaker_at.cfg: -------------------------------------------------------------------------------- 1 | public net.minecraft.entity.item.EntityItem field_70292_b # age -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-RT/RandomTweaker/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "RandomTweaker Resources", 4 | "pack_format": 3 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/base/models/item/wrench.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "base:items/wrench" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /libs/CraftTweaker2-MC1120-Mod-JEI-1.12-4.1.20.670-deobf.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-RT/RandomTweaker/HEAD/libs/CraftTweaker2-MC1120-Mod-JEI-1.12-4.1.20.670-deobf.jar -------------------------------------------------------------------------------- /src/main/resources/assets/randomtweaker/textures/gui/jei/hydroangeas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-RT/RandomTweaker/HEAD/src/main/resources/assets/randomtweaker/textures/gui/jei/hydroangeas.png -------------------------------------------------------------------------------- /src/main/resources/assets/randomtweaker/textures/gui/jei/jei_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-RT/RandomTweaker/HEAD/src/main/resources/assets/randomtweaker/textures/gui/jei/jei_default.png -------------------------------------------------------------------------------- /src/main/resources/assets/randomtweaker/textures/gui/jei/altarattunement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-RT/RandomTweaker/HEAD/src/main/resources/assets/randomtweaker/textures/gui/jei/altarattunement.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # eclipse 2 | bin 3 | *.launch 4 | .settings 5 | .metadata 6 | .classpath 7 | .project 8 | 9 | # idea 10 | out 11 | *.ipr 12 | *.iws 13 | *.iml 14 | .idea 15 | 16 | # gradle 17 | build 18 | .gradle 19 | 20 | # other 21 | eclipse 22 | run 23 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip 4 | networkTimeout=10000 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/internal/event/BaseEvent.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.internal.event; 2 | 3 | import net.minecraftforge.common.MinecraftForge; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | public class BaseEvent extends Event { 7 | 8 | public boolean post() { 9 | return MinecraftForge.EVENT_BUS.post(this); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/resources/assets/randomtweaker/lang/zh_cn.lang: -------------------------------------------------------------------------------- 1 | randomtweaker.jei_hydroangeas=水绣球 2 | randomtweaker.jei_orechid=凝矿兰 3 | 4 | text.randomtweaker.hydroangeas_factorblock_description=该方块可增加水绣球的魔力产出。 5 | text.randomtweaker.factor=倍数: 6 | 7 | text.randomtweaker.attunement_constellation=需要与此星座共鸣: 8 | text.randomtweaker.attunement_any_constellation=任何星座都可共鸣。 9 | 10 | randomtweaker.jei_attunements=共鸣祭坛 11 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/jei/core/IJeiTooltip.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.jei.core; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | 5 | import stanhebben.zenscript.annotations.ZenClass; 6 | 7 | 8 | @SidedZenRegister(modDeps = "jei") 9 | @FunctionalInterface 10 | @ZenClass("mods.randomtweaker.jei.IJeiTooltip") 11 | public interface IJeiTooltip { 12 | 13 | String[] action(int mouseX, int mouseY); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/internal/core/MixinInit.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.internal.core; 2 | 3 | import zone.rong.mixinbooter.ILateMixinLoader; 4 | 5 | import java.util.Collections; 6 | import java.util.List; 7 | 8 | public class MixinInit implements ILateMixinLoader { 9 | 10 | @Override 11 | public List getMixinConfigs() { 12 | return Collections.singletonList("mixins.randomtweaker.mods.json"); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/resources/mcmod.info: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "modid": "randomtweaker", 4 | "name": "RandomTweaker", 5 | "description": "Random Tweaker", 6 | "version": "${version}", 7 | "mcversion": "${mcversion}", 8 | "url": "", 9 | "updateUrl": "", 10 | "authorList": [ 11 | "ikexing", 12 | "superhelo" 13 | ], 14 | "credits": "", 15 | "logoFile": "", 16 | "screenshots": [], 17 | "dependencies": [] 18 | } 19 | ] 20 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/function/IPotionIsReady.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.function; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | 5 | import stanhebben.zenscript.annotations.ZenClass; 6 | 7 | 8 | @FunctionalInterface 9 | @SidedZenRegister(modDeps = "contenttweaker") 10 | @ZenClass("mods.randomtweaker.cote.IPotionIsReady") 11 | public interface IPotionIsReady { 12 | 13 | boolean call(int duration, int amplifier); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/jei/impl/core/MCJeiBackground.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.jei.impl.core; 2 | 3 | import ink.ikx.rt.api.mods.jei.core.IJeiBackground; 4 | 5 | public class MCJeiBackground extends IJeiBackground { 6 | 7 | public MCJeiBackground(int u, int v, int width, int height, String resourceName) { 8 | super(u, v, width, height, resourceName); 9 | } 10 | 11 | public MCJeiBackground(int width, int height) { 12 | super(width, height); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/resources/assets/randomtweaker/lang/en_us.lang: -------------------------------------------------------------------------------- 1 | randomtweaker.jei_hydroangeas=Hydroangeas 2 | randomtweaker.jei_orechid=Orechid 3 | 4 | text.randomtweaker.hydroangeas_factorblock_description=This block can increase the mana generation of Hydroangeas. 5 | text.randomtweaker.factor=Factor: 6 | 7 | 8 | text.randomtweaker.attunement_constellation=Attuned to constellation: 9 | text.randomtweaker.attunement_any_constellation=Any attunement constellation. 10 | 11 | randomtweaker.jei_attunements=Attunement Altar -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/function/mana/IGetBaubleType.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.function.mana; 2 | 3 | import crafttweaker.api.item.IItemStack; 4 | import stanhebben.zenscript.annotations.ZenClass; 5 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 6 | 7 | 8 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 9 | @ZenClass("mods.randomtweaker.cote.IGetBaubleType") 10 | public interface IGetBaubleType { 11 | 12 | String call(IItemStack stack); 13 | 14 | } 15 | 16 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/function/mana/IisUsesMana.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.function.mana; 2 | 3 | import crafttweaker.api.item.IItemStack; 4 | import stanhebben.zenscript.annotations.ZenClass; 5 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 6 | 7 | /** 8 | * @author superhelo 9 | */ 10 | 11 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 12 | @ZenClass("mods.randomtweaker.cote.IisUsesMana") 13 | public interface IisUsesMana { 14 | 15 | boolean call(IItemStack stack); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/function/IPotionPerformEffect.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.function; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | import crafttweaker.api.entity.IEntityLivingBase; 5 | 6 | import stanhebben.zenscript.annotations.ZenClass; 7 | 8 | 9 | @FunctionalInterface 10 | @SidedZenRegister(modDeps = "contenttweaker") 11 | @ZenClass("mods.randomtweaker.cote.IPotionPerformEffect") 12 | public interface IPotionPerformEffect { 13 | 14 | void call(IEntityLivingBase living, int amplifier); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/function/subtile/PopulateDropStackNBTs.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.function.subtile; 2 | 3 | import crafttweaker.api.item.IItemStack; 4 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 5 | 6 | import stanhebben.zenscript.annotations.ZenClass; 7 | 8 | 9 | @FunctionalInterface 10 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 11 | @ZenClass("mods.randomtweaker.cote.PopulateDropStackNBTs") 12 | public interface PopulateDropStackNBTs { 13 | 14 | void call(IItemStack[] drops); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/function/mana/IManaWithItem.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.function.mana; 2 | 3 | import crafttweaker.api.item.IItemStack; 4 | import stanhebben.zenscript.annotations.ZenClass; 5 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 6 | 7 | /** 8 | * @author superhelo 9 | */ 10 | 11 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 12 | @ZenClass("mods.randomtweaker.cote.IManaWithItem") 13 | public interface IManaWithItem { 14 | 15 | boolean call(IItemStack stack, IItemStack otherStack); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/function/mana/IGetEntityLifeSpan.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.function.mana; 2 | 3 | import crafttweaker.api.item.IItemStack; 4 | import crafttweaker.api.world.IWorld; 5 | import stanhebben.zenscript.annotations.ZenClass; 6 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 7 | 8 | 9 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 10 | @ZenClass("mods.randomtweaker.cote.IGetEntityLifeSpan") 11 | public interface IGetEntityLifeSpan { 12 | 13 | int call(IItemStack stack, IWorld world); 14 | 15 | } 16 | 17 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/botania/function/DynamicSpawnTable.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.botania.function; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | import crafttweaker.api.item.IItemStack; 5 | import crafttweaker.api.player.IPlayer; 6 | 7 | import stanhebben.zenscript.annotations.ZenClass; 8 | 9 | 10 | @SidedZenRegister(modDeps = "botania") 11 | @ZenClass("mods.randomtweaker.botania.DynamicSpawnTable") 12 | @FunctionalInterface 13 | public interface DynamicSpawnTable { 14 | 15 | String call(IItemStack stack, IPlayer player, ICocoonTileEntity tile); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/botania/cocoon/IMixinTileCocoon.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.botania.cocoon; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | import net.minecraft.item.ItemStack; 5 | import net.minecraft.util.math.BlockPos; 6 | import net.minecraft.world.World; 7 | 8 | public interface IMixinTileCocoon { 9 | 10 | int randomTweaker$getMapSize(); 11 | 12 | int randomTweaker$getAmount(World world, BlockPos pos, ItemStack stack, EntityPlayer player); 13 | 14 | void randomTweaker$setAmount(World world, BlockPos pos, ItemStack stack, EntityPlayer player, int amount); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/function/mana/IBaubleFunction.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.function.mana; 2 | 3 | import crafttweaker.api.entity.IEntityLivingBase; 4 | import crafttweaker.api.item.IItemStack; 5 | import stanhebben.zenscript.annotations.ZenClass; 6 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 7 | 8 | /** 9 | * @author superhelo 10 | */ 11 | 12 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 13 | @ZenClass("mods.randomtweaker.cote.IBaubleFunction") 14 | public interface IBaubleFunction { 15 | 16 | void call(IItemStack bauble, IEntityLivingBase wearer); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/contenttweaker/mana/bauble/MCManaTrinketContent.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.contenttweaker.mana.bauble; 2 | 3 | import ink.ikx.rt.api.mods.contenttweaker.mana.bauble.IManaBaubleRepresentation; 4 | import vazkii.botania.api.item.ICosmeticBauble; 5 | import youyihj.zenutils.api.cotx.annotation.ExpandContentTweakerEntry; 6 | 7 | /** 8 | * @author superhelo 9 | */ 10 | @ExpandContentTweakerEntry 11 | public class MCManaTrinketContent extends MCManaBaubleContent implements ICosmeticBauble { 12 | 13 | public MCManaTrinketContent(IManaBaubleRepresentation manaBauble) { 14 | super(manaBauble); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/function/mana/IBaubleRender.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.function.mana; 2 | 3 | import crafttweaker.api.item.IItemStack; 4 | import crafttweaker.api.player.IPlayer; 5 | import stanhebben.zenscript.annotations.ZenClass; 6 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 7 | 8 | /** 9 | * @author superhelo 10 | */ 11 | 12 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 13 | @ZenClass("mods.randomtweaker.cote.PlayerBaubleRender") 14 | public interface IBaubleRender { 15 | 16 | void call(IItemStack stack, IPlayer player, String renderType, float partialTicks); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/resources/mixins.randomtweaker.mods.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": false, 3 | "compatibilityLevel": "JAVA_8", 4 | "package": "ink.ikx.rt.mixins", 5 | "minVersion": "0.8", 6 | "refmap": "mixins.randomtweaker.refmap.json", 7 | "mixins": [ 8 | "botania.MixinBlockCocoon", 9 | "botania.MixinBlockSpecialFlower", 10 | "botania.MixinBotaniaAPI", 11 | "botania.MixinTileAlfPortal", 12 | "botania.MixinTileCocoon", 13 | "botania.MixinTilePool", 14 | "botania.MixinTileSpecialFlower", 15 | "ftbultimine.MixinFTBUltimine" 16 | ], 17 | "client": [ 18 | "ftbultimine.MixinFTBUltimineClient", 19 | "tconstruct.MixinContentMaterial" 20 | ] 21 | } -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/function/mana/IBaubleFunctionWithReturn.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.function.mana; 2 | 3 | import crafttweaker.api.entity.IEntityLivingBase; 4 | import crafttweaker.api.item.IItemStack; 5 | import stanhebben.zenscript.annotations.ZenClass; 6 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 7 | 8 | /** 9 | * @author superhelo 10 | */ 11 | 12 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 13 | @ZenClass("mods.randomtweaker.cote.IBaubleFunctionWithReturn") 14 | public interface IBaubleFunctionWithReturn { 15 | 16 | boolean call(IItemStack bauble, IEntityLivingBase wearer); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/function/mana/IManaWithPool.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.function.mana; 2 | 3 | import crafttweaker.api.item.IItemStack; 4 | import crafttweaker.api.world.IBlockPos; 5 | import crafttweaker.api.world.IWorld; 6 | import stanhebben.zenscript.annotations.ZenClass; 7 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 8 | 9 | /** 10 | * @author superhelo 11 | */ 12 | 13 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 14 | @ZenClass("mods.randomtweaker.cote.IManaWithPool") 15 | public interface IManaWithPool { 16 | 17 | boolean call(IItemStack stack, IWorld world, IBlockPos pos); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/function/subtile/CanGeneratePassively.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.function.subtile; 2 | 3 | import com.teamacronymcoders.contenttweaker.api.ctobjects.blockpos.IBlockPos; 4 | import com.teamacronymcoders.contenttweaker.api.ctobjects.world.IWorld; 5 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 6 | 7 | import stanhebben.zenscript.annotations.ZenClass; 8 | 9 | 10 | @FunctionalInterface 11 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 12 | @ZenClass("mods.randomtweaker.cote.CanGeneratePassively") 13 | public interface CanGeneratePassively { 14 | 15 | boolean call(IBlockPos pos, IWorld world); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/jei/slots/IJeiSlotItem.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.jei.slots; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | 5 | import stanhebben.zenscript.annotations.ZenClass; 6 | 7 | 8 | @SidedZenRegister(modDeps = "jei") 9 | @ZenClass("mods.randomtweaker.jei.IJeiSlotItem") 10 | public abstract class IJeiSlotItem extends IJeiSlot { 11 | 12 | protected IJeiSlotItem(int x, int y, boolean isInput, boolean hasBase) { 13 | super(x, y, isInput, hasBase); 14 | } 15 | 16 | protected IJeiSlotItem(String slotName, int x, int y, boolean isInput, boolean hasBase) { 17 | super(slotName, x, y, isInput, hasBase); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/jei/recipe/JEIAttunementRecipe.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.jei.recipe; 2 | 3 | import hellfirepvp.astralsorcery.common.constellation.IConstellation; 4 | import ink.ikx.rt.impl.mods.jei.impl.core.MCJeiRecipe; 5 | 6 | public class JEIAttunementRecipe extends MCJeiRecipe { 7 | 8 | private IConstellation constellation; 9 | 10 | public JEIAttunementRecipe(String uid) { 11 | super(uid); 12 | } 13 | 14 | public IConstellation getConstellation() { 15 | return this.constellation; 16 | } 17 | 18 | public JEIAttunementRecipe setConstellation(IConstellation constellation) { 19 | this.constellation = constellation; 20 | return this; 21 | } 22 | } -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/function/subtile/Update.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.function.subtile; 2 | 3 | import com.teamacronymcoders.contenttweaker.api.ctobjects.blockpos.IBlockPos; 4 | import com.teamacronymcoders.contenttweaker.api.ctobjects.world.IWorld; 5 | import ink.ikx.rt.api.mods.contenttweaker.subtile.ISubTileEntityInGame; 6 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 7 | 8 | import stanhebben.zenscript.annotations.ZenClass; 9 | 10 | 11 | @FunctionalInterface 12 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 13 | @ZenClass("mods.randomtweaker.cote.Update") 14 | public interface Update { 15 | 16 | void call(ISubTileEntityInGame subTile, IWorld world, IBlockPos pos); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/internal/event/EventHandler.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.internal.event; 2 | 3 | import ink.ikx.rt.Main; 4 | import net.minecraftforge.common.config.Config; 5 | import net.minecraftforge.common.config.ConfigManager; 6 | import net.minecraftforge.fml.client.event.ConfigChangedEvent; 7 | import net.minecraftforge.fml.common.Mod; 8 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 9 | 10 | @Mod.EventBusSubscriber 11 | public class EventHandler { 12 | 13 | @SubscribeEvent 14 | public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) { 15 | if (event.getModID().equals(Main.MODID)) { 16 | ConfigManager.sync(Main.MODID, Config.Type.INSTANCE); 17 | } 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/function/subtile/BlockAdded.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.function.subtile; 2 | 3 | import com.teamacronymcoders.contenttweaker.api.ctobjects.blockpos.IBlockPos; 4 | import com.teamacronymcoders.contenttweaker.api.ctobjects.blockstate.ICTBlockState; 5 | import com.teamacronymcoders.contenttweaker.api.ctobjects.world.IWorld; 6 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 7 | 8 | import stanhebben.zenscript.annotations.ZenClass; 9 | 10 | 11 | @FunctionalInterface 12 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 13 | @ZenClass("mods.randomtweaker.cote.BlockAdded") 14 | public interface BlockAdded { 15 | 16 | void call(IWorld world, IBlockPos pos, ICTBlockState state); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/function/subtile/CanSelect.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.function.subtile; 2 | 3 | import com.teamacronymcoders.contenttweaker.api.ctobjects.blockpos.IBlockPos; 4 | import com.teamacronymcoders.contenttweaker.api.ctobjects.entity.player.ICTPlayer; 5 | import crafttweaker.api.item.IItemStack; 6 | import crafttweaker.api.world.IFacing; 7 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 8 | 9 | import stanhebben.zenscript.annotations.ZenClass; 10 | 11 | 12 | @FunctionalInterface 13 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 14 | @ZenClass("mods.randomtweaker.cote.CanSelect") 15 | public interface CanSelect { 16 | 17 | boolean call(ICTPlayer player, IItemStack wand, IBlockPos pos, IFacing side); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { 4 | // RetroFuturaGradle 5 | name 'GTNH Maven' 6 | url 'https://nexus.gtnewhorizons.com/repository/public/' 7 | mavenContent { 8 | includeGroup 'com.gtnewhorizons' 9 | includeGroup 'com.gtnewhorizons.retrofuturagradle' 10 | } 11 | } 12 | gradlePluginPortal() 13 | mavenCentral() 14 | mavenLocal() 15 | } 16 | } 17 | 18 | plugins { 19 | // Automatic toolchain provisioning 20 | id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' 21 | } 22 | 23 | // Due to an IntelliJ bug, this has to be done 24 | // rootProject.name = archives_base_name 25 | rootProject.name = rootProject.projectDir.getName() 26 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/contenttweaker/mana/item/MCManaItemRepresentation.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.contenttweaker.mana.item; 2 | 3 | import com.teamacronymcoders.base.registrysystem.ItemRegistry; 4 | import com.teamacronymcoders.contenttweaker.ContentTweaker; 5 | import ink.ikx.rt.api.mods.contenttweaker.mana.item.IManaItemRepresentation; 6 | 7 | public class MCManaItemRepresentation extends IManaItemRepresentation { 8 | 9 | public MCManaItemRepresentation(String unlocalizedName, int maxMana) { 10 | this.setUnlocalizedName(unlocalizedName); 11 | this.setMaxMana(maxMana); 12 | this.setMaxStackSize(1); 13 | } 14 | 15 | @Override 16 | public void register() { 17 | ContentTweaker.instance.getRegistry(ItemRegistry.class, "ITEM").register(new MCManaItemContent(this)); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/astralsorcery/event/AbstractClassImplement.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.astralsorcery.event; 2 | 3 | import ink.ikx.rt.api.mods.astralsorcery.event.CTAttunementRecipeCompleteEvent; 4 | import ink.ikx.rt.api.mods.astralsorcery.event.CTAttunementStartEvent; 5 | 6 | public class AbstractClassImplement { 7 | 8 | public static class CTAttunementRecipeCompleteEventImpl extends CTAttunementRecipeCompleteEvent { 9 | 10 | public CTAttunementRecipeCompleteEventImpl(AttunementRecipeCompleteEvent event) { 11 | super(event); 12 | } 13 | 14 | } 15 | 16 | public static class CTAttunementStartEventImpl extends CTAttunementStartEvent { 17 | 18 | public CTAttunementStartEventImpl(AttunementStartEvent event) { 19 | super(event); 20 | } 21 | 22 | } 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Sets default memory used for gradle commands. Can be overridden by user or command line properties. 2 | # This is required to provide enough memory for the Minecraft decompilation process. 3 | org.gradle.jvmargs=-Xmx3G 4 | # Mod Information 5 | mod_version=1.4.9 6 | maven_group=ink.ikx.rt 7 | archives_base_name=RandomTweaker 8 | # If any properties changes below this line, run `gradlew setupDecompWorkspace` and refresh gradle again to ensure everything is working correctly. 9 | # Boilerplate Options 10 | use_mixins=true 11 | use_coremod=true 12 | use_assetmover=false 13 | # Access Transformer files should be in the root of `resources` folder and with the filename formatted as: `{archives_base_name}_at.cfg` 14 | use_access_transformer=true 15 | # Coremod Arguments 16 | include_mod=true 17 | coremod_plugin_class_name=ink.ikx.rt.impl.internal.core.CoreModBoot -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/jei/IJeiUtilsWithBotania.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.jei; 2 | 3 | import ink.ikx.rt.api.mods.jei.elements.IJeiElements; 4 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 5 | 6 | import ink.ikx.rt.impl.mods.jei.impl.elemenet.MCJeiElementManaBar; 7 | import stanhebben.zenscript.annotations.Optional; 8 | import stanhebben.zenscript.annotations.ZenExpansion; 9 | import stanhebben.zenscript.annotations.ZenMethodStatic; 10 | 11 | 12 | @SidedZenRegister(modDeps = {"jei", "botania"}) 13 | @ZenExpansion("mods.randomtweaker.jei.IJeiUtils") 14 | public abstract class IJeiUtilsWithBotania { 15 | 16 | @ZenMethodStatic 17 | public static IJeiElements.IJeiElementManaBar createJeiManaBarElement(int x, int y, int mana, @Optional int mode) { 18 | return new MCJeiElementManaBar(x, y, mode, mana); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/function/subtile/BlockHarvested.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.function.subtile; 2 | 3 | import com.teamacronymcoders.contenttweaker.api.ctobjects.blockpos.IBlockPos; 4 | import com.teamacronymcoders.contenttweaker.api.ctobjects.blockstate.ICTBlockState; 5 | import com.teamacronymcoders.contenttweaker.api.ctobjects.entity.player.ICTPlayer; 6 | import com.teamacronymcoders.contenttweaker.api.ctobjects.world.IWorld; 7 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 8 | 9 | import stanhebben.zenscript.annotations.ZenClass; 10 | 11 | 12 | @FunctionalInterface 13 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 14 | @ZenClass("mods.randomtweaker.cote.BlockHarvested") 15 | public interface BlockHarvested { 16 | 17 | void call(IWorld world, IBlockPos pos, ICTBlockState state, ICTPlayer player); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/contenttweaker/mana/item/tool/MCIsUsesManaItemRepresentation.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.contenttweaker.mana.item.tool; 2 | 3 | import com.teamacronymcoders.base.registrysystem.ItemRegistry; 4 | import com.teamacronymcoders.contenttweaker.ContentTweaker; 5 | import ink.ikx.rt.api.mods.contenttweaker.mana.item.tool.IIsUsesManaItemRepresentation; 6 | 7 | public class MCIsUsesManaItemRepresentation extends IIsUsesManaItemRepresentation { 8 | 9 | public MCIsUsesManaItemRepresentation(String unlocalizedName, int maxMana) { 10 | this.setUnlocalizedName(unlocalizedName); 11 | this.setMaxMana(maxMana); 12 | this.setMaxStackSize(1); 13 | } 14 | 15 | @Override 16 | public void register() { 17 | ContentTweaker.instance.getRegistry(ItemRegistry.class, "ITEM").register(new MCIsUsesManaItemContent(this)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/modtweaker/ExpandCTAspect.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.modtweaker; 2 | 3 | import com.blamejared.compat.thaumcraft.handlers.aspects.CTAspect; 4 | import ink.ikx.rt.api.mods.thaumcraft.IAspect; 5 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 6 | 7 | import stanhebben.zenscript.annotations.ZenCaster; 8 | import stanhebben.zenscript.annotations.ZenClass; 9 | import stanhebben.zenscript.annotations.ZenExpansion; 10 | import stanhebben.zenscript.annotations.ZenMethod; 11 | 12 | 13 | @SidedZenRegister(modDeps = {"thaumcraft", "modtweaker"}) 14 | @ZenExpansion("thaumcraft.aspect.CTAspect") 15 | @ZenClass("mods.randomtweaker.modtweaker.CTAspect") 16 | public class ExpandCTAspect { 17 | 18 | @ZenMethod 19 | @ZenCaster 20 | public static IAspect asIAstral(CTAspect aspect) { 21 | return IAspect.of(aspect.getInternal()); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/function/subtile/BlockPlacedBy.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.function.subtile; 2 | 3 | import com.teamacronymcoders.contenttweaker.api.ctobjects.blockpos.IBlockPos; 4 | import com.teamacronymcoders.contenttweaker.api.ctobjects.blockstate.ICTBlockState; 5 | import com.teamacronymcoders.contenttweaker.api.ctobjects.world.IWorld; 6 | import crafttweaker.api.entity.IEntityLivingBase; 7 | import crafttweaker.api.item.IItemStack; 8 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 9 | 10 | import stanhebben.zenscript.annotations.ZenClass; 11 | 12 | 13 | @FunctionalInterface 14 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 15 | @ZenClass("mods.randomtweaker.cote.BlockPlacedBy") 16 | public interface BlockPlacedBy { 17 | 18 | void call(IWorld world, IBlockPos pos, ICTBlockState state, IEntityLivingBase entity, IItemStack stack); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/naturesaura/IAuraChunk.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.naturesaura; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | import crafttweaker.api.world.IBlockPos; 5 | 6 | import stanhebben.zenscript.annotations.ZenClass; 7 | import stanhebben.zenscript.annotations.ZenMethod; 8 | 9 | 10 | @SidedZenRegister(modDeps = "naturesaura") 11 | @ZenClass("mods.randomtweaker.naturesaura.IAuraChunk") 12 | public interface IAuraChunk { 13 | 14 | @ZenMethod 15 | int drainAura(IBlockPos pos, int amount); 16 | 17 | @ZenMethod 18 | int drainAura(IBlockPos pos, int amount, boolean aimForZero, boolean simulate); 19 | 20 | @ZenMethod 21 | int storeAura(IBlockPos pos, int amount); 22 | 23 | @ZenMethod 24 | int storeAura(IBlockPos pos, int amount, boolean aimForZero, boolean simulate); 25 | 26 | @ZenMethod 27 | int getDrainSpot(IBlockPos pos); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/mana/IManaBauble.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.mana; 2 | 3 | import crafttweaker.api.entity.IEntityLivingBase; 4 | import crafttweaker.api.item.IItemStack; 5 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 6 | 7 | import stanhebben.zenscript.annotations.ZenClass; 8 | import stanhebben.zenscript.annotations.ZenGetter; 9 | import stanhebben.zenscript.annotations.ZenMethod; 10 | 11 | /** 12 | * @author superhelo 13 | */ 14 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 15 | @ZenClass("mods.randomtweaker.item.IManaBauble") 16 | public interface IManaBauble extends IManaItem { 17 | 18 | @ZenGetter("baubleType") 19 | String getBaubleType(); 20 | 21 | @ZenMethod 22 | boolean canEquip(IItemStack baubleItem, IEntityLivingBase wearer); 23 | 24 | @ZenMethod 25 | boolean canUnEquip(IItemStack baubleItem, IEntityLivingBase wearer); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/botania/function/ICocoonTileEntity.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.botania.function; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | import crafttweaker.api.data.IData; 5 | import crafttweaker.api.world.IBlockPos; 6 | import crafttweaker.api.world.IWorld; 7 | 8 | import stanhebben.zenscript.annotations.ZenClass; 9 | import stanhebben.zenscript.annotations.ZenGetter; 10 | import stanhebben.zenscript.annotations.ZenMethod; 11 | 12 | 13 | @SidedZenRegister(modDeps = "botania") 14 | @ZenClass("mods.randomtweaker.botania.ICocoonTileEntity") 15 | public interface ICocoonTileEntity { 16 | 17 | @ZenMethod 18 | @ZenGetter("world") 19 | IWorld getIWorld(); 20 | 21 | @ZenMethod 22 | @ZenGetter("pos") 23 | IBlockPos getIBlockPos(); 24 | 25 | @ZenMethod 26 | @ZenGetter("data") 27 | IData getData(); 28 | 29 | @ZenMethod 30 | void updateData(IData data); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/internal/item/IItemStackExpansion.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.internal.item; 2 | 3 | import crafttweaker.api.item.IItemStack; 4 | import crafttweaker.api.minecraft.CraftTweakerMC; 5 | import net.minecraft.item.ItemStack; 6 | import stanhebben.zenscript.annotations.ZenClass; 7 | import stanhebben.zenscript.annotations.ZenExpansion; 8 | import stanhebben.zenscript.annotations.ZenMethod; 9 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 10 | 11 | import java.util.Objects; 12 | 13 | 14 | @SidedZenRegister 15 | @ZenExpansion("crafttweaker.item.IItemStack") 16 | @ZenClass("mods.randomtweaker.vanilla.IItemStack") 17 | public abstract class IItemStackExpansion { 18 | 19 | @ZenMethod 20 | public static int getTagSize(IItemStack stack) { 21 | ItemStack mcStack = CraftTweakerMC.getItemStack(stack); 22 | 23 | return Objects.nonNull(mcStack.getTagCompound()) ? mcStack.getTagCompound().getKeySet().size() : 0; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/thaumcraft/expand/ExpandIItemStack.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.thaumcraft.expand; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | import crafttweaker.api.item.IItemStack; 5 | import crafttweaker.api.minecraft.CraftTweakerMC; 6 | import ink.ikx.rt.api.mods.thaumcraft.IAspectList; 7 | 8 | import stanhebben.zenscript.annotations.ZenClass; 9 | import stanhebben.zenscript.annotations.ZenExpansion; 10 | import stanhebben.zenscript.annotations.ZenMethod; 11 | import thaumcraft.api.aspects.AspectHelper; 12 | 13 | 14 | @SidedZenRegister(modDeps = "thaumcraft") 15 | @ZenExpansion("crafttweaker.item.IItemStack") 16 | @ZenClass("mods.randomtweaker.thaumcraft.IItemStack") 17 | public abstract class ExpandIItemStack { 18 | 19 | @ZenMethod 20 | public static IAspectList getAspects(IItemStack stack) { 21 | return IAspectList.of(AspectHelper.getObjectAspects(CraftTweakerMC.getItemStack(stack)).copy()); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/ExpandVanillaFactoryWithThaumcraft.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker; 2 | 3 | import ink.ikx.rt.api.mods.contenttweaker.aspect.IAspectRepresentation; 4 | import ink.ikx.rt.impl.mods.contenttweaker.aspect.MCAspectRepresentation; 5 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 6 | 7 | import stanhebben.zenscript.annotations.ZenClass; 8 | import stanhebben.zenscript.annotations.ZenExpansion; 9 | import stanhebben.zenscript.annotations.ZenMethodStatic; 10 | 11 | 12 | @SidedZenRegister(modDeps = {"thaumcraft", "contenttweaker"}) 13 | @ZenExpansion("mods.contenttweaker.VanillaFactory") 14 | @ZenClass("mods.randomtweaker.cote.VanillaFactoryExpansionWithThaumcraft") 15 | public abstract class ExpandVanillaFactoryWithThaumcraft { 16 | 17 | @ZenMethodStatic 18 | public static IAspectRepresentation createAspect(String tag, int color) { 19 | return new MCAspectRepresentation(tag, color); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/potion/IPotionTypeRepresentation.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.potion; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | 5 | import stanhebben.zenscript.annotations.ZenClass; 6 | import stanhebben.zenscript.annotations.ZenMethod; 7 | import stanhebben.zenscript.annotations.ZenProperty; 8 | 9 | 10 | @SidedZenRegister(modDeps = "contenttweaker") 11 | @ZenClass("mods.randomtweaker.cote.IPotionType") 12 | public abstract class IPotionTypeRepresentation { 13 | 14 | public String unlocalizedName; 15 | public IPotionRepresentation potion; 16 | 17 | @ZenProperty 18 | public int duration = 3600; 19 | @ZenProperty 20 | public int amplifier = 0; 21 | 22 | protected IPotionTypeRepresentation(String unlocalizedName, IPotionRepresentation potion) { 23 | this.unlocalizedName = unlocalizedName; 24 | this.potion = potion; 25 | } 26 | 27 | @ZenMethod 28 | public abstract void register(); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/internal/proxy/IProxy.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.internal.proxy; 2 | 3 | import crafttweaker.api.item.IItemStack; 4 | import crafttweaker.api.player.IPlayer; 5 | import ink.ikx.rt.api.mods.contenttweaker.function.mana.IBaubleRender; 6 | 7 | /** 8 | * @author superhelo 9 | */ 10 | public interface IProxy { 11 | 12 | void onPlayerBaubleRender(IBaubleRender render, IItemStack stack, IPlayer player, String renderType, float partialTicks); 13 | 14 | void rotateIfSneaking(IPlayer player); 15 | 16 | void translateToHeadLevel(IPlayer player); 17 | 18 | void translateToFace(); 19 | 20 | void defaultTransforms(); 21 | 22 | void translateToChest(); 23 | 24 | void renderItem(IItemStack renderStack, String transformType); 25 | 26 | void bindTexture(String resourceLocation); 27 | 28 | void scale(double x, double y, double z); 29 | 30 | void rotate(float angle, float x, float y, float z); 31 | 32 | void translate(double x, double y, double z); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/botania/event/AbstractClassImplement.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.botania.event; 2 | 3 | import ink.ikx.rt.api.mods.botania.event.CTAlfPortalDroppedEvent; 4 | import ink.ikx.rt.api.mods.botania.event.CTElvenTradeEvent; 5 | import ink.ikx.rt.api.mods.botania.event.CTPoolTradeEvent; 6 | 7 | public class AbstractClassImplement { 8 | 9 | public static class CTElvenTradeEventImpl extends CTElvenTradeEvent { 10 | 11 | public CTElvenTradeEventImpl(ElvenTradeEvent event) { 12 | super(event); 13 | } 14 | 15 | } 16 | 17 | public static class CTAlfPortalDroppedEventImpl extends CTAlfPortalDroppedEvent { 18 | 19 | public CTAlfPortalDroppedEventImpl(AlfPortalDroppedEvent event) { 20 | super(event); 21 | } 22 | 23 | } 24 | 25 | public static class CTPoolTradeEventImpl extends CTPoolTradeEvent { 26 | 27 | public CTPoolTradeEventImpl(PoolTradeEvent event) { 28 | super(event); 29 | } 30 | 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/function/subtile/BlockActivated.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.function.subtile; 2 | 3 | import com.teamacronymcoders.contenttweaker.api.ctobjects.blockpos.IBlockPos; 4 | import com.teamacronymcoders.contenttweaker.api.ctobjects.blockstate.ICTBlockState; 5 | import com.teamacronymcoders.contenttweaker.api.ctobjects.entity.player.ICTPlayer; 6 | import com.teamacronymcoders.contenttweaker.api.ctobjects.enums.Hand; 7 | import com.teamacronymcoders.contenttweaker.api.ctobjects.world.IWorld; 8 | import crafttweaker.api.world.IFacing; 9 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 10 | 11 | import stanhebben.zenscript.annotations.ZenClass; 12 | 13 | 14 | @FunctionalInterface 15 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 16 | @ZenClass("mods.randomtweaker.cote.BlockActivated") 17 | public interface BlockActivated { 18 | 19 | boolean call(IWorld world, IBlockPos pos, ICTBlockState state, ICTPlayer player, Hand hand, IFacing side, float hitX, float hitY, float hitZ); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/internal/core/CoreModBoot.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.internal.core; 2 | 3 | import net.minecraftforge.common.ForgeVersion; 4 | import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin; 5 | 6 | import java.util.Map; 7 | 8 | /** 9 | * @author ikexing 10 | */ 11 | @IFMLLoadingPlugin.Name("RandomTweaker CoreMod Boot") 12 | @IFMLLoadingPlugin.MCVersion(ForgeVersion.mcVersion) 13 | public class CoreModBoot implements IFMLLoadingPlugin { 14 | 15 | @Override 16 | public String[] getASMTransformerClass() { 17 | return new String[]{ 18 | "ink.ikx.rt.classTransforms.RandomTweakerClassTransformer" 19 | }; 20 | } 21 | 22 | @Override 23 | public String getModContainerClass() { 24 | return null; 25 | } 26 | 27 | @Override 28 | public String getSetupClass() { 29 | return null; 30 | } 31 | 32 | @Override 33 | public void injectData(Map data) { 34 | } 35 | 36 | @Override 37 | public String getAccessTransformerClass() { 38 | return null; 39 | } 40 | } -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/classTransforms/vanilla/Hooks.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.classTransforms.vanilla; 2 | 3 | import com.google.common.collect.Multimap; 4 | import ink.ikx.rt.api.vanilla.CTEventHandler; 5 | import ink.ikx.rt.impl.internal.config.RTConfig; 6 | import net.minecraft.entity.ai.attributes.AttributeModifier; 7 | import net.minecraft.inventory.EntityEquipmentSlot; 8 | import net.minecraft.item.Item; 9 | import net.minecraft.item.ItemStack; 10 | import org.apache.commons.lang3.ArrayUtils; 11 | 12 | /** 13 | * @author youyihj 14 | */ 15 | @SuppressWarnings("unused") 16 | public class Hooks { 17 | public static void fireAttributeModificationEvent(ItemStack stack, EntityEquipmentSlot equipmentSlot, Multimap multimap) { 18 | CTEventHandler.Holder.publishItemAttributeModificationEvent(stack, equipmentSlot, multimap); 19 | } 20 | 21 | public static boolean isInBreakableEnchantmentBlacklist(Item item) { 22 | return ArrayUtils.contains(RTConfig.RandomTweaker.breakableEnchantmentBlacklist, item.getRegistryName().toString()); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/contenttweaker/aspect/MCAspectRepresentation.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.contenttweaker.aspect; 2 | 3 | import ink.ikx.rt.api.mods.contenttweaker.aspect.IAspectRepresentation; 4 | import net.minecraft.util.ResourceLocation; 5 | import org.apache.logging.log4j.LogManager; 6 | import thaumcraft.api.aspects.Aspect; 7 | 8 | public class MCAspectRepresentation extends IAspectRepresentation { 9 | 10 | public MCAspectRepresentation(String tag, int color) { 11 | this.setTag(tag); 12 | this.setColor(color); 13 | this.setImage("contenttweaker:textures/aspects/" + tag.toLowerCase() + ".png"); 14 | } 15 | 16 | @Override 17 | public void register() { 18 | try { 19 | Aspect aspect = new Aspect(this.tag, this.color, this.asAspects(), new ResourceLocation(this.image), this.blend); 20 | aspect.setChatcolor(this.chatcolor); 21 | } catch (IllegalArgumentException e) { 22 | LogManager.getLogger("randomtweaker").error("Registering " + this.tag + " aspect failed"); 23 | } 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/jei/core/IJeiBackground.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.jei.core; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | 5 | import stanhebben.zenscript.annotations.ZenClass; 6 | import stanhebben.zenscript.annotations.ZenProperty; 7 | 8 | 9 | @SidedZenRegister(modDeps = "jei") 10 | @ZenClass("mods.randomtweaker.jei.IJeiBackground") 11 | public abstract class IJeiBackground { 12 | 13 | @ZenProperty 14 | public int u; 15 | 16 | @ZenProperty 17 | public int v; 18 | 19 | @ZenProperty 20 | public int width; 21 | 22 | @ZenProperty 23 | public int height; 24 | 25 | @ZenProperty 26 | public String resourceName; 27 | 28 | protected IJeiBackground(int u, int v, int width, int height, String resourceName) { 29 | this.u = u; 30 | this.v = v; 31 | this.width = width; 32 | this.height = height; 33 | this.resourceName = resourceName; 34 | } 35 | 36 | protected IJeiBackground(int width, int height) { 37 | this.width = width; 38 | this.height = height; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/mixins/ftbultimine/MixinFTBUltimineClient.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.mixins.ftbultimine; 2 | 3 | import com.feed_the_beast.mods.ftbultimine.client.FTBUltimineClient; 4 | import ink.ikx.rt.impl.internal.utils.InternalUtils; 5 | import net.minecraftforge.client.event.RenderGameOverlayEvent; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(value = FTBUltimineClient.class, remap = false) 12 | public abstract class MixinFTBUltimineClient { 13 | 14 | @Inject(method = "info", at = @At("HEAD"), cancellable = true) 15 | public void injectInfo(RenderGameOverlayEvent.Text event, CallbackInfo ci) { 16 | InternalUtils.decouplingMethod(ci); 17 | } 18 | 19 | @Inject(method = "renderGameOverlay", at = @At("HEAD"), cancellable = true) 20 | public void injectRenderGameOverlay(RenderGameOverlayEvent.Post list, CallbackInfo ci) { 21 | InternalUtils.decouplingMethod(ci); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 ikexing 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/contenttweaker/mana/bauble/MCManaBaubleRepresentation.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.contenttweaker.mana.bauble; 2 | 3 | import com.teamacronymcoders.base.registrysystem.ItemRegistry; 4 | import com.teamacronymcoders.contenttweaker.ContentTweaker; 5 | import ink.ikx.rt.api.mods.contenttweaker.mana.bauble.IManaBaubleRepresentation; 6 | 7 | public class MCManaBaubleRepresentation extends IManaBaubleRepresentation { 8 | 9 | public MCManaBaubleRepresentation(String unlocalizedName, int maxMana, String baubleType) { 10 | this.setUnlocalizedName(unlocalizedName); 11 | this.setMaxMana(maxMana); 12 | this.setMaxStackSize(1); 13 | this.setBaubleType(baubleType); 14 | } 15 | 16 | @Override 17 | public void register() { 18 | if (baubleType.equals("TRINKET")) { 19 | ContentTweaker.instance.getRegistry(ItemRegistry.class, "ITEM").register(new MCManaTrinketContent(this)); 20 | } else { 21 | ContentTweaker.instance.getRegistry(ItemRegistry.class, "ITEM").register(new MCManaBaubleContent(this)); 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/thaumcraft/expand/ExpandIEntity.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.thaumcraft.expand; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | import crafttweaker.api.entity.IEntity; 5 | import crafttweaker.api.minecraft.CraftTweakerMC; 6 | import ink.ikx.rt.api.mods.thaumcraft.IAspectList; 7 | 8 | import stanhebben.zenscript.annotations.ZenClass; 9 | import stanhebben.zenscript.annotations.ZenExpansion; 10 | import stanhebben.zenscript.annotations.ZenMethod; 11 | import thaumcraft.api.aspects.AspectHelper; 12 | import thaumcraft.api.aspects.AspectList; 13 | 14 | 15 | @SidedZenRegister(modDeps = "thaumcraft") 16 | @ZenExpansion("crafttweaker.entity.IEntity") 17 | @ZenClass("mods.randomtweaker.thaumcraft.IEntity") 18 | public abstract class ExpandIEntity { 19 | 20 | @ZenMethod 21 | public static IAspectList getAspects(IEntity entity) { 22 | AspectList entityAspects = AspectHelper.getEntityAspects(CraftTweakerMC.getEntity(entity)); 23 | if (entityAspects != null) { 24 | return IAspectList.of(entityAspects.copy()); 25 | } 26 | return IAspectList.of(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/jei/core/IJeiRecipe.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.jei.core; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | import crafttweaker.api.item.IIngredient; 5 | import ink.ikx.rt.api.mods.jei.elements.IJeiElement; 6 | 7 | import stanhebben.zenscript.annotations.ZenClass; 8 | import stanhebben.zenscript.annotations.ZenMethod; 9 | 10 | 11 | @SidedZenRegister(modDeps = "jei") 12 | @ZenClass("mods.randomtweaker.jei.IJeiRecipe") 13 | public interface IJeiRecipe { 14 | 15 | @ZenMethod 16 | IJeiRecipe setInputs(IIngredient[] inputs); 17 | 18 | @ZenMethod 19 | IJeiRecipe setOutputs(IIngredient[] outputs); 20 | 21 | @ZenMethod 22 | IJeiRecipe setElements(IJeiElement[] elements); 23 | 24 | @ZenMethod 25 | IJeiRecipe addInput(IIngredient input); 26 | 27 | @ZenMethod 28 | IJeiRecipe addOutput(IIngredient output); 29 | 30 | @ZenMethod 31 | IJeiRecipe addElement(IJeiElement element); 32 | 33 | @ZenMethod 34 | IJeiRecipe onJEITooltip(IJeiTooltip tooltip); 35 | 36 | @ZenMethod 37 | void build(); 38 | 39 | void build_(); 40 | 41 | String getUid(); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/subtile/functional/ISubTileEntityFunctionalRepresentation.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.subtile.functional; 2 | 3 | import ink.ikx.rt.api.mods.contenttweaker.subtile.ISubTileEntityRepresentation; 4 | import stanhebben.zenscript.annotations.ZenClass; 5 | import stanhebben.zenscript.annotations.ZenMethod; 6 | import stanhebben.zenscript.annotations.ZenProperty; 7 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 8 | 9 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 10 | @ZenClass("mods.randomtweaker.cote.ISubTileEntityFunctional") 11 | public abstract class ISubTileEntityFunctionalRepresentation extends ISubTileEntityRepresentation { 12 | 13 | private static final String TYPE_NAME = "functional"; 14 | 15 | @ZenProperty 16 | public boolean hasMini; 17 | @ZenProperty 18 | public int miniRange = 1; 19 | 20 | protected ISubTileEntityFunctionalRepresentation(int color, String unlocalizedName) { 21 | super(color, unlocalizedName); 22 | } 23 | 24 | @ZenMethod 25 | public void register() { 26 | this.register(TYPE_NAME, hasMini); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/contenttweaker/mana/item/tool/MCIsUsesManaItemContent.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.contenttweaker.mana.item.tool; 2 | 3 | import crafttweaker.api.minecraft.CraftTweakerMC; 4 | import ink.ikx.rt.api.mods.contenttweaker.mana.item.tool.IIsUsesManaItemRepresentation; 5 | import ink.ikx.rt.impl.mods.contenttweaker.mana.item.MCManaItemContent; 6 | import net.minecraft.item.ItemStack; 7 | import vazkii.botania.api.mana.IManaUsingItem; 8 | import youyihj.zenutils.api.cotx.annotation.ExpandContentTweakerEntry; 9 | 10 | import java.util.Objects; 11 | 12 | @ExpandContentTweakerEntry 13 | public class MCIsUsesManaItemContent extends MCManaItemContent implements IManaUsingItem { 14 | 15 | private final IIsUsesManaItemRepresentation manaUsingItem; 16 | 17 | public MCIsUsesManaItemContent(IIsUsesManaItemRepresentation manaUsingItem) { 18 | super(manaUsingItem); 19 | this.manaUsingItem = manaUsingItem; 20 | } 21 | 22 | @Override 23 | public boolean usesMana(ItemStack stack) { 24 | return Objects.isNull(manaUsingItem.usesMana) || manaUsingItem.usesMana.call(CraftTweakerMC.getIItemStack(stack)); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/thaumcraft/MCAspect.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.thaumcraft; 2 | 3 | import ink.ikx.rt.api.mods.thaumcraft.IAspect; 4 | import thaumcraft.api.aspects.Aspect; 5 | 6 | import java.util.Arrays; 7 | import java.util.Objects; 8 | 9 | public class MCAspect implements IAspect { 10 | 11 | private final Aspect internal; 12 | 13 | public MCAspect(Aspect aspect) { 14 | this.internal = aspect; 15 | } 16 | 17 | @Override 18 | public String getName() { 19 | return this.internal.getName(); 20 | } 21 | 22 | @Override 23 | public IAspect[] getComponents() { 24 | return Objects.nonNull(internal.getComponents()) ? Arrays.stream(this.internal.getComponents()).map(IAspect::of).toArray(IAspect[]::new) : null; 25 | } 26 | 27 | @Override 28 | public String getChatcolor() { 29 | return internal.getChatcolor(); 30 | } 31 | 32 | @Override 33 | public Aspect getInternal() { 34 | return this.internal; 35 | } 36 | 37 | @Override 38 | public boolean equals(IAspect other) { 39 | return Objects.equals(other.getName(), this.getName()); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/thaumcraft/expand/ExpandIAspect.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.thaumcraft.expand; 2 | 3 | import com.blamejared.compat.thaumcraft.handlers.aspects.CTAspect; 4 | import com.blamejared.compat.thaumcraft.handlers.aspects.CTAspectStack; 5 | import ink.ikx.rt.api.mods.thaumcraft.IAspect; 6 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 7 | 8 | import stanhebben.zenscript.annotations.ZenCaster; 9 | import stanhebben.zenscript.annotations.ZenClass; 10 | import stanhebben.zenscript.annotations.ZenExpansion; 11 | import stanhebben.zenscript.annotations.ZenMethod; 12 | 13 | 14 | @SidedZenRegister(modDeps = {"thaumcraft", "modtweaker"}) 15 | @ZenExpansion("mods.randomtweaker.thaumcraft.IAspect") 16 | @ZenClass("mods.randomtweaker.thaumcraft.expand.IAspect") 17 | public abstract class ExpandIAspect { 18 | 19 | @ZenMethod 20 | @ZenCaster 21 | public static CTAspect asCTAspect(IAspect internal) { 22 | return new CTAspect(internal.getInternal()); 23 | } 24 | 25 | @ZenMethod 26 | public static CTAspectStack asCTAspectStack(IAspect internal, int amount) { 27 | return new CTAspectStack(asCTAspect(internal), amount); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/astralsorcery/event/AttunementStartEvent.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.astralsorcery.event; 2 | 3 | import hellfirepvp.astralsorcery.common.constellation.IConstellation; 4 | import ink.ikx.rt.impl.internal.event.BaseEvent; 5 | import net.minecraft.entity.Entity; 6 | import net.minecraft.world.World; 7 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 8 | 9 | @Cancelable 10 | public class AttunementStartEvent extends BaseEvent { 11 | 12 | private final Entity inputEntity; 13 | private final World world; 14 | private final IConstellation constellation; 15 | 16 | public AttunementStartEvent(Entity entity, World world, IConstellation constellation) { 17 | this.inputEntity = entity; 18 | this.world = world; 19 | this.constellation = constellation; 20 | } 21 | 22 | public World getWorld() { 23 | return world; 24 | } 25 | 26 | public IConstellation getConstellation() { 27 | return constellation; 28 | } 29 | 30 | public String getConstellationString() { 31 | return constellation.getUnlocalizedName(); 32 | } 33 | 34 | public Entity getInputEntity() { 35 | return inputEntity; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/vanilla/IItemAttributeModificationEvent.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.vanilla; 2 | 3 | import crafttweaker.api.entity.IEntityEquipmentSlot; 4 | import crafttweaker.api.entity.attribute.IEntityAttributeModifier; 5 | import crafttweaker.api.item.IItemStack; 6 | import stanhebben.zenscript.annotations.ZenClass; 7 | import stanhebben.zenscript.annotations.ZenGetter; 8 | import stanhebben.zenscript.annotations.ZenMethod; 9 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * @author youyihj 15 | */ 16 | 17 | @SidedZenRegister 18 | @ZenClass("mods.randomtweaker.vanilla.IItemAttributeModificationEvent") 19 | public interface IItemAttributeModificationEvent { 20 | @ZenGetter("item") 21 | @ZenMethod 22 | IItemStack getItem(); 23 | 24 | @ZenGetter("slot") 25 | @ZenMethod 26 | IEntityEquipmentSlot getSlot(); 27 | 28 | @ZenMethod 29 | List getModifier(String name); 30 | 31 | @ZenMethod 32 | void putModifier(String name, IEntityAttributeModifier modifier); 33 | 34 | @ZenMethod 35 | void removeModifier(String name, String uuid); 36 | 37 | @ZenMethod 38 | void clearModifier(String name); 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/mana/item/tool/IIsUsesManaItemRepresentation.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.mana.item.tool; 2 | 3 | import ink.ikx.rt.api.mods.contenttweaker.function.mana.IisUsesMana; 4 | import ink.ikx.rt.api.mods.contenttweaker.mana.item.IManaItemRepresentation; 5 | import stanhebben.zenscript.annotations.ZenClass; 6 | import stanhebben.zenscript.annotations.ZenMethod; 7 | import stanhebben.zenscript.annotations.ZenProperty; 8 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 9 | 10 | /** 11 | * @author superhelo 12 | */ 13 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 14 | @ZenClass("mods.randomtweaker.cote.ManaUsingItem") 15 | public abstract class IIsUsesManaItemRepresentation extends IManaItemRepresentation { 16 | 17 | @ZenProperty 18 | public IisUsesMana usesMana; 19 | 20 | @ZenMethod 21 | public IisUsesMana getUsesMana() { 22 | return usesMana; 23 | } 24 | 25 | @ZenMethod 26 | public void setUsesMana(IisUsesMana usesMana) { 27 | this.usesMana = usesMana; 28 | } 29 | 30 | @Override 31 | public String getTypeName() { 32 | return "ManaUsingItem"; 33 | } 34 | 35 | @Override 36 | public abstract void register(); 37 | 38 | } -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/contenttweaker/potion/MCPotionRepresentation.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.contenttweaker.potion; 2 | 3 | import crafttweaker.CraftTweakerAPI; 4 | import ink.ikx.rt.api.mods.contenttweaker.potion.IPotionRepresentation; 5 | import ink.ikx.rt.impl.internal.event.EventRegister; 6 | import net.minecraft.potion.Potion; 7 | 8 | import java.text.MessageFormat; 9 | 10 | public class MCPotionRepresentation extends IPotionRepresentation { 11 | 12 | public MCPotionRepresentation(int liquidColor, String unlocalizedName) { 13 | super(liquidColor, unlocalizedName); 14 | } 15 | 16 | @Override 17 | public void register() { 18 | if (!EventRegister.POTION_MAP.containsKey(unlocalizedName)) { 19 | EventRegister.POTION_MAP.put(unlocalizedName, new MCPotionContent(this)); 20 | } else { 21 | CraftTweakerAPI.getLogger().logError(MessageFormat.format( 22 | "All Potion must be unique. Key: contenttweaker:{0} is not.", unlocalizedName) 23 | , new UnsupportedOperationException()); 24 | } 25 | } 26 | 27 | @Override 28 | public Potion getInternal() { 29 | return EventRegister.POTION_MAP.get(unlocalizedName); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/internal/utils/MCTileData.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.internal.utils; 2 | 3 | import crafttweaker.api.data.IData; 4 | import crafttweaker.mc1120.data.NBTConverter; 5 | import ink.ikx.rt.api.internal.utils.ITileData; 6 | import net.minecraft.nbt.NBTTagCompound; 7 | 8 | public class MCTileData implements ITileData { 9 | 10 | private final NBTTagCompound nbtTagCompound = new NBTTagCompound(); 11 | 12 | public void readFromNBT(NBTTagCompound nbt) { 13 | this.nbtTagCompound.merge(nbt); 14 | } 15 | 16 | public NBTTagCompound writeToNBT(NBTTagCompound nbt) { 17 | nbt.merge(this.nbtTagCompound); 18 | return nbt; 19 | } 20 | 21 | @Override 22 | public IData getData() { 23 | return NBTConverter.from(this.writeToNBT(new NBTTagCompound()), true); 24 | } 25 | 26 | @Override 27 | public void setData(IData data) { 28 | ITileData.checkDataMap(data); 29 | this.readFromNBT((NBTTagCompound) NBTConverter.from(data)); 30 | } 31 | 32 | @Override 33 | public NBTTagCompound serializeNBT() { 34 | return nbtTagCompound; 35 | } 36 | 37 | @Override 38 | public void deserializeNBT(NBTTagCompound nbt) { 39 | this.nbtTagCompound.merge(nbt); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/internal/event/EventRegister.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.internal.event; 2 | 3 | import com.google.common.collect.Maps; 4 | import ink.ikx.rt.impl.mods.contenttweaker.potion.MCPotionContent; 5 | import net.minecraft.potion.Potion; 6 | import net.minecraft.potion.PotionType; 7 | import net.minecraftforge.event.RegistryEvent; 8 | import net.minecraftforge.fml.common.Mod; 9 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 10 | import net.minecraftforge.registries.IForgeRegistry; 11 | 12 | import java.util.Map; 13 | 14 | @Mod.EventBusSubscriber 15 | public class EventRegister { 16 | 17 | public static final Map POTION_MAP = Maps.newHashMap(); 18 | public static final Map POTION_TYPE_MAP = Maps.newHashMap(); 19 | 20 | @SubscribeEvent 21 | public static void onPotionReg(RegistryEvent.Register event) { 22 | IForgeRegistry registry = event.getRegistry(); 23 | POTION_MAP.values().forEach(registry::register); 24 | } 25 | 26 | @SubscribeEvent 27 | public static void onPotionTypeReg(RegistryEvent.Register event) { 28 | IForgeRegistry registry = event.getRegistry(); 29 | POTION_TYPE_MAP.values().forEach(registry::register); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/internal/utils/IInputPattern.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.internal.utils; 2 | 3 | import crafttweaker.api.item.IIngredient; 4 | import ink.ikx.rt.impl.internal.utils.MCInputPattern; 5 | 6 | import stanhebben.zenscript.annotations.ZenClass; 7 | import stanhebben.zenscript.annotations.ZenMethod; 8 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 9 | 10 | import java.util.Map; 11 | 12 | 13 | @SidedZenRegister 14 | @ZenClass("mods.randomtweaker.utils.IInputPattern") 15 | public interface IInputPattern { 16 | 17 | @ZenMethod 18 | static IInputPattern create(String... pattern) { 19 | return new MCInputPattern(pattern); 20 | } 21 | 22 | @ZenMethod 23 | static IInputPattern inputPattern(String... pattern) { 24 | return create(pattern); 25 | } 26 | 27 | @ZenMethod 28 | static IIngredient[][] inputPatternGet(String[] pattern, Map mapping) { 29 | return create(pattern).transform(mapping).get(); 30 | } 31 | 32 | @ZenMethod 33 | IInputPattern with(String character, IIngredient ingredient); 34 | 35 | @ZenMethod 36 | IInputPattern transform(Map mapping); 37 | 38 | @ZenMethod 39 | IIngredient[][] get(); 40 | 41 | @ZenMethod 42 | IIngredient[] getWithShapeless(); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/subtile/ExpandWorldForSubTile.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.subtile; 2 | 3 | import crafttweaker.api.minecraft.CraftTweakerMC; 4 | import crafttweaker.api.world.IBlockPos; 5 | import crafttweaker.api.world.IWorld; 6 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 7 | 8 | import net.minecraft.tileentity.TileEntity; 9 | import stanhebben.zenscript.annotations.ZenExpansion; 10 | import stanhebben.zenscript.annotations.ZenMethod; 11 | import vazkii.botania.api.subtile.ISubTileContainer; 12 | import vazkii.botania.api.subtile.SubTileEntity; 13 | 14 | 15 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 16 | @ZenExpansion("crafttweaker.world.IWorld") 17 | public abstract class ExpandWorldForSubTile { 18 | 19 | @ZenMethod 20 | public static ISubTileEntityInGame getSubTileEntityInGame(IWorld world, IBlockPos pos) { 21 | TileEntity te = CraftTweakerMC.getWorld(world).getTileEntity(CraftTweakerMC.getBlockPos(pos)); 22 | if (te instanceof ISubTileContainer) { 23 | SubTileEntity subtile = ((ISubTileContainer) te).getSubTile(); 24 | if (subtile instanceof ISubTileEntityInGame) { 25 | return (ISubTileEntityInGame) subtile; 26 | } 27 | } 28 | return null; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/ExpandVanillaFactory.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | import ink.ikx.rt.api.mods.contenttweaker.potion.IPotionRepresentation; 5 | import ink.ikx.rt.api.mods.contenttweaker.potion.IPotionTypeRepresentation; 6 | import ink.ikx.rt.impl.mods.contenttweaker.potion.MCPotionRepresentation; 7 | import ink.ikx.rt.impl.mods.contenttweaker.potion.MCPotionTypeRepresentation; 8 | 9 | import stanhebben.zenscript.annotations.ZenClass; 10 | import stanhebben.zenscript.annotations.ZenExpansion; 11 | import stanhebben.zenscript.annotations.ZenMethodStatic; 12 | 13 | 14 | @SidedZenRegister(modDeps = "contenttweaker") 15 | @ZenExpansion("mods.contenttweaker.VanillaFactory") 16 | @ZenClass("mods.randomtweaker.cote.VanillaFactoryExpansion") 17 | public abstract class ExpandVanillaFactory { 18 | 19 | @ZenMethodStatic 20 | public static IPotionRepresentation createPotion(String unlocalizedName, int color) { 21 | return new MCPotionRepresentation(color, unlocalizedName); 22 | } 23 | 24 | @ZenMethodStatic 25 | public static IPotionTypeRepresentation createPotionType(String unlocalizedName, IPotionRepresentation potion) { 26 | return new MCPotionTypeRepresentation(unlocalizedName, potion); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/jei/impl/elemenet/MCJeiElementLiquid.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.jei.impl.elemenet; 2 | 3 | import ink.ikx.rt.api.mods.jei.elements.IJeiElements; 4 | import ink.ikx.rt.impl.mods.jei.JeiPlugin; 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraft.client.gui.Gui; 7 | import net.minecraft.util.ResourceLocation; 8 | 9 | public class MCJeiElementLiquid extends IJeiElements.IJeiElementLiquid { 10 | 11 | public MCJeiElementLiquid(int x, int y, int width, int height) { 12 | super(x, y, width, height); 13 | } 14 | 15 | public MCJeiElementLiquid(String elementName, int x, int y, int width, int height) { 16 | super(elementName, x, y, width, height); 17 | } 18 | 19 | @Override 20 | public void render(Minecraft minecraft) { 21 | minecraft.getTextureManager().bindTexture(new ResourceLocation(JeiPlugin.DEFAULT_TEXTURE)); 22 | if (width == 16 && height == 16) { 23 | render(18, 0); 24 | } else if (width == 34 && height == 16) { 25 | render(0, 18); 26 | } else if (width == 16 && height == 34) { 27 | render(0, 36); 28 | } 29 | } 30 | 31 | private void render(int u, int v) { 32 | Gui.drawModalRectWithCustomSizedTexture(x - 1, y - 1, u, v, width + 2, height + 2, 256, 256); 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/internal/utils/ITileData.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.internal.utils; 2 | 3 | import crafttweaker.CraftTweakerAPI; 4 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 5 | import crafttweaker.api.data.DataMap; 6 | import crafttweaker.api.data.IData; 7 | 8 | import net.minecraft.nbt.NBTTagCompound; 9 | import net.minecraftforge.common.util.INBTSerializable; 10 | import stanhebben.zenscript.annotations.ZenClass; 11 | import stanhebben.zenscript.annotations.ZenGetter; 12 | import stanhebben.zenscript.annotations.ZenSetter; 13 | 14 | /** 15 | * @author youyihj 16 | *
Mit LICENSE 17 | *
by -> https://github.com/friendlyhj/ZenUtils/blob/master/src/main/java/youyihj/zenutils/api/cotx/tile/TileData.java 18 | */ 19 | 20 | @SidedZenRegister(modDeps = "contenttweaker") 21 | @ZenClass("mods.randomtweaker.utils.ITileData") 22 | public interface ITileData extends INBTSerializable { 23 | 24 | static void checkDataMap(IData data) { 25 | if (!(data instanceof DataMap)) { 26 | CraftTweakerAPI.logError("data argument must be DataMap", new IllegalArgumentException()); 27 | } 28 | } 29 | 30 | void readFromNBT(NBTTagCompound nbt); 31 | 32 | NBTTagCompound writeToNBT(NBTTagCompound nbt); 33 | 34 | @ZenGetter("data") 35 | IData getData(); 36 | 37 | @ZenSetter("data") 38 | void setData(IData data); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/botania/event/ElvenTradeEvent.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.botania.event; 2 | 3 | import ink.ikx.rt.api.mods.botania.ITileAlfPortal; 4 | import ink.ikx.rt.impl.internal.event.BaseEvent; 5 | import ink.ikx.rt.impl.internal.utils.InternalUtils; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 8 | 9 | import java.util.List; 10 | 11 | @Cancelable 12 | public class ElvenTradeEvent extends BaseEvent { 13 | 14 | private final ITileAlfPortal alfPortal; 15 | private final List input; 16 | 17 | private List output; 18 | 19 | public ElvenTradeEvent(ITileAlfPortal alfPortal, List input, List output) { 20 | this.alfPortal = alfPortal; 21 | this.input = InternalUtils.getItemStackListCopy(input); 22 | this.output = InternalUtils.getItemStackListCopy(output); 23 | } 24 | 25 | public ITileAlfPortal getAlfPortal() { 26 | return alfPortal; 27 | } 28 | 29 | public List getInput() { 30 | return input; 31 | } 32 | 33 | public List getOutput() { 34 | return output; 35 | } 36 | 37 | public void setOutput(List stacks) { 38 | this.output = stacks; 39 | } 40 | 41 | public void addOutput(ItemStack stack) { 42 | this.output.add(stack); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/thaumcraft/DreamJournalEvent.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.thaumcraft; 2 | 3 | import ink.ikx.rt.impl.internal.config.RTConfig; 4 | import net.minecraft.entity.player.EntityPlayer; 5 | import net.minecraft.world.World; 6 | import net.minecraftforge.event.entity.player.EntityItemPickupEvent; 7 | import net.minecraftforge.fml.common.eventhandler.EventPriority; 8 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 9 | import thaumcraft.api.capabilities.IPlayerKnowledge; 10 | import thaumcraft.api.capabilities.ThaumcraftCapabilities; 11 | import thaumcraft.common.items.resources.ItemCrystalEssence; 12 | 13 | public class DreamJournalEvent { 14 | 15 | @SubscribeEvent(priority = EventPriority.HIGH) 16 | public static void onItemPickup(EntityItemPickupEvent event) { 17 | EntityPlayer player = event.getEntityPlayer(); 18 | World world = player.getEntityWorld(); 19 | if (RTConfig.Thaumcraft.DreamJournal && !world.isRemote && event.getItem() != null) { 20 | IPlayerKnowledge knowledge = ThaumcraftCapabilities.getKnowledge(player); 21 | String gotdream = "!gotdream"; 22 | if ((event.getItem().getItem().getItem() instanceof ItemCrystalEssence && 23 | !knowledge.isResearchKnown(gotdream))) { 24 | knowledge.addResearch(gotdream); 25 | } 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/jei/slots/IJeiSlot.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.jei.slots; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraftforge.fml.relauncher.Side; 7 | import net.minecraftforge.fml.relauncher.SideOnly; 8 | import stanhebben.zenscript.annotations.ZenClass; 9 | import stanhebben.zenscript.annotations.ZenProperty; 10 | 11 | 12 | @SidedZenRegister(modDeps = "jei") 13 | @ZenClass("mods.randomtweaker.jei.IJeiSlot") 14 | public abstract class IJeiSlot { 15 | 16 | @ZenProperty 17 | public int x; 18 | 19 | @ZenProperty 20 | public int y; 21 | 22 | @ZenProperty 23 | public boolean isInput; 24 | 25 | @ZenProperty 26 | public boolean hasBase; 27 | 28 | @ZenProperty 29 | public String slotName; 30 | 31 | protected IJeiSlot(int x, int y, boolean isInput, boolean hasBase) { 32 | this.x = x; 33 | this.y = y; 34 | this.isInput = isInput; 35 | this.hasBase = hasBase; 36 | } 37 | 38 | protected IJeiSlot(String slotName, int x, int y, boolean isInput, boolean hasBase) { 39 | this.slotName = slotName; 40 | 41 | this.x = x; 42 | this.y = y; 43 | this.isInput = isInput; 44 | this.hasBase = hasBase; 45 | } 46 | 47 | @SideOnly(Side.CLIENT) 48 | public abstract void render(Minecraft minecraft); 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/draconicevolution/IDraconicEvolutionFXHelper.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.draconicevolution; 2 | 3 | import com.brandon3055.brandonscore.client.particle.BCEffectHandler; 4 | import com.brandon3055.brandonscore.lib.Vec3D; 5 | import crafttweaker.CraftTweakerAPI; 6 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 7 | import crafttweaker.api.minecraft.CraftTweakerMC; 8 | import crafttweaker.api.world.IVector3d; 9 | 10 | import stanhebben.zenscript.annotations.ZenClass; 11 | import stanhebben.zenscript.annotations.ZenMethod; 12 | 13 | /** 14 | * @author youyihj 15 | */ 16 | 17 | @SidedZenRegister(modDeps = "draconicevolution") 18 | @ZenClass("mods.randomtweaker.draconicevolution.IDraconicEvolutionFXHelper") 19 | public class IDraconicEvolutionFXHelper { 20 | @ZenMethod 21 | public static void spawnFX(int particleID, IVector3d pos, IVector3d speed, double viewRange, int... args) { 22 | Vec3D posA = new Vec3D(pos.getX(), pos.getY(), pos.getZ()); 23 | Vec3D speedA = new Vec3D(speed.getX(), speed.getY(), speed.getZ()); 24 | BCEffectHandler.spawnFX(particleID, CraftTweakerMC.getWorld(CraftTweakerAPI.client.getPlayer().getWorld()), posA, speedA, viewRange, args); 25 | } 26 | 27 | @ZenMethod 28 | public static void spawnFX(int particleID, IVector3d pos, IVector3d speed, int... args) { 29 | spawnFX(particleID, pos, speed, 32, args); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/jei/JEIExpansion.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.jei; 2 | 3 | import crafttweaker.api.item.IItemStack; 4 | import crafttweaker.api.minecraft.CraftTweakerMC; 5 | import ink.ikx.rt.impl.mods.jei.JeiPlugin; 6 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 7 | import ink.ikx.rt.api.mods.jei.core.IJeiPanel; 8 | import ink.ikx.rt.api.mods.jei.core.IJeiRecipe; 9 | import net.minecraft.item.ItemStack; 10 | 11 | import ink.ikx.rt.impl.mods.jei.impl.core.MCJeiPanel; 12 | import ink.ikx.rt.impl.mods.jei.impl.core.MCJeiRecipe; 13 | import stanhebben.zenscript.annotations.ZenExpansion; 14 | import stanhebben.zenscript.annotations.ZenMethodStatic; 15 | 16 | import java.util.Objects; 17 | 18 | @SidedZenRegister(modDeps = "jei") 19 | @ZenExpansion("mods.jei.JEI") 20 | public abstract class JEIExpansion { 21 | 22 | @ZenMethodStatic 23 | public static IJeiPanel createJei(String uid, String title) { 24 | return new MCJeiPanel(uid, title); 25 | } 26 | 27 | @ZenMethodStatic 28 | public static IJeiRecipe createJeiRecipe(String uid) { 29 | return new MCJeiRecipe(uid); 30 | } 31 | 32 | @ZenMethodStatic 33 | public static void addItemNBTSubtype(IItemStack stack) { 34 | ItemStack mcStack = CraftTweakerMC.getItemStack(stack); 35 | Objects.requireNonNull(mcStack.getItem()); 36 | JeiPlugin.subtypesToRegister.add(mcStack.getItem()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/classTransforms/RandomTweakerClassWriter.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.classTransforms; 2 | 3 | import net.minecraft.launchwrapper.Launch; 4 | import org.objectweb.asm.ClassWriter; 5 | 6 | /** A ClassWriter that works around weird classloading bugs caused by getCommonSuperClass. 7 | * Adapted from GottaGoFast by Thiakil. MIT License. */ 8 | public class RandomTweakerClassWriter extends ClassWriter { 9 | public RandomTweakerClassWriter(int flags) { 10 | super(flags); 11 | } 12 | protected String getCommonSuperClass(final String type1, final String type2) { 13 | Class c, d; 14 | ClassLoader classLoader = Launch.classLoader; 15 | try { 16 | c = Class.forName(type1.replace('/', '.'), false, classLoader); 17 | d = Class.forName(type2.replace('/', '.'), false, classLoader); 18 | } catch (Exception e) { 19 | throw new RuntimeException(e.toString()); 20 | } 21 | if (c.isAssignableFrom(d)) { 22 | return type1; 23 | } 24 | if (d.isAssignableFrom(c)) { 25 | return type2; 26 | } 27 | if (c.isInterface() || d.isInterface()) { 28 | return "java/lang/Object"; 29 | } else { 30 | do { 31 | c = c.getSuperclass(); 32 | } while (!c.isAssignableFrom(d)); 33 | return c.getName().replace('.', '/'); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/internal/proxy/ServerProxy.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.internal.proxy; 2 | 3 | import crafttweaker.api.item.IItemStack; 4 | import crafttweaker.api.player.IPlayer; 5 | import ink.ikx.rt.api.mods.contenttweaker.function.mana.IBaubleRender; 6 | 7 | /** 8 | * @author superhelo 9 | */ 10 | public class ServerProxy implements IProxy { 11 | 12 | @Override 13 | public void onPlayerBaubleRender(IBaubleRender render, IItemStack stack, IPlayer player, String renderType, float partialTicks) { 14 | } 15 | 16 | @Override 17 | public void rotateIfSneaking(IPlayer player) { 18 | } 19 | 20 | @Override 21 | public void translateToHeadLevel(IPlayer player) { 22 | } 23 | 24 | @Override 25 | public void translateToFace() { 26 | } 27 | 28 | @Override 29 | public void defaultTransforms() { 30 | } 31 | 32 | @Override 33 | public void translateToChest() { 34 | } 35 | 36 | @Override 37 | public void renderItem(IItemStack renderStack, String transformType) { 38 | } 39 | 40 | @Override 41 | public void bindTexture(String resourceLocation) { 42 | } 43 | 44 | @Override 45 | public void scale(double x, double y, double z) { 46 | } 47 | 48 | @Override 49 | public void rotate(float angle, float x, float y, float z) { 50 | } 51 | 52 | @Override 53 | public void translate(double x, double y, double z) { 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/jei/slots/IJeiSlotLiquid.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.jei.slots; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | 5 | import stanhebben.zenscript.annotations.ZenClass; 6 | import stanhebben.zenscript.annotations.ZenProperty; 7 | 8 | 9 | @SidedZenRegister(modDeps = "jei") 10 | @ZenClass("mods.randomtweaker.jei.IJeiSlotLiquid") 11 | public abstract class IJeiSlotLiquid extends IJeiSlot { 12 | 13 | @ZenProperty 14 | public int width; 15 | 16 | @ZenProperty 17 | public int height; 18 | 19 | @ZenProperty 20 | public int capacityMb; 21 | 22 | @ZenProperty 23 | public boolean showCapacity; 24 | 25 | protected IJeiSlotLiquid(int x, int y, boolean isInput, boolean hasBase, int width, 26 | int height, int capacityMb, boolean showCapacity) { 27 | super(x, y, isInput, hasBase); 28 | this.width = width; 29 | this.height = height; 30 | this.capacityMb = capacityMb; 31 | this.showCapacity = showCapacity; 32 | } 33 | 34 | protected IJeiSlotLiquid(String slotName, int x, int y, boolean isInput, boolean hasBase, int width, 35 | int height, int capacityMb, boolean showCapacity) { 36 | super(slotName, x, y, isInput, hasBase); 37 | 38 | this.width = width; 39 | this.height = height; 40 | this.capacityMb = capacityMb; 41 | this.showCapacity = showCapacity; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/thaumcraft/IAspect.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.thaumcraft; 2 | 3 | import crafttweaker.CraftTweakerAPI; 4 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 5 | 6 | import ink.ikx.rt.impl.mods.thaumcraft.MCAspect; 7 | import org.apache.commons.lang3.StringUtils; 8 | import stanhebben.zenscript.annotations.*; 9 | import thaumcraft.api.aspects.Aspect; 10 | 11 | 12 | @SidedZenRegister(modDeps = "thaumcraft") 13 | @ZenClass("mods.randomtweaker.thaumcraft.IAspect") 14 | public interface IAspect { 15 | 16 | static IAspect of(Aspect aspect) { 17 | return new MCAspect(aspect); 18 | } 19 | 20 | @ZenMethod 21 | static IAspect of(String name) { 22 | if (StringUtils.isAnyBlank(name) || !Aspect.aspects.containsKey(name)) { 23 | CraftTweakerAPI.logError("Invalid aspect name: " + name); 24 | return null; 25 | } 26 | return IAspect.of(Aspect.getAspect(name)); 27 | } 28 | 29 | @ZenMethod 30 | static IAspect[] getAllAspects() { 31 | return Aspect.aspects.values().stream().map(IAspect::of).toArray(IAspect[]::new); 32 | } 33 | 34 | @ZenMethod 35 | @ZenGetter("name") 36 | String getName(); 37 | 38 | @ZenMethod 39 | @ZenGetter("components") 40 | IAspect[] getComponents(); 41 | 42 | @ZenMethod 43 | @ZenGetter("chatColor") 44 | String getChatcolor(); 45 | 46 | @ZenOperator(OperatorType.EQUALS) 47 | boolean equals(IAspect other); 48 | 49 | Aspect getInternal(); 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/astralsorcery/event/CTAttunementStartEvent.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.astralsorcery.event; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | import crafttweaker.api.entity.IEntity; 5 | import crafttweaker.api.event.IEntityEvent; 6 | import crafttweaker.api.minecraft.CraftTweakerMC; 7 | import crafttweaker.api.world.IWorld; 8 | import ink.ikx.rt.impl.mods.astralsorcery.event.AttunementStartEvent; 9 | 10 | import stanhebben.zenscript.annotations.ZenClass; 11 | import stanhebben.zenscript.annotations.ZenGetter; 12 | import stanhebben.zenscript.annotations.ZenMethod; 13 | 14 | 15 | @SidedZenRegister(modDeps = "astralsorcery") 16 | @ZenClass("mods.randomtweaker.astralsorcery.AttunementStartEvent") 17 | public abstract class CTAttunementStartEvent implements IEntityEvent { 18 | 19 | private final AttunementStartEvent event; 20 | 21 | public CTAttunementStartEvent(AttunementStartEvent event) { 22 | this.event = event; 23 | } 24 | 25 | @ZenGetter("world") 26 | @ZenMethod 27 | public IWorld getWorld() { 28 | return CraftTweakerMC.getIWorld(this.event.getWorld()); 29 | } 30 | 31 | @ZenGetter("constellation") 32 | @ZenMethod 33 | public String getConstellation() { 34 | return this.event.getConstellation().getUnlocalizedName(); 35 | } 36 | 37 | //the entity being attuned 38 | @Override 39 | public IEntity getEntity() { 40 | return CraftTweakerMC.getIEntity(this.event.getInputEntity()); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/botania/ITileAlfPortal.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.botania; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | import crafttweaker.api.data.IData; 5 | import crafttweaker.api.item.IItemStack; 6 | import crafttweaker.api.world.IBlockPos; 7 | import crafttweaker.api.world.IWorld; 8 | 9 | import stanhebben.zenscript.annotations.ZenClass; 10 | import stanhebben.zenscript.annotations.ZenGetter; 11 | import stanhebben.zenscript.annotations.ZenMethod; 12 | import stanhebben.zenscript.annotations.ZenSetter; 13 | 14 | 15 | @SidedZenRegister(modDeps = "botania") 16 | @ZenClass("mods.randomtweaker.botania.AlfPortalInGame") 17 | public interface ITileAlfPortal { 18 | 19 | @ZenMethod 20 | IItemStack[] getInputList(); 21 | 22 | @ZenMethod 23 | void setInputList(IItemStack[] newList); 24 | 25 | @ZenMethod 26 | void clearInputList(); 27 | 28 | @ZenMethod 29 | void delInput(IItemStack stack); 30 | 31 | @ZenMethod 32 | void addInput(IItemStack stack); 33 | 34 | @ZenMethod 35 | boolean consumeMana(int totalCost); 36 | 37 | @ZenMethod 38 | void spawnItemStack(IItemStack stack); 39 | 40 | @ZenGetter("pos") 41 | IBlockPos getBlockPos(); 42 | 43 | @ZenGetter("world") 44 | IWorld getIWorld(); 45 | 46 | @ZenGetter("data") 47 | IData getData(); 48 | 49 | @ZenMethod 50 | @ZenSetter("data") 51 | void setData(IData data); 52 | 53 | @ZenMethod 54 | boolean isEmpty(); 55 | 56 | @ZenMethod 57 | void updateData(IData data); 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/internal/event/FTBUltimineEvent.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.internal.event; 2 | 3 | import ink.ikx.rt.Main; 4 | import ink.ikx.rt.impl.internal.capability.CapabilityRegistryHandler; 5 | import net.minecraft.entity.Entity; 6 | import net.minecraft.entity.player.EntityPlayer; 7 | import net.minecraft.util.ResourceLocation; 8 | import net.minecraftforge.event.AttachCapabilitiesEvent; 9 | import net.minecraftforge.event.entity.player.PlayerEvent; 10 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 11 | 12 | import java.util.Objects; 13 | 14 | public class FTBUltimineEvent { 15 | 16 | @SubscribeEvent 17 | public static void onAttachCapabilities(AttachCapabilitiesEvent event) { 18 | if (event.getObject() instanceof EntityPlayer) { 19 | CapabilityRegistryHandler.FTBUltimineTagProvider provider = new CapabilityRegistryHandler.FTBUltimineTagProvider(); 20 | event.addCapability(new ResourceLocation(Main.MODID + ":ftb_ultimine_tag"), provider); 21 | } 22 | } 23 | 24 | @SubscribeEvent 25 | public static void onPlayerClone(PlayerEvent.Clone event) { 26 | CapabilityRegistryHandler.FTBUltimineTag original = event.getOriginal().getCapability(CapabilityRegistryHandler.FTB_ULTIMINE_CAPABILITY, null); 27 | CapabilityRegistryHandler.FTBUltimineTag instance = event.getEntityPlayer().getCapability(CapabilityRegistryHandler.FTB_ULTIMINE_CAPABILITY, null); 28 | 29 | Objects.requireNonNull(instance).setAllow(Objects.requireNonNull(original).isAllow()); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/botania/event/AlfPortalDroppedEvent.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.botania.event; 2 | 3 | import ink.ikx.rt.api.mods.botania.ITileAlfPortal; 4 | import ink.ikx.rt.impl.internal.event.BaseEvent; 5 | import net.minecraft.entity.item.EntityItem; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 8 | 9 | import java.util.List; 10 | import java.util.Objects; 11 | 12 | @Cancelable 13 | public class AlfPortalDroppedEvent extends BaseEvent { 14 | 15 | private final EntityItem input; 16 | private final ITileAlfPortal alfPortal; 17 | 18 | private boolean isDead = true; 19 | private List output; 20 | 21 | public AlfPortalDroppedEvent(EntityItem input, ITileAlfPortal alfPortal) { 22 | this.input = input; 23 | this.alfPortal = alfPortal; 24 | } 25 | 26 | public EntityItem getInput() { 27 | return input; 28 | } 29 | 30 | public ITileAlfPortal getAlfPortal() { 31 | return alfPortal; 32 | } 33 | 34 | public List getOutput() { 35 | return output; 36 | } 37 | 38 | public void setOutput(List output) { 39 | this.output = output; 40 | } 41 | 42 | public void addOutput(ItemStack output) { 43 | if (Objects.nonNull(this.output)) { 44 | this.output.add(output); 45 | } 46 | } 47 | 48 | public boolean isDead() { 49 | return isDead; 50 | } 51 | 52 | public void setDead(boolean dead) { 53 | isDead = dead; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/mana/IManaItem.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.mana; 2 | 3 | import crafttweaker.api.item.IItemStack; 4 | import crafttweaker.api.world.IBlockPos; 5 | import crafttweaker.api.world.IWorld; 6 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 7 | 8 | import stanhebben.zenscript.annotations.ZenClass; 9 | import stanhebben.zenscript.annotations.ZenGetter; 10 | import stanhebben.zenscript.annotations.ZenMethod; 11 | 12 | /** 13 | * @author superhelo 14 | */ 15 | 16 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 17 | @ZenClass("mods.randomtweaker.item.IManaItem") 18 | public interface IManaItem { 19 | 20 | @ZenGetter("mana") 21 | int getMana(); 22 | 23 | @ZenGetter("maxMana") 24 | int getMaxMana(); 25 | 26 | @ZenGetter("noExport") 27 | boolean isNoExport(); 28 | 29 | @ZenGetter("hasFull") 30 | boolean hasFull(); 31 | 32 | @ZenGetter("hasCreative") 33 | boolean hasCreative(); 34 | 35 | @ZenGetter("creative") 36 | boolean isCreative(); 37 | 38 | @ZenGetter("full") 39 | boolean isFull(); 40 | 41 | @ZenGetter("isUseMana") 42 | boolean getUseMana(); 43 | 44 | @ZenMethod 45 | boolean canExportManaToPool(IWorld world, IBlockPos pos); 46 | 47 | @ZenMethod 48 | boolean canExportManaToItem(IItemStack otherStack); 49 | 50 | @ZenMethod 51 | boolean canReceiveManaFromPool(IWorld world, IBlockPos pos); 52 | 53 | @ZenMethod 54 | boolean canReceiveManaFromItem(IItemStack otherStack); 55 | 56 | @ZenMethod 57 | int updateMana(int mana); 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/potion/IPotionRepresentation.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.potion; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | import ink.ikx.rt.api.mods.contenttweaker.function.IPotionIsReady; 5 | import ink.ikx.rt.api.mods.contenttweaker.function.IPotionPerformEffect; 6 | 7 | import net.minecraft.potion.Potion; 8 | import stanhebben.zenscript.annotations.ZenClass; 9 | import stanhebben.zenscript.annotations.ZenMethod; 10 | import stanhebben.zenscript.annotations.ZenProperty; 11 | 12 | 13 | @SidedZenRegister(modDeps = "contenttweaker") 14 | @ZenClass("mods.randomtweaker.cote.IPotion") 15 | public abstract class IPotionRepresentation { 16 | 17 | public final int liquidColor; 18 | public final String unlocalizedName; 19 | 20 | @ZenProperty 21 | public boolean instant; 22 | @ZenProperty 23 | public boolean badEffectIn; 24 | @ZenProperty 25 | public boolean beneficial = true; 26 | @ZenProperty 27 | public boolean shouldRender = true; 28 | @ZenProperty 29 | public boolean shouldRenderHUD = true; 30 | @ZenProperty 31 | public IPotionIsReady isReady = null; 32 | @ZenProperty 33 | public IPotionPerformEffect performEffect; 34 | @ZenProperty 35 | public IPotionPerformEffect affectEntity; 36 | 37 | protected IPotionRepresentation(int liquidColor, String unlocalizedName) { 38 | this.liquidColor = liquidColor; 39 | this.unlocalizedName = unlocalizedName; 40 | } 41 | 42 | @ZenMethod 43 | public abstract void register(); 44 | 45 | public abstract Potion getInternal(); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/thaumcraft/expand/ExpandIAspectList.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.thaumcraft.expand; 2 | 3 | import com.blamejared.compat.thaumcraft.handlers.aspects.CTAspectStack; 4 | import ink.ikx.rt.api.mods.thaumcraft.IAspectList; 5 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 6 | 7 | import stanhebben.zenscript.annotations.ZenClass; 8 | import stanhebben.zenscript.annotations.ZenExpansion; 9 | import stanhebben.zenscript.annotations.ZenMethod; 10 | 11 | 12 | @SidedZenRegister(modDeps = {"thaumcraft", "modtweaker"}) 13 | @ZenExpansion("mods.randomtweaker.thaumcraft.IAspectList") 14 | @ZenClass("mods.randomtweaker.thaumcraft.expand.IAspectList") 15 | public abstract class ExpandIAspectList { 16 | 17 | @ZenMethod 18 | public static IAspectList add(IAspectList internal, CTAspectStack in) { 19 | internal.getInternal().add(in.getInternal().getInternal(), in.getAmount()); 20 | return internal; 21 | } 22 | 23 | @ZenMethod 24 | public static boolean reduce(IAspectList internal, CTAspectStack key) { 25 | return internal.getInternal().reduce(key.getInternal().getInternal(), key.getAmount()); 26 | } 27 | 28 | @ZenMethod 29 | public static IAspectList remove(IAspectList internal, CTAspectStack key) { 30 | internal.getInternal().remove(key.getInternal().getInternal(), key.getAmount()); 31 | return internal; 32 | } 33 | 34 | @ZenMethod 35 | public static IAspectList merge(IAspectList internal, CTAspectStack in) { 36 | internal.getInternal().merge(in.getInternal().getInternal(), in.getAmount()); 37 | return internal; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/astralsorcery/CustomAttunementRecipe.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.astralsorcery; 2 | 3 | import crafttweaker.api.item.IIngredient; 4 | import crafttweaker.api.item.IItemStack; 5 | import crafttweaker.api.minecraft.CraftTweakerMC; 6 | import hellfirepvp.astralsorcery.common.constellation.IConstellation; 7 | import net.minecraft.item.ItemStack; 8 | 9 | import java.util.ArrayList; 10 | 11 | public class CustomAttunementRecipe { 12 | 13 | public static ArrayList allRecipes = new ArrayList<>(); 14 | 15 | final IConstellation constellation; 16 | final IIngredient original; 17 | final ItemStack result; 18 | 19 | public CustomAttunementRecipe(IConstellation c, IIngredient o, IItemStack r) { 20 | this.constellation = c; 21 | this.original = o; 22 | this.result = CraftTweakerMC.getItemStack(r); 23 | } 24 | 25 | public boolean canDoRecipe(IConstellation c, ItemStack stack) { 26 | //System.out.println(this.original+": checking against " + stack.toString()); 27 | if (this.constellation == null) { 28 | return this.original.matches(CraftTweakerMC.getIItemStack(stack)); 29 | } else { 30 | return (this.original.matches(CraftTweakerMC.getIItemStack(stack)) && 31 | c.equals(this.constellation)); 32 | } 33 | } 34 | 35 | public IConstellation getConstellation() { 36 | return constellation; 37 | } 38 | 39 | public IIngredient getOriginal() { 40 | return original; 41 | } 42 | 43 | public ItemStack getResult() { 44 | return result; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/jei/impl/elemenet/MCJeiElementManaBar.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.jei.impl.elemenet; 2 | 3 | import ink.ikx.rt.api.mods.jei.elements.IJeiElements; 4 | import net.minecraft.client.Minecraft; 5 | import vazkii.botania.client.core.handler.HUDHandler; 6 | import vazkii.botania.common.block.tile.mana.TilePool; 7 | 8 | public class MCJeiElementManaBar extends IJeiElements.IJeiElementManaBar { 9 | 10 | public int multiplesLog = 0; 11 | public int manaMax = TilePool.MAX_MANA_DILLUTED; 12 | 13 | public MCJeiElementManaBar(int x, int y, int mode, int mana) { 14 | super(x, y, mode, mana); 15 | } 16 | 17 | public MCJeiElementManaBar(String elementName, int x, int y, int mode, int mana) { 18 | super(elementName, x, y, mode, mana); 19 | } 20 | 21 | @Override 22 | public void render(Minecraft minecraft) { 23 | handlerMode(mode); 24 | HUDHandler.renderManaBar(x, y, 0x0000FF, 0.75F, mana, manaMax); 25 | String sign = "x"; 26 | if (multiplesLog < 0) 27 | sign = "/"; 28 | if (multiplesLog != 0) 29 | minecraft.fontRenderer.drawString(sign + Math.pow(10, Math.abs(multiplesLog)), x + 103, y - 2, 0x8B8B8B); 30 | } 31 | 32 | private void handlerMode(int mode) { 33 | if (mode == 1) { 34 | for (; mana > manaMax; manaMax *= 10) 35 | multiplesLog += 1; 36 | for (; (manaMax / mana > 50); manaMax /= 10) 37 | multiplesLog -= 1; 38 | } else { 39 | manaMax = TilePool.MAX_MANA / 10; 40 | multiplesLog = 0; 41 | } 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/contenttweaker/potion/MCPotionTypeRepresentation.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.contenttweaker.potion; 2 | 3 | import com.teamacronymcoders.contenttweaker.ContentTweaker; 4 | import crafttweaker.CraftTweakerAPI; 5 | import ink.ikx.rt.api.mods.contenttweaker.potion.IPotionRepresentation; 6 | import ink.ikx.rt.api.mods.contenttweaker.potion.IPotionTypeRepresentation; 7 | import ink.ikx.rt.impl.internal.event.EventRegister; 8 | import net.minecraft.potion.PotionEffect; 9 | import net.minecraft.potion.PotionType; 10 | 11 | import java.text.MessageFormat; 12 | 13 | public class MCPotionTypeRepresentation extends IPotionTypeRepresentation { 14 | 15 | public MCPotionTypeRepresentation(String unlocalizedName, IPotionRepresentation potion) { 16 | super(unlocalizedName, potion); 17 | } 18 | 19 | @Override 20 | public void register() { 21 | if (potion.instant) duration = 0; 22 | 23 | PotionType potionType = new PotionType(ContentTweaker.MOD_ID + "." + unlocalizedName, 24 | new PotionEffect(potion.getInternal(), duration, amplifier)) 25 | .setRegistryName(ContentTweaker.MOD_ID, unlocalizedName); 26 | 27 | if (!EventRegister.POTION_TYPE_MAP.containsKey(unlocalizedName)) { 28 | EventRegister.POTION_TYPE_MAP.put(unlocalizedName, potionType); 29 | } else { 30 | CraftTweakerAPI.getLogger().logError(MessageFormat.format( 31 | "All PotionTypes must be unique. Key: contenttweaker:{0} is not.", unlocalizedName) 32 | , new UnsupportedOperationException()); 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/subtile/generating/ISubTileEntityGeneratingRepresentation.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.subtile.generating; 2 | 3 | import ink.ikx.rt.api.mods.contenttweaker.function.subtile.CanGeneratePassively; 4 | import ink.ikx.rt.api.mods.contenttweaker.function.subtile.PopulateDropStackNBTs; 5 | import ink.ikx.rt.api.mods.contenttweaker.subtile.ISubTileEntityRepresentation; 6 | import stanhebben.zenscript.annotations.ZenClass; 7 | import stanhebben.zenscript.annotations.ZenMethod; 8 | import stanhebben.zenscript.annotations.ZenProperty; 9 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 10 | 11 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 12 | @ZenClass("mods.randomtweaker.cote.ISubTileEntityGenerating") 13 | public abstract class ISubTileEntityGeneratingRepresentation extends ISubTileEntityRepresentation { 14 | 15 | private static final String TYPE_NAME = "generating"; 16 | 17 | @ZenProperty 18 | public boolean passiveFlower; 19 | @ZenProperty 20 | public int valueForPassiveGeneration = 1; 21 | @ZenProperty 22 | public int delayBetweenPassiveGeneration = 20; 23 | @ZenProperty 24 | public boolean shouldSyncPassiveGeneration; 25 | @ZenProperty 26 | public PopulateDropStackNBTs populateDropStackNBTs; 27 | @ZenProperty 28 | public CanGeneratePassively canGeneratePassively; 29 | 30 | protected ISubTileEntityGeneratingRepresentation(int color, String unlocalizedName) { 31 | super(color, unlocalizedName); 32 | } 33 | 34 | @ZenMethod 35 | public void register() { 36 | this.register(TYPE_NAME, false); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/jei/core/IJeiPanel.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.jei.core; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | import crafttweaker.api.item.IItemStack; 5 | import ink.ikx.rt.api.mods.jei.elements.IJeiElement; 6 | import ink.ikx.rt.api.mods.jei.slots.IJeiSlot; 7 | 8 | import stanhebben.zenscript.annotations.ZenClass; 9 | import stanhebben.zenscript.annotations.ZenMethod; 10 | 11 | 12 | @SidedZenRegister(modDeps = "jei") 13 | @ZenClass("mods.randomtweaker.jei.IJeiPanel") 14 | public interface IJeiPanel { 15 | 16 | @ZenMethod 17 | IJeiPanel setModid(String modid); 18 | 19 | @ZenMethod 20 | IJeiPanel setIcon(IItemStack icon); 21 | 22 | @ZenMethod 23 | IJeiPanel addSlot(IJeiSlot slot); 24 | 25 | @ZenMethod 26 | IJeiPanel setSlots(IJeiSlot[] slots); 27 | 28 | @ZenMethod 29 | IJeiPanel onTooltip(IJeiTooltip tooltip); 30 | 31 | @ZenMethod 32 | IJeiPanel addElement(IJeiElement elements); 33 | 34 | @ZenMethod 35 | IJeiPanel setElements(IJeiElement[] elements); 36 | 37 | @ZenMethod 38 | IJeiPanel addRecipeCatalyst(IItemStack stack); 39 | 40 | @ZenMethod 41 | IJeiPanel setRecipeCatalysts(IItemStack[] stacks); 42 | 43 | @ZenMethod 44 | IJeiPanel setBackground(IJeiBackground background); 45 | 46 | @ZenMethod 47 | IJeiSlot[] getJeiSlots(); 48 | 49 | @ZenMethod 50 | IJeiSlot getJeiSlot(String slotName); 51 | 52 | @ZenMethod 53 | IJeiElement[] getJeiElements(); 54 | 55 | @ZenMethod 56 | IJeiElement getJeiElement(String elementName); 57 | 58 | @ZenMethod 59 | void register(); 60 | 61 | void register_(); 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/naturesaura/MCAuraChunk.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.naturesaura; 2 | 3 | import crafttweaker.api.minecraft.CraftTweakerMC; 4 | import crafttweaker.api.world.IBlockPos; 5 | import crafttweaker.api.world.IWorld; 6 | import ink.ikx.rt.api.mods.naturesaura.IAuraChunk; 7 | 8 | public class MCAuraChunk implements IAuraChunk { 9 | 10 | private final de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk auraChunk; 11 | 12 | public MCAuraChunk(IWorld world, IBlockPos pos) { 13 | this.auraChunk = de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk.getAuraChunk( 14 | CraftTweakerMC.getWorld(world), CraftTweakerMC.getBlockPos(pos)); 15 | } 16 | 17 | @Override 18 | public int drainAura(IBlockPos pos, int amount) { 19 | return auraChunk.drainAura(CraftTweakerMC.getBlockPos(pos), amount); 20 | } 21 | 22 | @Override 23 | public int drainAura(IBlockPos pos, int amount, boolean aimForZero, boolean simulate) { 24 | return auraChunk.drainAura(CraftTweakerMC.getBlockPos(pos), amount, aimForZero, simulate); 25 | } 26 | 27 | @Override 28 | public int storeAura(IBlockPos pos, int amount) { 29 | return auraChunk.storeAura(CraftTweakerMC.getBlockPos(pos), amount); 30 | } 31 | 32 | @Override 33 | public int storeAura(IBlockPos pos, int amount, boolean aimForZero, boolean simulate) { 34 | return auraChunk.storeAura(CraftTweakerMC.getBlockPos(pos), amount, aimForZero, simulate); 35 | } 36 | 37 | @Override 38 | public int getDrainSpot(IBlockPos pos) { 39 | return auraChunk.getDrainSpot(CraftTweakerMC.getBlockPos(pos)); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/jei/impl/elemenet/MCJeiElementArrow.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.jei.impl.elemenet; 2 | 3 | import crafttweaker.CraftTweakerAPI; 4 | import ink.ikx.rt.api.mods.jei.elements.IJeiElements; 5 | import ink.ikx.rt.impl.mods.jei.JeiPlugin; 6 | import net.minecraft.client.Minecraft; 7 | import net.minecraft.client.gui.Gui; 8 | import net.minecraft.util.ResourceLocation; 9 | 10 | public class MCJeiElementArrow extends IJeiElements.IJeiElementArrow { 11 | 12 | public MCJeiElementArrow(int x, int y, int direction) { 13 | super(x, y, direction); 14 | } 15 | 16 | public MCJeiElementArrow(String elementName, int x, int y, int direction) { 17 | super(elementName, x, y, direction); 18 | } 19 | 20 | @Override 21 | public void render(Minecraft minecraft) { 22 | minecraft.getTextureManager().bindTexture(new ResourceLocation(JeiPlugin.DEFAULT_TEXTURE)); 23 | switch (direction) { 24 | case 0: 25 | render(36, 0, 22, 15); 26 | break; 27 | case 1: 28 | render(36, 16, 22, 15); 29 | break; 30 | case 2: 31 | render(64, 0, 15, 22); 32 | break; 33 | case 3: 34 | render(64, 32, 15, 22); 35 | break; 36 | default: 37 | CraftTweakerAPI.getLogger().logError("The direction isn't exist."); 38 | break; 39 | } 40 | } 41 | 42 | private void render(int u, int v, int width, int height) { 43 | Gui.drawModalRectWithCustomSizedTexture(x, y, u, v, width, height, 256, 256); 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/botania/module/SubTileOrechidManager.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.botania.module; 2 | 3 | import net.minecraft.block.state.IBlockState; 4 | 5 | import java.util.*; 6 | 7 | public class SubTileOrechidManager { 8 | 9 | public static final Map> oreWeights = new HashMap<>(); 10 | 11 | public static void addOreWeight(IBlockState state, String ore, Integer weight) { 12 | if (oreWeights.containsKey(state)) { 13 | Map map = new HashMap<>(); 14 | map.put(ore, weight); 15 | Objects.requireNonNull(map).putAll(oreWeights.get(state)); 16 | oreWeights.put(state, map); 17 | } else 18 | oreWeights.put(state, new HashMap() {{ 19 | put(ore, weight); 20 | }}); 21 | } 22 | 23 | public static String[] getOres(IBlockState state) { 24 | return Objects.requireNonNull(Optional.ofNullable(oreWeights.get(state)) 25 | .map(Map::keySet) 26 | .orElse(null)) 27 | .toArray(new String[0]); 28 | } 29 | 30 | public static void delOre(IBlockState state, String oreName) { 31 | oreWeights.entrySet().stream() 32 | .filter(entry -> entry.getKey() == state) 33 | .map(Map.Entry::getValue) 34 | .filter(map -> map.containsKey(oreName)) 35 | .forEach(e -> e.remove(oreName)); 36 | } 37 | 38 | public static boolean checkOreExist(IBlockState state, String oreName) { 39 | return Arrays.asList(getOres(state)).contains(oreName); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/crafttweaker/CraftTweakerExtension.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.crafttweaker; 2 | 3 | import crafttweaker.CraftTweakerAPI; 4 | import crafttweaker.zenscript.GlobalRegistry; 5 | import ink.ikx.rt.api.internal.file.IProp; 6 | import ink.ikx.rt.api.internal.utils.IInputPattern; 7 | import ink.ikx.rt.api.mods.botania.subtile.IHydroangeas; 8 | import ink.ikx.rt.api.mods.botania.subtile.IOrechid; 9 | import ink.ikx.rt.impl.internal.config.RTConfig; 10 | import net.minecraftforge.fml.common.Loader; 11 | 12 | import java.util.Arrays; 13 | import java.util.Map; 14 | 15 | public class CraftTweakerExtension { 16 | 17 | public static void registerAllClass() { 18 | registerGlobal(); 19 | registerSpecialClass(); 20 | } 21 | 22 | public static void registerSpecialClass() { 23 | if (IProp.isRegister(RTConfig.RandomTweaker.Prop)) 24 | CraftTweakerAPI.registerClass(IProp.class); 25 | if (Loader.isModLoaded("botania")) { 26 | if (RTConfig.Botania.OrechidModified) 27 | CraftTweakerAPI.registerClass(IOrechid.class); 28 | if (RTConfig.Botania.HydroangeasModified) 29 | CraftTweakerAPI.registerClass(IHydroangeas.class); 30 | } 31 | } 32 | 33 | public static void registerGlobal() { 34 | GlobalRegistry.registerGlobal("inputPattern", 35 | GlobalRegistry.getStaticFunction(IInputPattern.class, "inputPattern", String[].class)); 36 | GlobalRegistry.registerGlobal("inputPatternGet", 37 | GlobalRegistry.getStaticFunction(IInputPattern.class, "inputPatternGet", String[].class, Map.class)); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/contenttweaker/subtile/MCSubTileEntityRepresentation.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.contenttweaker.subtile; 2 | 3 | import ink.ikx.rt.api.mods.contenttweaker.subtile.ISubTileEntityRepresentation; 4 | import ink.ikx.rt.api.mods.contenttweaker.subtile.functional.ISubTileEntityFunctionalRepresentation; 5 | import ink.ikx.rt.api.mods.contenttweaker.subtile.generating.ISubTileEntityGeneratingRepresentation; 6 | 7 | public class MCSubTileEntityRepresentation extends ISubTileEntityRepresentation { 8 | 9 | public MCSubTileEntityRepresentation(int color, String unlocalizedName) { 10 | super(color, unlocalizedName); 11 | } 12 | 13 | @Override 14 | public boolean equals(Object o) { 15 | if (this == o) return true; 16 | if (o == null || getClass() != o.getClass()) return false; 17 | 18 | ISubTileEntityRepresentation that = (ISubTileEntityRepresentation) o; 19 | 20 | return unlocalizedName.equals(that.unlocalizedName); 21 | } 22 | 23 | @Override 24 | public int hashCode() { 25 | return unlocalizedName.hashCode(); 26 | } 27 | 28 | public static class MCSubTileEntityGeneratingRepresentation extends ISubTileEntityGeneratingRepresentation { 29 | 30 | public MCSubTileEntityGeneratingRepresentation(int color, String unlocalizedName) { 31 | super(color, unlocalizedName); 32 | } 33 | 34 | } 35 | 36 | public static class MCSubTileEntityFunctionalRepresentation extends ISubTileEntityFunctionalRepresentation { 37 | 38 | public MCSubTileEntityFunctionalRepresentation(int color, String unlocalizedName) { 39 | super(color, unlocalizedName); 40 | } 41 | 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/classTransforms/mods/tconstruct/AbstractMaterialSectionTransformerHooks.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.classTransforms.mods.tconstruct; 2 | 3 | import crafttweaker.api.minecraft.CraftTweakerMC; 4 | import ink.ikx.rt.Main; 5 | import ink.ikx.rt.impl.internal.config.RTConfig; 6 | import net.minecraft.item.ItemStack; 7 | import org.apache.logging.log4j.LogManager; 8 | import slimeknights.mantle.client.gui.book.element.ElementItem; 9 | import slimeknights.tconstruct.library.materials.Material; 10 | 11 | import java.util.Comparator; 12 | import java.util.List; 13 | import java.util.stream.Collectors; 14 | 15 | 16 | public class AbstractMaterialSectionTransformerHooks { 17 | 18 | public static boolean isMaterialInHiddenItems(Material material) { 19 | return Main.HIDDEN_MATERIAL_LIST.contains(material.getIdentifier()); 20 | } 21 | 22 | public static boolean isMaterialInShowItemMap(Material material) { 23 | return Main.MATERIAL_SHOW_ITEM_MAP.containsKey(material.getIdentifier()); 24 | } 25 | 26 | public static ElementItem createElementItem(Material material) { 27 | ItemStack stack = Main.MATERIAL_SHOW_ITEM_MAP.get(material.getIdentifier()); 28 | LogManager.getLogger() 29 | .info("Create ElementItem for " + material.getIdentifier() + "->" + CraftTweakerMC.getIItemStack(stack).toString()); 30 | return new ElementItem(0, 0, 1.0F, stack); 31 | } 32 | 33 | public static List sortMaterialList(List materialList) { 34 | return materialList.stream() 35 | .sorted(Comparator.comparing(m -> Main.MATERIAL_PRIORITY_MAP.getOrDefault(m.getIdentifier(), 0))) 36 | .collect(Collectors.toList()); 37 | 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/contenttweaker/mana/bauble/MCManaBauble.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.contenttweaker.mana.bauble; 2 | 3 | import baubles.api.IBauble; 4 | import crafttweaker.api.entity.IEntityLivingBase; 5 | import crafttweaker.api.item.IItemStack; 6 | import crafttweaker.api.minecraft.CraftTweakerMC; 7 | import ink.ikx.rt.api.mods.contenttweaker.mana.IManaBauble; 8 | import ink.ikx.rt.impl.mods.contenttweaker.mana.item.MCManaItem; 9 | import javax.annotation.Nullable; 10 | import net.minecraft.item.Item; 11 | import net.minecraft.item.ItemStack; 12 | 13 | /** 14 | * @author superhelo 15 | */ 16 | public class MCManaBauble extends MCManaItem implements IManaBauble { 17 | 18 | protected MCManaBauble(ItemStack stack) { 19 | super(stack); 20 | } 21 | 22 | @Nullable 23 | public static IManaBauble create(ItemStack stack) { 24 | Item item = stack.getItem(); 25 | 26 | if (item instanceof vazkii.botania.api.mana.IManaItem && item instanceof IBauble) { 27 | return new MCManaBauble(stack); 28 | } 29 | 30 | return null; 31 | } 32 | 33 | @Override 34 | public String getBaubleType() { 35 | return ((MCManaBaubleContent) this.itemIn).getBaubleType(stack).toString(); 36 | } 37 | 38 | @Override 39 | public boolean canEquip(IItemStack baubleItem, IEntityLivingBase wearer) { 40 | return ((IBauble) itemIn).canEquip(CraftTweakerMC.getItemStack(baubleItem), CraftTweakerMC.getEntityLivingBase(wearer)); 41 | } 42 | 43 | @Override 44 | public boolean canUnEquip(IItemStack baubleItem, IEntityLivingBase wearer) { 45 | return ((IBauble) itemIn).canUnequip(CraftTweakerMC.getItemStack(baubleItem), CraftTweakerMC.getEntityLivingBase(wearer)); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/mixins/tconstruct/MixinContentMaterial.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.mixins.tconstruct; 2 | 3 | import ink.ikx.rt.Main; 4 | import ink.ikx.rt.classTransforms.mods.tconstruct.AbstractMaterialSectionTransformerHooks; 5 | import ink.ikx.rt.impl.internal.config.RTConfig; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Shadow; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.At.Shift; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 12 | import org.spongepowered.asm.mixin.injection.callback.LocalCapture; 13 | import slimeknights.mantle.client.gui.book.element.BookElement; 14 | import slimeknights.tconstruct.library.book.content.ContentMaterial; 15 | import slimeknights.tconstruct.library.book.elements.ElementTinkerItem; 16 | import slimeknights.tconstruct.library.materials.Material; 17 | 18 | import java.util.ArrayList; 19 | import java.util.List; 20 | 21 | @Mixin(value = ContentMaterial.class, remap = false) 22 | public class MixinContentMaterial { 23 | 24 | @Shadow 25 | private Material material; 26 | 27 | @SuppressWarnings(value = {"rawtypes, unchecked"}) 28 | @Inject(method = "addDisplayItems", at = @At(value = "INVOKE", target = "Lslimeknights/tconstruct/library/materials/Material;isCraftable()Z", shift = Shift.BEFORE), locals = LocalCapture.CAPTURE_FAILHARD) 29 | private void injectAddDisplayItems(ArrayList list, int x, CallbackInfo ci, List displayTools) { 30 | if (RTConfig.Tconstruct.iconModification && AbstractMaterialSectionTransformerHooks.isMaterialInShowItemMap(material)) { 31 | displayTools.remove(0); 32 | displayTools.add(new ElementTinkerItem(Main.MATERIAL_SHOW_ITEM_MAP.get(material.getIdentifier()))); 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/vanilla/CTEventHandler.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.vanilla; 2 | 3 | import com.google.common.collect.Multimap; 4 | import crafttweaker.api.event.IEventHandle; 5 | import crafttweaker.api.minecraft.CraftTweakerMC; 6 | import crafttweaker.util.EventList; 7 | import crafttweaker.util.IEventHandler; 8 | import ink.ikx.rt.impl.vanilla.ItemAttributeModificationEvent; 9 | import net.minecraft.entity.ai.attributes.AttributeModifier; 10 | import net.minecraft.inventory.EntityEquipmentSlot; 11 | import net.minecraft.item.ItemStack; 12 | import stanhebben.zenscript.annotations.ZenExpansion; 13 | import stanhebben.zenscript.annotations.ZenMethod; 14 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 15 | 16 | /** 17 | * @author youyihj 18 | */ 19 | 20 | @SidedZenRegister 21 | @ZenExpansion("crafttweaker.events.IEventManager") 22 | public class CTEventHandler { 23 | public static final EventList elAttributeModification = new EventList<>(); 24 | 25 | @ZenMethod 26 | public static IEventHandle onItemAttributeModificationEvent(IEventHandler handler) { 27 | Holder.used = true; 28 | return elAttributeModification.add(handler); 29 | } 30 | 31 | // another holder class to avoid early class loading issues 32 | public static class Holder { 33 | private static boolean used = false; 34 | 35 | public static void publishItemAttributeModificationEvent(ItemStack stack, EntityEquipmentSlot equipmentSlot, Multimap multimap) { 36 | if (used) { 37 | elAttributeModification.publish(new ItemAttributeModificationEvent(CraftTweakerMC.getIItemStack(stack), CraftTweakerMC.getIEntityEquipmentSlot(equipmentSlot), multimap)); 38 | } 39 | } 40 | 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/internal/utils/ItemStackList.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.internal.utils; 2 | 3 | import net.minecraft.item.ItemStack; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | public class ItemStackList { 9 | 10 | private List itemStackList = new ArrayList<>(); 11 | 12 | public void add(ItemStack stack) { 13 | if (isInclude(stack) == null) { 14 | itemStackList.add(stack); 15 | } else { 16 | itemStackList.stream() 17 | .filter(l -> InternalUtils.areItemStacksEqual(l, stack)) 18 | .forEach(stack1 -> stack1.setCount(Math.min(stack1.getCount() + stack.getCount(), 64))); 19 | } 20 | } 21 | 22 | public void clear() { 23 | itemStackList.clear(); 24 | } 25 | 26 | public void remove(ItemStack stack) { 27 | itemStackList.stream() 28 | .filter(l -> InternalUtils.areItemStacksEqual(l, stack)) 29 | .forEach(stack1 -> stack1.setCount(Math.max(stack1.getCount() - stack.getCount(), 0))); 30 | delZeroCount(); 31 | } 32 | 33 | public List getItemStackList() { 34 | return itemStackList; 35 | } 36 | 37 | public void setItemStackList(List itemStackList) { 38 | this.itemStackList = itemStackList; 39 | } 40 | 41 | private ItemStack isInclude(ItemStack stack) { 42 | return itemStackList.stream() 43 | .filter(l -> InternalUtils.areItemStacksEqual(l, stack)) 44 | .findFirst() 45 | .orElse(null); 46 | } 47 | 48 | private void delZeroCount() { 49 | for (int i = 0; i < itemStackList.size(); i++) { 50 | if (itemStackList.get(i).getCount() == 0) { 51 | itemStackList.remove(i); 52 | break; 53 | } 54 | } 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/classTransforms/vanilla/ASMBreakableEnchantmentType.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.classTransforms.vanilla; 2 | 3 | import net.minecraftforge.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper; 4 | import org.objectweb.asm.ClassVisitor; 5 | import org.objectweb.asm.Label; 6 | import org.objectweb.asm.MethodVisitor; 7 | import org.objectweb.asm.Opcodes; 8 | 9 | /** 10 | * @author youyihj 11 | */ 12 | public class ASMBreakableEnchantmentType extends ClassVisitor { 13 | private final String className; 14 | 15 | public ASMBreakableEnchantmentType(int api, ClassVisitor cv, String className) { 16 | super(api, cv); 17 | this.className = className; 18 | } 19 | 20 | @Override 21 | public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { 22 | String methodName = FMLDeobfuscatingRemapper.INSTANCE.mapMethodName(className, name, desc); 23 | if (methodName.equals("func_77557_a") || methodName.equals("canEnchantItem")) { 24 | return new ASMCanEnchantItem(api, super.visitMethod(access, name, desc, signature, exceptions)); 25 | } 26 | 27 | return super.visitMethod(access, name, desc, signature, exceptions); 28 | } 29 | } 30 | 31 | class ASMCanEnchantItem extends MethodVisitor implements Opcodes { 32 | 33 | public ASMCanEnchantItem(int api, MethodVisitor mv) { 34 | super(api, mv); 35 | } 36 | 37 | @Override 38 | public void visitCode() { 39 | super.visitCode(); 40 | Label remain = new Label(); 41 | super.visitVarInsn(ALOAD, 1); 42 | super.visitMethodInsn(INVOKESTATIC, "ink/ikx/rt/classTransforms/vanilla/Hooks", "isInBreakableEnchantmentBlacklist", "(Lnet/minecraft/item/Item;)Z", false); 43 | super.visitJumpInsn(IFEQ, remain); 44 | super.visitInsn(ICONST_0); 45 | super.visitInsn(IRETURN); 46 | super.visitLabel(remain); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/jei/impl/MCJeiSlots.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.jei.impl; 2 | 3 | import ink.ikx.rt.api.mods.jei.IJeiUtils; 4 | import ink.ikx.rt.api.mods.jei.slots.IJeiSlotItem; 5 | import ink.ikx.rt.api.mods.jei.slots.IJeiSlotLiquid; 6 | import net.minecraft.client.Minecraft; 7 | 8 | public class MCJeiSlots { 9 | 10 | public static class MCJeiSlotItem extends IJeiSlotItem { 11 | 12 | public MCJeiSlotItem(int x, int y, boolean isInput, boolean hasBase) { 13 | super(x, y, isInput, hasBase); 14 | } 15 | 16 | public MCJeiSlotItem(String slotName, int x, int y, boolean isInput, boolean hasBase) { 17 | super(slotName, x, y, isInput, hasBase); 18 | } 19 | 20 | @Override 21 | public void render(Minecraft minecraft) { 22 | if (!hasBase) return; 23 | if (isInput) { 24 | IJeiUtils.createItemInputElement(x, y).render(minecraft); 25 | } else { 26 | IJeiUtils.createItemOutputElement(x, y).render(minecraft); 27 | } 28 | } 29 | 30 | } 31 | 32 | public static class MCJeiSlotLiquid extends IJeiSlotLiquid { 33 | 34 | public MCJeiSlotLiquid(int x, int y, int width, int height, int capacityMb, 35 | boolean showCapacity, boolean isInput, boolean hasBase) { 36 | super(x, y, isInput, hasBase, width, height, capacityMb, showCapacity); 37 | } 38 | 39 | public MCJeiSlotLiquid(String slotName, int x, int y, boolean isInput, boolean hasBase, 40 | int width, int height, int capacityMb, boolean showCapacity) { 41 | super(slotName, x, y, isInput, hasBase, width, height, capacityMb, showCapacity); 42 | } 43 | 44 | @Override 45 | public void render(Minecraft minecraft) { 46 | if (!hasBase) return; 47 | IJeiUtils.createLiquidElement(x, y, width, height).render(minecraft); 48 | } 49 | 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/mana/bauble/IManaBaubleRepresentation.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.mana.bauble; 2 | 3 | import ink.ikx.rt.api.mods.contenttweaker.function.mana.IBaubleFunction; 4 | import ink.ikx.rt.api.mods.contenttweaker.function.mana.IBaubleFunctionWithReturn; 5 | import ink.ikx.rt.api.mods.contenttweaker.function.mana.IBaubleRender; 6 | import ink.ikx.rt.api.mods.contenttweaker.function.mana.IGetBaubleType; 7 | import ink.ikx.rt.api.mods.contenttweaker.mana.item.IManaItemRepresentation; 8 | import stanhebben.zenscript.annotations.ZenClass; 9 | import stanhebben.zenscript.annotations.ZenMethod; 10 | import stanhebben.zenscript.annotations.ZenProperty; 11 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 12 | 13 | /** 14 | * @author superhelo 15 | */ 16 | 17 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 18 | @ZenClass("mods.randomtweaker.cote.ManaBauble") 19 | public abstract class IManaBaubleRepresentation extends IManaItemRepresentation { 20 | 21 | @ZenProperty 22 | public String baubleType; 23 | @ZenProperty 24 | public IBaubleFunction onWornTick; 25 | @ZenProperty 26 | public IBaubleFunction onEquipped; 27 | @ZenProperty 28 | public IBaubleFunction onUnequipped; 29 | @ZenProperty 30 | public IGetBaubleType getBaubleType; 31 | @ZenProperty 32 | public IBaubleRender onPlayerBaubleRender; 33 | @ZenProperty 34 | public IBaubleFunctionWithReturn canEquip; 35 | @ZenProperty 36 | public IBaubleFunctionWithReturn canUnEquip; 37 | @ZenProperty 38 | public IBaubleFunctionWithReturn willAutoSync; 39 | 40 | @ZenMethod 41 | public String getBaubleType() { 42 | return baubleType; 43 | } 44 | 45 | @ZenMethod 46 | public void setBaubleType(String baubleType) { 47 | this.baubleType = baubleType; 48 | } 49 | 50 | @Override 51 | public String getTypeName() { 52 | return "ManaBauble"; 53 | } 54 | 55 | @Override 56 | public abstract void register(); 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/mixins/ftbultimine/MixinFTBUltimine.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.mixins.ftbultimine; 2 | 3 | import com.feed_the_beast.mods.ftbultimine.FTBUltimine; 4 | import ink.ikx.rt.api.mods.ftbultimine.IPlayerExpansionFTBU; 5 | import ink.ikx.rt.impl.internal.capability.CapabilityRegistryHandler; 6 | import ink.ikx.rt.impl.internal.utils.InternalUtils; 7 | import net.minecraft.util.text.TextComponentString; 8 | import net.minecraft.util.text.translation.I18n; 9 | import net.minecraftforge.event.world.BlockEvent; 10 | import org.spongepowered.asm.mixin.Mixin; 11 | import org.spongepowered.asm.mixin.Pseudo; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | import java.util.Objects; 17 | 18 | @Pseudo 19 | @Mixin(value = FTBUltimine.class, remap = false) 20 | public abstract class MixinFTBUltimine { 21 | 22 | @SuppressWarnings("deprecation") 23 | @Inject( 24 | method = "blockBroken", 25 | at = @At( 26 | value = "INVOKE", 27 | target = "Lcom/feed_the_beast/mods/ftbultimine/FTBUltimine;rayTrace(Lnet/minecraft/entity/player/EntityPlayer;)Lnet/minecraft/util/math/RayTraceResult;", 28 | shift = At.Shift.BEFORE 29 | ), 30 | cancellable = true) 31 | public void injectBlockBroken(BlockEvent.BreakEvent event, CallbackInfo ci) { 32 | if (InternalUtils.isOpenFTBUltimineControl() && event.getPlayer() != null) { 33 | CapabilityRegistryHandler.FTBUltimineTag capability = event.getPlayer().getCapability(CapabilityRegistryHandler.FTB_ULTIMINE_CAPABILITY, null); 34 | if (!Objects.requireNonNull(capability).isAllow()) { 35 | if (IPlayerExpansionFTBU.langKey != null) { 36 | event.getPlayer().sendMessage(new TextComponentString(I18n.translateToLocal(IPlayerExpansionFTBU.langKey))); 37 | } 38 | ci.cancel(); 39 | } 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/jei/elements/IJeiElement.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.jei.elements; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraftforge.fml.relauncher.Side; 7 | import net.minecraftforge.fml.relauncher.SideOnly; 8 | import stanhebben.zenscript.annotations.ZenClass; 9 | import stanhebben.zenscript.annotations.ZenProperty; 10 | 11 | 12 | @SidedZenRegister(modDeps = "jei") 13 | @ZenClass("mods.randomtweaker.jei.IJeiElement") 14 | public abstract class IJeiElement { 15 | 16 | @ZenProperty 17 | public int u; 18 | 19 | @ZenProperty 20 | public int v; 21 | 22 | @ZenProperty 23 | public int x; 24 | 25 | @ZenProperty 26 | public int y; 27 | 28 | @ZenProperty 29 | public int width; 30 | 31 | @ZenProperty 32 | public int height; 33 | 34 | @ZenProperty 35 | public String elementName; 36 | 37 | protected IJeiElement(int x, int y, int width, int height) { 38 | this.x = x; 39 | this.y = y; 40 | this.width = width; 41 | this.height = height; 42 | } 43 | 44 | protected IJeiElement(int u, int v, int x, int y, int width, int height) { 45 | this.u = u; 46 | this.v = v; 47 | this.x = x; 48 | this.y = y; 49 | this.width = width; 50 | this.height = height; 51 | } 52 | 53 | protected IJeiElement(String elementName, int x, int y, int width, int height) { 54 | this.elementName = elementName; 55 | 56 | this.x = x; 57 | this.y = y; 58 | this.width = width; 59 | this.height = height; 60 | } 61 | 62 | protected IJeiElement(String elementName, int u, int v, int x, int y, int width, int height) { 63 | this.elementName = elementName; 64 | 65 | this.u = u; 66 | this.v = v; 67 | this.x = x; 68 | this.y = y; 69 | this.width = width; 70 | this.height = height; 71 | } 72 | 73 | @SideOnly(Side.CLIENT) 74 | public abstract void render(Minecraft minecraft); 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/jei/JeiAttunements.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.jei; 2 | 3 | import crafttweaker.api.item.IItemStack; 4 | import crafttweaker.api.minecraft.CraftTweakerMC; 5 | import hellfirepvp.astralsorcery.common.lib.BlocksAS; 6 | import ink.ikx.rt.api.mods.jei.IJeiUtils; 7 | import ink.ikx.rt.api.mods.jei.JEIExpansion; 8 | import ink.ikx.rt.impl.mods.astralsorcery.CustomAttunementRecipe; 9 | import ink.ikx.rt.impl.mods.jei.recipe.JEIAttunementRecipe; 10 | import net.minecraft.item.ItemStack; 11 | import net.minecraft.util.text.TextComponentTranslation; 12 | import net.minecraft.util.text.translation.I18n; 13 | 14 | public class JeiAttunements { 15 | 16 | public static final String UID = "randomtweaker:jei_attunements"; 17 | private static final String TEXTURE = "randomtweaker:textures/gui/jei/altarattunement.png"; 18 | private static final IItemStack ALTAR = CraftTweakerMC.getIItemStack(new ItemStack(BlocksAS.attunementAltar)); 19 | 20 | public static void init() { 21 | JEIExpansion.createJei(UID, new TextComponentTranslation("randomtweaker.jei_attunements").getUnformattedComponentText()) 22 | .setIcon(ALTAR) 23 | .setBackground(IJeiUtils.createBackground(0, 0, 115, 161, TEXTURE)) 24 | .addRecipeCatalyst(ALTAR) 25 | .addSlot(IJeiUtils.createItemSlot(49, 76, true, false)) 26 | .addSlot(IJeiUtils.createItemSlot(49, 17, false, false)) 27 | .register_(); 28 | getRecipes(); 29 | } 30 | 31 | private static void getRecipes() { 32 | for (CustomAttunementRecipe recipe : CustomAttunementRecipe.allRecipes) { 33 | JEIAttunementRecipe JEIRecipe = (JEIAttunementRecipe) 34 | new JEIAttunementRecipe(UID) 35 | .setConstellation(recipe.getConstellation()) 36 | .addInput(recipe.getOriginal().amount(recipe.getOriginal().getAmount())) 37 | .addOutput(CraftTweakerMC.getIItemStack(recipe.getResult())); 38 | JEIRecipe.build_(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 |

7 |
8 |

Random Tweaker

9 |
10 |
11 | 12 | ## Main contents 13 | 14 | 1. Create custom Botania Generating / Functional Flowers. 15 | 2. Customize Botania ManaItem / ManaBauble. 16 | 3. Customize Botania Cocoon of Caprice spawns. 17 | 4. Customize the vanilla potion / potion bottle. 18 | 5. Customize the JEI interface. 19 | 6. Customize Thaumcraft aspects. 20 | 7. Customize Astral Sorcery attunement altar recipes. 21 | 8. FTBUltime support, which gives or removes a player's chain effect at any time. 22 | 9. Modified Hydroangeas to accept other fluids, and modified Orechid to accept blocks as input that 23 | are not limited to `Stone`. 24 | 10. New randomtweaker.prop exists in the root directory and can be used to store data for Map< 25 | String, String>. 26 | 11. Support some mods and vanilla game expansion. 27 | 12. And more... 28 | 29 | ↑ Above functions require configuration files for switching 30 | 31 | ## Follow up plans 32 | Support more mods and vanilla game expansion. (PR welcome) 33 | 34 | ## Contributors 35 | Thank you to all the contributors! 36 | 37 |

38 | 39 | 40 | 41 |

42 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/botania/event/CTElvenTradeEvent.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.botania.event; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | import crafttweaker.api.event.IEventCancelable; 5 | import crafttweaker.api.item.IItemStack; 6 | import crafttweaker.api.minecraft.CraftTweakerMC; 7 | import ink.ikx.rt.api.mods.botania.ITileAlfPortal; 8 | import ink.ikx.rt.impl.mods.botania.event.ElvenTradeEvent; 9 | 10 | import stanhebben.zenscript.annotations.ZenClass; 11 | import stanhebben.zenscript.annotations.ZenGetter; 12 | import stanhebben.zenscript.annotations.ZenMethod; 13 | import stanhebben.zenscript.annotations.ZenSetter; 14 | 15 | import java.util.Arrays; 16 | import java.util.stream.Collectors; 17 | 18 | 19 | @SidedZenRegister(modDeps = "botania") 20 | @ZenClass("mods.randomtweaker.botania.ElvenTradeEvent") 21 | public abstract class CTElvenTradeEvent implements IEventCancelable { 22 | 23 | private final ElvenTradeEvent event; 24 | 25 | protected CTElvenTradeEvent(ElvenTradeEvent event) { 26 | this.event = event; 27 | } 28 | 29 | @ZenGetter("alfPortal") 30 | public ITileAlfPortal getAlfPortal() { 31 | return event.getAlfPortal(); 32 | } 33 | 34 | @ZenGetter("input") 35 | public IItemStack[] getInput() { 36 | return CraftTweakerMC.getIItemStacks(event.getInput()); 37 | } 38 | 39 | @ZenGetter("output") 40 | public IItemStack[] getOutput() { 41 | return CraftTweakerMC.getIItemStacks(event.getOutput()); 42 | } 43 | 44 | @ZenSetter("output") 45 | @ZenMethod 46 | public void setOutput(IItemStack[] output) { 47 | event.setOutput(Arrays.stream(CraftTweakerMC.getItemStacks(output)).collect(Collectors.toList())); 48 | } 49 | 50 | @ZenMethod 51 | public void addOutput(IItemStack stack) { 52 | event.addOutput(CraftTweakerMC.getItemStack(stack)); 53 | } 54 | 55 | @Override 56 | public boolean isCanceled() { 57 | return event.isCanceled(); 58 | } 59 | 60 | @Override 61 | public void setCanceled(boolean canceled) { 62 | event.setCanceled(canceled); 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/astralsorcery/event/AttunementRecipeCompleteEvent.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.astralsorcery.event; 2 | 3 | import hellfirepvp.astralsorcery.common.constellation.IConstellation; 4 | import ink.ikx.rt.impl.internal.event.BaseEvent; 5 | import net.minecraft.entity.item.EntityItem; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.world.World; 8 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 9 | 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | 13 | @Cancelable 14 | public class AttunementRecipeCompleteEvent extends BaseEvent { 15 | 16 | private final ItemStack input; 17 | private final List additionalOutput = new ArrayList<>(); 18 | private final World world; 19 | private final IConstellation constellation; 20 | private ItemStack output; 21 | private final EntityItem inputEntity; 22 | 23 | public AttunementRecipeCompleteEvent(ItemStack output, EntityItem input, World world, IConstellation constellation) { 24 | this.input = input.getItem(); 25 | this.output = output; 26 | this.inputEntity = input; 27 | this.world = world; 28 | this.constellation = constellation; 29 | } 30 | 31 | public ItemStack getInput() { 32 | return this.input; 33 | } 34 | 35 | public ItemStack getOutput() { 36 | return this.output; 37 | } 38 | 39 | public void setOutput(ItemStack output) { 40 | this.output = output; 41 | } 42 | 43 | public World getWorld() { 44 | return world; 45 | } 46 | 47 | public IConstellation getConstellation() { 48 | return constellation; 49 | } 50 | 51 | public String getConstellationString() { 52 | return constellation.getUnlocalizedName(); 53 | } 54 | 55 | public void addAdditionalOutput(ItemStack additionalOutput) { 56 | this.additionalOutput.add(additionalOutput); 57 | } 58 | 59 | public List getAdditionalOutput() { 60 | return this.additionalOutput; 61 | } 62 | 63 | public EntityItem getInputEntity() { 64 | return this.inputEntity; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/subtile/ISubTileEntityInGame.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.subtile; 2 | 3 | import crafttweaker.api.data.IData; 4 | import crafttweaker.api.world.IBlockPos; 5 | import crafttweaker.mc1120.data.NBTConverter; 6 | import ink.ikx.rt.api.internal.utils.ITileData; 7 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 8 | 9 | import net.minecraft.nbt.NBTTagCompound; 10 | import stanhebben.zenscript.annotations.ZenClass; 11 | import stanhebben.zenscript.annotations.ZenGetter; 12 | import stanhebben.zenscript.annotations.ZenMethod; 13 | import stanhebben.zenscript.annotations.ZenSetter; 14 | 15 | 16 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 17 | @ZenClass("mods.randomtweaker.cote.SubTileEntityInGame") 18 | public interface ISubTileEntityInGame { 19 | 20 | String TAG_CUSTOM_DATA = "CustomData"; 21 | 22 | @ZenMethod 23 | void sync(); 24 | 25 | @ZenMethod 26 | String typeOf(); 27 | 28 | @ZenMethod 29 | @ZenGetter("data") 30 | default IData getCustomData() { 31 | return this.getITileData().getData(); 32 | } 33 | 34 | @ZenMethod 35 | @ZenSetter("data") 36 | default void setCustomData(IData data) { 37 | ITileData.checkDataMap(data); 38 | this.getITileData().readFromNBT((NBTTagCompound) NBTConverter.from(data)); 39 | } 40 | 41 | @ZenMethod 42 | default void updateCustomData(IData data) { 43 | setCustomData(getCustomData().add(data)); 44 | } 45 | 46 | @ZenMethod 47 | int getTicksExisted(); 48 | 49 | @ZenMethod 50 | void addMana(int mana); 51 | 52 | @ZenMethod 53 | void consumeMana(int mana); 54 | 55 | @ZenMethod 56 | int getMana(); 57 | 58 | @ZenMethod 59 | void setMana(int mana); 60 | 61 | @ZenMethod 62 | int getMaxMana(); 63 | 64 | @ZenMethod 65 | int getRedstoneSignal(); 66 | 67 | @ZenMethod 68 | int getPassiveDecayTicks(); 69 | 70 | @ZenMethod 71 | boolean isValidBinding(); 72 | 73 | @ZenMethod 74 | IBlockPos getBindingForCrT(); 75 | 76 | ITileData getITileData(); 77 | 78 | Object getInstance(); 79 | 80 | } 81 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/thaumcraft/expand/ExpandIPlayer.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.thaumcraft.expand; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | import crafttweaker.api.minecraft.CraftTweakerMC; 5 | import crafttweaker.api.player.IPlayer; 6 | 7 | import net.minecraft.entity.player.EntityPlayer; 8 | import net.minecraft.entity.player.EntityPlayerMP; 9 | import net.minecraft.item.ItemStack; 10 | import net.minecraft.util.text.TextComponentString; 11 | import net.minecraft.util.text.TextFormatting; 12 | import net.minecraft.util.text.translation.I18n; 13 | import stanhebben.zenscript.annotations.ZenClass; 14 | import stanhebben.zenscript.annotations.ZenExpansion; 15 | import stanhebben.zenscript.annotations.ZenMethod; 16 | import thaumcraft.api.capabilities.IPlayerKnowledge; 17 | import thaumcraft.api.capabilities.ThaumcraftCapabilities; 18 | import thaumcraft.common.config.ConfigItems; 19 | import thaumcraft.common.lib.utils.InventoryUtils; 20 | 21 | import java.util.Objects; 22 | 23 | 24 | @SidedZenRegister(modDeps = "thaumcraft") 25 | @ZenExpansion("crafttweaker.player.IPlayer") 26 | @ZenClass("mods.randomtweaker.thaumcraft.IPlayer") 27 | public abstract class ExpandIPlayer { 28 | 29 | @ZenMethod 30 | @SuppressWarnings("deprecation") 31 | public static void giverDreamJournl(IPlayer player) { 32 | EntityPlayer mcPlayer = CraftTweakerMC.getPlayer(player); 33 | giverDreamJournl(mcPlayer); 34 | mcPlayer.sendMessage(new TextComponentString(TextFormatting.DARK_PURPLE + I18n.translateToLocal("got.dream"))); 35 | } 36 | 37 | private static void giverDreamJournl(EntityPlayer player) { 38 | IPlayerKnowledge knowledge = ThaumcraftCapabilities.getKnowledge(player); 39 | knowledge.addResearch("!gotdream"); 40 | knowledge.sync((EntityPlayerMP) player); 41 | ItemStack book = ConfigItems.startBook.copy(); 42 | Objects.requireNonNull(book.getTagCompound()).setString("author", player.getName()); 43 | if (!player.inventory.addItemStackToInventory(book)) { 44 | InventoryUtils.dropItemAtEntity(player.world, book, player); 45 | } 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/thaumcraft/IAspectList.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.thaumcraft; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | 5 | import ink.ikx.rt.impl.mods.thaumcraft.MCAspectList; 6 | import stanhebben.zenscript.annotations.*; 7 | import thaumcraft.api.aspects.AspectList; 8 | 9 | 10 | @SidedZenRegister(modDeps = "thaumcraft") 11 | @ZenClass("mods.randomtweaker.thaumcraft.IAspectList") 12 | @IterableSimple("mods.randomtweaker.thaumcraft.IAspect") 13 | public interface IAspectList extends Iterable { 14 | 15 | static IAspectList of(AspectList list) { 16 | return new MCAspectList(list); 17 | } 18 | 19 | @ZenMethod 20 | static IAspectList of() { 21 | return IAspectList.of(new AspectList()); 22 | } 23 | 24 | @ZenMethod 25 | @ZenGetter("size") 26 | int getSize(); 27 | 28 | @ZenMethod 29 | @ZenGetter("visSize") 30 | int getVisSize(); 31 | 32 | @ZenMethod 33 | int getAmount(IAspect key); 34 | 35 | @ZenMethod 36 | IAspectList copy(); 37 | 38 | @ZenMethod 39 | IAspect[] getAspects(); 40 | 41 | @ZenMethod 42 | IAspect[] getAspectsSortedByName(); 43 | 44 | @ZenMethod 45 | IAspect[] getAspectsSortedByAmount(); 46 | 47 | @ZenMethod 48 | IAspectList add(IAspectList in); 49 | 50 | @ZenMethod 51 | IAspectList add(IAspect key, @Optional(valueLong = 1) int amount); 52 | 53 | @ZenMethod 54 | boolean reduce(IAspect key, @Optional(valueLong = 1) int amount); 55 | 56 | @ZenMethod 57 | IAspectList remove(IAspect key); 58 | 59 | @ZenMethod 60 | IAspectList remove(IAspect key, int amount); 61 | 62 | @ZenMethod 63 | IAspectList remove(IAspectList in); 64 | 65 | @ZenMethod 66 | IAspectList merge(IAspectList in); 67 | 68 | @ZenMethod 69 | IAspectList merge(IAspect key, @Optional(valueLong = 1) int amount); 70 | 71 | @ZenMethod 72 | @ZenMemberGetter 73 | @ZenOperator(OperatorType.INDEXGET) 74 | IAspect get(int index); 75 | 76 | @ZenMethod 77 | @ZenOperator(OperatorType.CONTAINS) 78 | boolean contains(IAspect aspect); 79 | 80 | AspectList getInternal(); 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/vanilla/ItemAttributeModificationEvent.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.vanilla; 2 | 3 | import com.google.common.collect.Multimap; 4 | import crafttweaker.api.entity.IEntityEquipmentSlot; 5 | import crafttweaker.api.entity.attribute.IEntityAttributeModifier; 6 | import crafttweaker.api.item.IItemStack; 7 | import crafttweaker.api.minecraft.CraftTweakerMC; 8 | import ink.ikx.rt.api.vanilla.IItemAttributeModificationEvent; 9 | import net.minecraft.entity.ai.attributes.AttributeModifier; 10 | 11 | import java.util.List; 12 | import java.util.UUID; 13 | import java.util.stream.Collectors; 14 | 15 | /** 16 | * @author youyihj 17 | */ 18 | public class ItemAttributeModificationEvent implements IItemAttributeModificationEvent { 19 | private final IItemStack item; 20 | private final IEntityEquipmentSlot slot; 21 | private final Multimap modifierMultimap; 22 | 23 | public ItemAttributeModificationEvent(IItemStack item, IEntityEquipmentSlot slot, Multimap modifierMultimap) { 24 | this.item = item; 25 | this.slot = slot; 26 | this.modifierMultimap = modifierMultimap; 27 | } 28 | 29 | @Override 30 | public IItemStack getItem() { 31 | return item; 32 | } 33 | 34 | @Override 35 | public IEntityEquipmentSlot getSlot() { 36 | return slot; 37 | } 38 | 39 | @Override 40 | public List getModifier(String name) { 41 | return modifierMultimap.get(name).stream().map(CraftTweakerMC::getIEntityAttributeModifier).collect(Collectors.toList()); 42 | } 43 | 44 | @Override 45 | public void putModifier(String name, IEntityAttributeModifier modifier) { 46 | modifierMultimap.put(name, CraftTweakerMC.getAttributeModifier(modifier)); 47 | } 48 | 49 | @Override 50 | public void removeModifier(String name, String uuid) { 51 | UUID standard = UUID.fromString(uuid); 52 | modifierMultimap.get(name).removeIf(it -> it.getID().equals(standard)); 53 | } 54 | 55 | @Override 56 | public void clearModifier(String name) { 57 | modifierMultimap.removeAll(name); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/render/IBaubleRenderHelper.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.render; 2 | 3 | import crafttweaker.api.item.IItemStack; 4 | import crafttweaker.api.player.IPlayer; 5 | import ink.ikx.rt.Main; 6 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 7 | 8 | import stanhebben.zenscript.annotations.Optional; 9 | import stanhebben.zenscript.annotations.ZenClass; 10 | import stanhebben.zenscript.annotations.ZenMethod; 11 | 12 | /** 13 | * @author superhelo 14 | */ 15 | 16 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 17 | @ZenClass("mods.randomtweaker.render.IBaubleRenderHelper") 18 | public abstract class IBaubleRenderHelper { 19 | 20 | @ZenMethod 21 | public static void bindTexture(String resourceLocation) { 22 | Main.proxy.bindTexture(resourceLocation); 23 | } 24 | 25 | @ZenMethod 26 | public static void renderItem(IItemStack renderStack, @Optional(value = "NONE") String transformType) { 27 | Main.proxy.renderItem(renderStack, transformType); 28 | } 29 | 30 | @ZenMethod 31 | public static void rotateIfSneaking(IPlayer player) { 32 | Main.proxy.rotateIfSneaking(player); 33 | } 34 | 35 | @ZenMethod 36 | public static void translateToHeadLevel(IPlayer player) { 37 | Main.proxy.translateToHeadLevel(player); 38 | } 39 | 40 | @ZenMethod 41 | public static void translateToFace() { 42 | Main.proxy.translateToFace(); 43 | } 44 | 45 | @ZenMethod 46 | public static void defaultTransforms() { 47 | Main.proxy.defaultTransforms(); 48 | } 49 | 50 | @ZenMethod 51 | public static void scale(double x, double y, double z) { 52 | Main.proxy.scale(x, y, z); 53 | } 54 | 55 | @ZenMethod 56 | public static void rotate(float angle, float x, float y, float z) { 57 | Main.proxy.rotate(angle, x, y, z); 58 | } 59 | 60 | @ZenMethod 61 | public static void translate(double x, double y, double z) { 62 | Main.proxy.translate(x, y, z); 63 | } 64 | 65 | @ZenMethod 66 | public static void translateToChest() { 67 | Main.proxy.translateToChest(); 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/mixins/botania/MixinBotaniaAPI.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.mixins.botania; 2 | 3 | import ink.ikx.rt.Main; 4 | import ink.ikx.rt.impl.mods.contenttweaker.subtile.MCSubTileEntityFunctionalContent; 5 | import ink.ikx.rt.impl.mods.contenttweaker.subtile.MCSubTileEntityGeneratingContent; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Pseudo; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 11 | import vazkii.botania.api.BotaniaAPI; 12 | import vazkii.botania.api.subtile.SubTileEntity; 13 | import vazkii.botania.api.subtile.signature.BasicSignature; 14 | import vazkii.botania.api.subtile.signature.SubTileSignature; 15 | 16 | import java.util.HashMap; 17 | import java.util.Map; 18 | 19 | @Pseudo 20 | @Mixin(value = BotaniaAPI.class, remap = false) 21 | public abstract class MixinBotaniaAPI { 22 | 23 | private static final Map customSubTileSignatures = new HashMap<>(); 24 | 25 | @Inject(method = "getSignatureForName", at = @At(value = "HEAD"), cancellable = true) 26 | private static void injectGetSignatureForName(String name, CallbackInfoReturnable cir) { 27 | if (Main.SUB_TILE_GENERATING_MAP.containsKey(name)) { 28 | if (!customSubTileSignatures.containsKey(name)) 29 | customSubTileSignatures.put(name, new BasicSignature(name)); 30 | cir.setReturnValue(customSubTileSignatures.get(name)); 31 | } 32 | } 33 | 34 | @Inject(method = "getSubTileMapping", at = @At(value = "HEAD"), cancellable = true) 35 | private static void injectGetSubTileMapping(String key, CallbackInfoReturnable> cir) { 36 | if (Main.SUB_TILE_GENERATING_MAP.containsKey(key)) { 37 | if (Main.SUB_TILE_GENERATING_MAP.get(key).getKey().equals("generating")) { 38 | cir.setReturnValue(MCSubTileEntityGeneratingContent.class); 39 | } else { 40 | cir.setReturnValue(MCSubTileEntityFunctionalContent.class); 41 | } 42 | } 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/mana/IManaHelper.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.mana; 2 | 3 | import baubles.api.IBauble; 4 | import crafttweaker.api.item.IItemStack; 5 | import crafttweaker.api.item.IMutableItemStack; 6 | import crafttweaker.api.minecraft.CraftTweakerMC; 7 | import ink.ikx.rt.impl.mods.contenttweaker.mana.bauble.MCManaBauble; 8 | import ink.ikx.rt.impl.mods.contenttweaker.mana.item.MCManaItem; 9 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 10 | 11 | import javax.annotation.Nullable; 12 | import net.minecraft.item.Item; 13 | import stanhebben.zenscript.annotations.ZenCaster; 14 | import stanhebben.zenscript.annotations.ZenClass; 15 | import stanhebben.zenscript.annotations.ZenExpansion; 16 | import stanhebben.zenscript.annotations.ZenMethod; 17 | 18 | /** 19 | * @author superhelo 20 | */ 21 | 22 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 23 | @ZenExpansion("crafttweaker.item.IItemStack") 24 | @ZenClass("mods.randomtweaker.botania.IItemStack") 25 | public abstract class IManaHelper { 26 | 27 | @ZenMethod 28 | public static boolean isIManaItem(IItemStack stack) { 29 | return CraftTweakerMC.getItemStack(stack).getItem() instanceof vazkii.botania.api.mana.IManaItem; 30 | } 31 | 32 | @ZenMethod 33 | public static boolean isIManaBauble(IItemStack stack) { 34 | Item item = CraftTweakerMC.getItemStack(stack).getItem(); 35 | return item instanceof vazkii.botania.api.mana.IManaItem && item instanceof IBauble; 36 | } 37 | 38 | @Nullable 39 | @ZenCaster 40 | @ZenMethod 41 | public static IManaItem asIManaItem(IItemStack stack) { 42 | if (stack instanceof IMutableItemStack) { 43 | return MCManaItem.create(CraftTweakerMC.getItemStack((IMutableItemStack) stack)); 44 | } 45 | return MCManaItem.create(CraftTweakerMC.getItemStack(stack)); 46 | } 47 | 48 | @Nullable 49 | @ZenCaster 50 | @ZenMethod 51 | public static IManaBauble asIManaBauble(IItemStack stack) { 52 | if (stack instanceof IMutableItemStack) { 53 | return MCManaBauble.create(CraftTweakerMC.getItemStack((IMutableItemStack) stack)); 54 | } 55 | return MCManaBauble.create(CraftTweakerMC.getItemStack(stack)); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/crafttweaker/brackethandler/BracketHandlerJei.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.crafttweaker.brackethandler; 2 | 3 | import crafttweaker.CraftTweakerAPI; 4 | import crafttweaker.annotations.BracketHandler; 5 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 6 | import crafttweaker.zenscript.IBracketHandler; 7 | import ink.ikx.rt.Main; 8 | import ink.ikx.rt.api.mods.jei.core.IJeiPanel; 9 | 10 | import ink.ikx.rt.impl.mods.jei.impl.core.MCJeiPanel; 11 | import stanhebben.zenscript.compiler.IEnvironmentGlobal; 12 | import stanhebben.zenscript.expression.ExpressionCallStatic; 13 | import stanhebben.zenscript.expression.ExpressionString; 14 | import stanhebben.zenscript.parser.Token; 15 | import stanhebben.zenscript.symbols.IZenSymbol; 16 | import stanhebben.zenscript.type.natives.IJavaMethod; 17 | 18 | import java.util.List; 19 | 20 | @SidedZenRegister(modDeps = "jei") 21 | @BracketHandler(priority = 100) 22 | 23 | public class BracketHandlerJei implements IBracketHandler { 24 | 25 | public static IJeiPanel getJEIPanel(String name) { 26 | return Main.JEI_PANEL_SET.stream().filter(p -> ((MCJeiPanel) p).uid.equals(name)).findFirst().orElse(null); 27 | } 28 | 29 | @Override 30 | public IZenSymbol resolve(IEnvironmentGlobal environment, List tokens) { 31 | if (tokens.size() > 2) { 32 | if (tokens.get(0).getValue().equals("jei") && tokens.get(1).getValue().equals(":")) { 33 | return find(environment, tokens); 34 | } 35 | } 36 | return null; 37 | } 38 | 39 | @Override 40 | public String getRegexMatchingString() { 41 | return "jei:.*"; 42 | } 43 | 44 | @Override 45 | public Class getReturnedClass() { 46 | return IJeiPanel.class; 47 | } 48 | 49 | private IZenSymbol find(IEnvironmentGlobal environment, List tokens) { 50 | String name = tokens.get(2).getValue(); 51 | if (getJEIPanel(name) != null) { 52 | IJavaMethod method = CraftTweakerAPI.getJavaMethod(BracketHandlerJei.class, "getJEIPanel", String.class); 53 | return position -> new ExpressionCallStatic(position, environment, method, new ExpressionString(position, name)); 54 | } 55 | return null; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/botania/module/SubTileHydroangeasManager.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.botania.module; 2 | 3 | import crafttweaker.CraftTweakerAPI; 4 | import crafttweaker.api.item.IItemStack; 5 | import crafttweaker.api.liquid.ILiquidStack; 6 | import crafttweaker.api.minecraft.CraftTweakerMC; 7 | import net.minecraft.block.Block; 8 | import net.minecraft.init.Blocks; 9 | 10 | import java.util.ArrayList; 11 | import java.util.HashMap; 12 | import java.util.List; 13 | import java.util.Map; 14 | 15 | public class SubTileHydroangeasManager { 16 | 17 | public static List handlerList = new ArrayList<>(); 18 | public static Map blockFactorList = new HashMap<>(); 19 | public static int burnTime = 40; 20 | 21 | public static void setBlockBelowFactor(IItemStack block, double factor) { 22 | if (block.isItemBlock()) { 23 | blockFactorList.put(block, factor); 24 | } else { 25 | CraftTweakerAPI.getLogger().logError(block + " is not a block."); 26 | } 27 | } 28 | 29 | public static Block getBlock(ILiquidStack inputFluid) { 30 | return CraftTweakerMC.getLiquidStack(inputFluid).getFluid().getBlock(); 31 | } 32 | 33 | public static class HydroangeasHandler { 34 | 35 | ILiquidStack liquidConsume; 36 | ILiquidStack liquidCatalyst; 37 | double fluidFactor; 38 | int manaGen; 39 | 40 | public HydroangeasHandler(ILiquidStack input, int manaGen, ILiquidStack liquidCatalyst, double factor) { 41 | this.liquidConsume = input; 42 | this.manaGen = manaGen; 43 | this.fluidFactor = factor; 44 | this.liquidCatalyst = liquidCatalyst; 45 | } 46 | 47 | public Block getBlockLiquid() { 48 | return getBlock(liquidConsume); 49 | } 50 | 51 | public int getManaGen() { 52 | return this.manaGen; 53 | } 54 | 55 | public double getFluidFactor() { 56 | return this.fluidFactor; 57 | } 58 | 59 | public Block getBlockLiquidCatalyst() { 60 | if (liquidCatalyst == null) { 61 | return Blocks.AIR; 62 | } 63 | return getBlock(liquidCatalyst); 64 | } 65 | 66 | } 67 | 68 | } -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/mixins/botania/MixinBlockSpecialFlower.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.mixins.botania; 2 | 3 | import ink.ikx.rt.api.mods.contenttweaker.subtile.ISubTileEntityInGame; 4 | import net.minecraft.block.state.IBlockState; 5 | import net.minecraft.tileentity.TileEntity; 6 | import net.minecraft.util.math.BlockPos; 7 | import net.minecraft.world.ChunkCache; 8 | import net.minecraft.world.IBlockAccess; 9 | import net.minecraft.world.chunk.Chunk; 10 | import net.minecraftforge.common.property.IExtendedBlockState; 11 | import org.apache.commons.lang3.StringUtils; 12 | import org.spongepowered.asm.mixin.Mixin; 13 | import org.spongepowered.asm.mixin.Pseudo; 14 | import org.spongepowered.asm.mixin.injection.At; 15 | import org.spongepowered.asm.mixin.injection.Inject; 16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 17 | import vazkii.botania.api.BotaniaAPI; 18 | import vazkii.botania.api.state.BotaniaStateProps; 19 | import vazkii.botania.api.subtile.SubTileEntity; 20 | import vazkii.botania.common.block.BlockSpecialFlower; 21 | import vazkii.botania.common.block.tile.TileSpecialFlower; 22 | 23 | @Pseudo 24 | @Mixin(value = BlockSpecialFlower.class, remap = false) 25 | public abstract class MixinBlockSpecialFlower { 26 | 27 | @Inject(method = "getExtendedState*", at = @At(value = "HEAD"), cancellable = true) 28 | private void injectGetSubTileStringMapping(IBlockState state, IBlockAccess world, BlockPos pos, CallbackInfoReturnable cir) { 29 | TileEntity te = world instanceof ChunkCache ? ((ChunkCache) world).getTileEntity(pos, Chunk.EnumCreateEntityType.CHECK) : world.getTileEntity(pos); 30 | if (te instanceof TileSpecialFlower && ((TileSpecialFlower) te).getSubTile() != null) { 31 | Class clazz = ((TileSpecialFlower) te).getSubTile().getClass(); 32 | String id = BotaniaAPI.getSubTileStringMapping(clazz); 33 | if (StringUtils.isBlank(id) && ISubTileEntityInGame.class.isAssignableFrom(clazz)) { 34 | id = ((TileSpecialFlower) te).getSubTile().getUnlocalizedName(); 35 | } 36 | cir.setReturnValue(((IExtendedBlockState) state).withProperty(BotaniaStateProps.SUBTILE_ID, id)); 37 | } else { 38 | cir.setReturnValue((IExtendedBlockState) state); 39 | } 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/botania/event/PoolTradeEvent.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.botania.event; 2 | 3 | import ink.ikx.rt.impl.internal.event.BaseEvent; 4 | import net.minecraft.entity.item.EntityItem; 5 | import net.minecraft.item.ItemStack; 6 | import net.minecraft.util.math.BlockPos; 7 | import net.minecraft.world.World; 8 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 9 | 10 | @Cancelable 11 | public class PoolTradeEvent extends BaseEvent { 12 | 13 | private final int currentMana; 14 | private final EntityItem input; 15 | private final boolean isAlchemy; 16 | private final boolean isConjuration; 17 | private final World world; 18 | private final BlockPos blockPos; 19 | private int mana; 20 | private ItemStack output; 21 | private boolean isAllowExceed; 22 | 23 | public PoolTradeEvent(int mana, int currentMana, ItemStack output, EntityItem input, 24 | boolean isAlchemy, boolean isConjuration, World world, BlockPos blockPos) { 25 | this.mana = mana; 26 | this.output = output; 27 | this.currentMana = currentMana; 28 | this.input = input; 29 | this.isAlchemy = isAlchemy; 30 | this.isConjuration = isConjuration; 31 | this.world = world; 32 | this.blockPos = blockPos; 33 | } 34 | 35 | public boolean isAlchemy() { 36 | return isAlchemy; 37 | } 38 | 39 | public boolean isConjuration() { 40 | return isConjuration; 41 | } 42 | 43 | public int getMana() { 44 | return mana; 45 | } 46 | 47 | public void setMana(int mana) { 48 | this.mana = mana; 49 | } 50 | 51 | public ItemStack getOutput() { 52 | return output; 53 | } 54 | 55 | public void setOutput(ItemStack output) { 56 | this.output = output; 57 | } 58 | 59 | public boolean isAllowExceed() { 60 | return isAllowExceed; 61 | } 62 | 63 | public void setAllowExceed(boolean allowExceed) { 64 | isAllowExceed = allowExceed; 65 | } 66 | 67 | public int getCurrentMana() { 68 | return currentMana; 69 | } 70 | 71 | public EntityItem getInput() { 72 | return input; 73 | } 74 | 75 | public World getWorld() { 76 | return world; 77 | } 78 | 79 | public BlockPos getBlockPos() { 80 | return blockPos; 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/crafttweaker/brackethandler/BracketHandlerPotion.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.crafttweaker.brackethandler; 2 | 3 | import crafttweaker.CraftTweakerAPI; 4 | import crafttweaker.annotations.BracketHandler; 5 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 6 | import crafttweaker.zenscript.IBracketHandler; 7 | import ink.ikx.rt.api.mods.contenttweaker.potion.IPotionRepresentation; 8 | import ink.ikx.rt.impl.internal.event.EventRegister; 9 | 10 | import stanhebben.zenscript.compiler.IEnvironmentGlobal; 11 | import stanhebben.zenscript.expression.ExpressionCallStatic; 12 | import stanhebben.zenscript.expression.ExpressionString; 13 | import stanhebben.zenscript.parser.Token; 14 | import stanhebben.zenscript.symbols.IZenSymbol; 15 | import stanhebben.zenscript.type.natives.IJavaMethod; 16 | 17 | import java.util.List; 18 | 19 | @SuppressWarnings("ALL") 20 | @SidedZenRegister(modDeps = "contenttweaker") 21 | @BracketHandler(priority = 100) 22 | 23 | public class BracketHandlerPotion implements IBracketHandler { 24 | 25 | public static IPotionRepresentation getPotion(String name) { 26 | if (EventRegister.POTION_MAP.containsKey(name)) { 27 | return EventRegister.POTION_MAP.get(name).potionRepresentation; 28 | } 29 | return null; 30 | } 31 | 32 | @Override 33 | public IZenSymbol resolve(IEnvironmentGlobal environment, List tokens) { 34 | if (tokens.size() > 2) { 35 | if (tokens.get(0).getValue().equals("cotPotion") && tokens.get(1).getValue().equals(":")) { 36 | return find(environment, tokens); 37 | } 38 | } 39 | return null; 40 | } 41 | 42 | @Override 43 | public String getRegexMatchingString() { 44 | return "cotPotion:.*"; 45 | } 46 | 47 | @Override 48 | public Class getReturnedClass() { 49 | return IPotionRepresentation.class; 50 | } 51 | 52 | private IZenSymbol find(IEnvironmentGlobal environment, List tokens) { 53 | String name = tokens.get(2).getValue(); 54 | IJavaMethod method; 55 | if (getPotion(name) != null) { 56 | return position -> new ExpressionCallStatic(position, environment, CraftTweakerAPI.getJavaMethod(BracketHandlerPotion.class, "getPotion", String.class), new ExpressionString(position, name)); 57 | } 58 | return null; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/mixins/botania/MixinTilePool.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.mixins.botania; 2 | 3 | import ink.ikx.rt.impl.mods.botania.event.PoolTradeEvent; 4 | import net.minecraft.entity.item.EntityItem; 5 | import net.minecraft.item.ItemStack; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Pseudo; 8 | import org.spongepowered.asm.mixin.Shadow; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 12 | import org.spongepowered.asm.mixin.injection.callback.LocalCapture; 13 | import vazkii.botania.api.recipe.RecipeManaInfusion; 14 | import vazkii.botania.common.block.tile.TileMod; 15 | import vazkii.botania.common.block.tile.mana.TilePool; 16 | 17 | @Pseudo 18 | @Mixin(value = TilePool.class, remap = false) 19 | public abstract class MixinTilePool extends TileMod { 20 | 21 | @Shadow 22 | public abstract int getCurrentMana(); 23 | 24 | @Shadow 25 | public abstract void recieveMana(int mana); 26 | 27 | @Shadow 28 | protected abstract void craftingFanciness(); 29 | 30 | @SuppressWarnings("deprecation") 31 | @Inject(method = "collideEntityItem", at = @At(value = "INVOKE", target = "Lvazkii/botania/api/recipe/RecipeManaInfusion;getManaToConsume()I", shift = At.Shift.AFTER), locals = LocalCapture.CAPTURE_FAILHARD, cancellable = true) 32 | public void injectCollideEntityItem(EntityItem item, CallbackInfoReturnable cir, ItemStack stack, RecipeManaInfusion recipe) { 33 | int mana = recipe.getManaToConsume(); 34 | PoolTradeEvent event = new PoolTradeEvent(mana, getCurrentMana(), recipe.getOutput().copy(), item, recipe.isAlchemy(), recipe.isConjuration(), getWorld(), getPos()); 35 | if (!event.post()) { 36 | if (event.getMana() > getCurrentMana() && !event.isAllowExceed()) { 37 | cir.setReturnValue(false); 38 | return; 39 | } 40 | recieveMana(-event.getMana()); 41 | stack.shrink(1); 42 | EntityItem outputItem = new EntityItem(world, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, event.getOutput()); 43 | outputItem.age = 105; 44 | world.spawnEntity(outputItem); 45 | craftingFanciness(); 46 | cir.setReturnValue(true); 47 | } 48 | cir.setReturnValue(false); 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/astralsorcery/event/CTEventManagerAS.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.astralsorcery.event; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | import crafttweaker.api.event.IEventHandle; 5 | import crafttweaker.api.event.IEventManager; 6 | import crafttweaker.util.EventList; 7 | import crafttweaker.util.IEventHandler; 8 | import ink.ikx.rt.impl.mods.astralsorcery.event.AbstractClassImplement; 9 | import ink.ikx.rt.impl.mods.astralsorcery.event.AttunementRecipeCompleteEvent; 10 | import ink.ikx.rt.impl.mods.astralsorcery.event.AttunementStartEvent; 11 | 12 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 13 | import stanhebben.zenscript.annotations.ZenClass; 14 | import stanhebben.zenscript.annotations.ZenExpansion; 15 | import stanhebben.zenscript.annotations.ZenMethod; 16 | 17 | 18 | @SidedZenRegister(modDeps = "astralsorcery") 19 | @ZenClass("mods.randomtweaker.astralsorcery.IEventManager") 20 | @ZenExpansion("crafttweaker.events.IEventManager") 21 | public abstract class CTEventManagerAS { 22 | 23 | private static final EventList attunementCompleteEventList = new EventList<>(); 24 | private static final EventList attunementStartEventList = new EventList<>(); 25 | 26 | @ZenMethod 27 | public static IEventHandle onAttunementRecipeComplete(IEventManager manager, IEventHandler event) { 28 | return attunementCompleteEventList.add(event); 29 | } 30 | 31 | @ZenMethod 32 | public static IEventHandle onAttunementStart(IEventManager manager, IEventHandler event) { 33 | return attunementStartEventList.add(event); 34 | } 35 | 36 | public static final class Handler { 37 | 38 | @SubscribeEvent 39 | public static void onAttunementRecipeComplete(AttunementRecipeCompleteEvent event) { 40 | if (attunementCompleteEventList.hasHandlers()) { 41 | attunementCompleteEventList.publish(new AbstractClassImplement.CTAttunementRecipeCompleteEventImpl(event)); 42 | } 43 | } 44 | 45 | @SubscribeEvent 46 | public static void onAttunementStart(AttunementStartEvent event) { 47 | if (attunementStartEventList.hasHandlers()) { 48 | attunementStartEventList.publish(new AbstractClassImplement.CTAttunementStartEventImpl(event)); 49 | } 50 | } 51 | 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/internal/network/NetworkManager.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.internal.network; 2 | 3 | import ink.ikx.rt.impl.internal.capability.CapabilityRegistryHandler; 4 | import io.netty.buffer.ByteBuf; 5 | import io.netty.buffer.Unpooled; 6 | import net.minecraft.client.Minecraft; 7 | import net.minecraft.entity.player.EntityPlayer; 8 | import net.minecraft.entity.player.EntityPlayerMP; 9 | import net.minecraft.network.PacketBuffer; 10 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 11 | import net.minecraftforge.fml.common.network.FMLEventChannel; 12 | import net.minecraftforge.fml.common.network.FMLNetworkEvent; 13 | import net.minecraftforge.fml.common.network.NetworkRegistry; 14 | import net.minecraftforge.fml.common.network.internal.FMLProxyPacket; 15 | import net.minecraftforge.fml.relauncher.Side; 16 | import net.minecraftforge.fml.relauncher.SideOnly; 17 | 18 | import java.util.Objects; 19 | 20 | public class NetworkManager { 21 | 22 | public static void registerFTBUltimineTag() { 23 | FTBUltimineTag.CHANNEL.register(FTBUltimineTag.class); 24 | } 25 | 26 | public static class FTBUltimineTag { 27 | 28 | private static final String NAME = "FTB_ULTIMINE_TAG"; 29 | private static final FMLEventChannel CHANNEL = NetworkRegistry.INSTANCE.newEventDrivenChannel(NAME); 30 | 31 | public static void sendClientCustomPacket(EntityPlayer player) { 32 | PacketBuffer buffer = new PacketBuffer(Unpooled.buffer()); 33 | CapabilityRegistryHandler.FTBUltimineTag capability = player.getCapability(CapabilityRegistryHandler.FTB_ULTIMINE_CAPABILITY, null); 34 | buffer.writeBoolean(Objects.requireNonNull(capability).isAllow()); 35 | 36 | CHANNEL.sendTo(new FMLProxyPacket(buffer, NAME), ((EntityPlayerMP) player)); 37 | } 38 | 39 | @SubscribeEvent 40 | @SideOnly(Side.CLIENT) 41 | public static void onClientCustomPacket(FMLNetworkEvent.ClientCustomPacketEvent event) { 42 | ByteBuf buf = event.getPacket().payload(); 43 | boolean allow = buf.readBoolean(); 44 | 45 | Minecraft minecraft = Minecraft.getMinecraft(); 46 | minecraft.addScheduledTask(() -> { 47 | EntityPlayer player = minecraft.player; 48 | Objects.requireNonNull(player.getCapability(CapabilityRegistryHandler.FTB_ULTIMINE_CAPABILITY, null)).setAllow(allow); 49 | }); 50 | } 51 | 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/botania/event/CTAlfPortalDroppedEvent.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.botania.event; 2 | 3 | import crafttweaker.api.entity.IEntityItem; 4 | import crafttweaker.api.event.IEventCancelable; 5 | import crafttweaker.api.item.IItemStack; 6 | import crafttweaker.api.minecraft.CraftTweakerMC; 7 | import ink.ikx.rt.api.mods.botania.ITileAlfPortal; 8 | import ink.ikx.rt.impl.internal.utils.InternalUtils; 9 | import ink.ikx.rt.impl.mods.botania.event.AlfPortalDroppedEvent; 10 | import stanhebben.zenscript.annotations.ZenClass; 11 | import stanhebben.zenscript.annotations.ZenGetter; 12 | import stanhebben.zenscript.annotations.ZenMethod; 13 | import stanhebben.zenscript.annotations.ZenSetter; 14 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 15 | 16 | import java.util.Arrays; 17 | import java.util.stream.Collectors; 18 | 19 | 20 | @SidedZenRegister(modDeps = "botania") 21 | @ZenClass("mods.randomtweaker.botania.AlfPortalDroppedEvent") 22 | public abstract class CTAlfPortalDroppedEvent implements IEventCancelable { 23 | 24 | private final AlfPortalDroppedEvent event; 25 | 26 | protected CTAlfPortalDroppedEvent(AlfPortalDroppedEvent event) { 27 | this.event = event; 28 | } 29 | 30 | @ZenGetter("alfPortal") 31 | public ITileAlfPortal getAlfPortal() { 32 | return event.getAlfPortal(); 33 | } 34 | 35 | @ZenGetter("input") 36 | public IEntityItem getInput() { 37 | return CraftTweakerMC.getIEntityItem(event.getInput()); 38 | } 39 | 40 | @ZenGetter("output") 41 | public IItemStack[] getOutput() { 42 | return CraftTweakerMC.getIItemStacks(InternalUtils.getItemStackListCopy(event.getOutput())); 43 | } 44 | 45 | @ZenMethod 46 | public void addOutput(IItemStack output) { 47 | event.addOutput(CraftTweakerMC.getItemStack(output)); 48 | } 49 | 50 | @ZenMethod 51 | public void setOutput(IItemStack[] output) { 52 | event.setOutput(Arrays.stream(CraftTweakerMC.getItemStacks(output)).collect(Collectors.toList())); 53 | } 54 | 55 | @ZenGetter("isDead") 56 | public boolean isDead() { 57 | return event.isDead(); 58 | } 59 | 60 | @ZenMethod 61 | @ZenSetter("isDead") 62 | public void setDead(boolean dead) { 63 | event.setDead(dead); 64 | } 65 | 66 | @Override 67 | public boolean isCanceled() { 68 | return event.isCanceled(); 69 | } 70 | 71 | @Override 72 | public void setCanceled(boolean canceled) { 73 | event.setCanceled(canceled); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/aspect/IAspectRepresentation.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.aspect; 2 | 3 | import crafttweaker.CraftTweakerAPI; 4 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 5 | 6 | import java.util.Arrays; 7 | import java.util.Objects; 8 | import stanhebben.zenscript.annotations.ZenClass; 9 | import stanhebben.zenscript.annotations.ZenMethod; 10 | import stanhebben.zenscript.annotations.ZenProperty; 11 | import thaumcraft.api.aspects.Aspect; 12 | 13 | 14 | @SidedZenRegister(modDeps = {"thaumcraft", "contenttweaker"}) 15 | @ZenClass("mods.randomtweaker.cote.Aspect") 16 | public abstract class IAspectRepresentation { 17 | 18 | @ZenProperty 19 | public int color; 20 | @ZenProperty 21 | public String tag; 22 | @ZenProperty 23 | public int blend = 1; 24 | @ZenProperty 25 | public String[] components; 26 | @ZenProperty 27 | public String image; 28 | @ZenProperty 29 | public String chatcolor; 30 | 31 | public Aspect[] asAspects() { 32 | if (Objects.nonNull(components) && components.length != 0) { 33 | if (components.length != 2) { 34 | CraftTweakerAPI.logError("components' length must be two", new IllegalArgumentException()); 35 | return null; 36 | } 37 | return Arrays.stream(components).map(Aspect::getAspect).toArray(Aspect[]::new); 38 | } 39 | return null; 40 | } 41 | 42 | @ZenMethod 43 | public String getTag() { 44 | return tag; 45 | } 46 | 47 | @ZenMethod 48 | public void setTag(String tag) { 49 | this.tag = tag; 50 | } 51 | 52 | @ZenMethod 53 | public int getColor() { 54 | return color; 55 | } 56 | 57 | @ZenMethod 58 | public void setColor(int color) { 59 | this.color = color; 60 | } 61 | 62 | @ZenMethod 63 | public String getImage() { 64 | return image; 65 | } 66 | 67 | @ZenMethod 68 | public void setImage(String image) { 69 | this.image = image; 70 | } 71 | 72 | @ZenMethod 73 | public int getBlend() { 74 | return blend; 75 | } 76 | 77 | @ZenMethod 78 | public void setBlend(int blend) { 79 | this.blend = blend; 80 | } 81 | 82 | @ZenMethod 83 | public String getChatColor() { 84 | return chatcolor; 85 | } 86 | 87 | @ZenMethod 88 | public void setChatColor(String chatcolor) { 89 | this.chatcolor = chatcolor; 90 | } 91 | 92 | @ZenMethod 93 | public abstract void register(); 94 | 95 | } 96 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/naturesaura/IWorldExpansionNa.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.naturesaura; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | import crafttweaker.api.minecraft.CraftTweakerMC; 5 | import crafttweaker.api.world.IBlockPos; 6 | import crafttweaker.api.world.IWorld; 7 | 8 | import ink.ikx.rt.impl.mods.naturesaura.MCAuraChunk; 9 | import stanhebben.zenscript.annotations.ZenClass; 10 | import stanhebben.zenscript.annotations.ZenExpansion; 11 | import stanhebben.zenscript.annotations.ZenMethod; 12 | 13 | 14 | @SidedZenRegister(modDeps = "naturesaura") 15 | @ZenExpansion("crafttweaker.world.IWorld") 16 | @ZenClass("mods.randomtweaker.naturesaura.IWorld") 17 | public abstract class IWorldExpansionNa { 18 | 19 | @ZenMethod 20 | public static IAuraChunk getAuraChunk(IWorld world, IBlockPos pos) { 21 | return new MCAuraChunk(world, pos); 22 | } 23 | 24 | @ZenMethod 25 | public static IBlockPos getHighestSpot(IWorld world, IBlockPos pos, int radius, IBlockPos defaultSpot) { 26 | return CraftTweakerMC.getIBlockPos(de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk.getHighestSpot( 27 | CraftTweakerMC.getWorld(world), CraftTweakerMC.getBlockPos(pos), radius, CraftTweakerMC.getBlockPos(defaultSpot))); 28 | } 29 | 30 | @ZenMethod 31 | public static IBlockPos getLowestSpot(IWorld world, IBlockPos pos, int radius, IBlockPos defaultSpot) { 32 | return CraftTweakerMC.getIBlockPos(de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk.getLowestSpot( 33 | CraftTweakerMC.getWorld(world), CraftTweakerMC.getBlockPos(pos), radius, CraftTweakerMC.getBlockPos(defaultSpot))); 34 | } 35 | 36 | @ZenMethod 37 | public static int getSpotAmountInArea(IWorld world, IBlockPos pos, int radius) { 38 | return de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk.getSpotAmountInArea( 39 | CraftTweakerMC.getWorld(world), CraftTweakerMC.getBlockPos(pos), radius); 40 | } 41 | 42 | @ZenMethod 43 | public static int getAuraInArea(IWorld world, IBlockPos pos, int radius) { 44 | return de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk.getAuraInArea( 45 | CraftTweakerMC.getWorld(world), CraftTweakerMC.getBlockPos(pos), radius); 46 | } 47 | 48 | @ZenMethod 49 | public static int triangulateAuraInArea(IWorld world, IBlockPos pos, int radius) { 50 | return de.ellpeck.naturesaura.api.aura.chunk.IAuraChunk.triangulateAuraInArea( 51 | CraftTweakerMC.getWorld(world), CraftTweakerMC.getBlockPos(pos), radius); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/internal/proxy/ClientProxy.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.internal.proxy; 2 | 3 | import crafttweaker.api.item.IItemStack; 4 | import crafttweaker.api.minecraft.CraftTweakerMC; 5 | import crafttweaker.api.player.IPlayer; 6 | import ink.ikx.rt.api.mods.contenttweaker.function.mana.IBaubleRender; 7 | import net.minecraft.client.Minecraft; 8 | import net.minecraft.client.renderer.GlStateManager; 9 | import net.minecraft.client.renderer.block.model.ItemCameraTransforms; 10 | import net.minecraft.util.ResourceLocation; 11 | import vazkii.botania.api.item.IBaubleRender.Helper; 12 | 13 | /** 14 | * @author superhelo 15 | */ 16 | public class ClientProxy implements IProxy { 17 | 18 | @Override 19 | public void onPlayerBaubleRender(IBaubleRender render, IItemStack stack, IPlayer player, String renderType, float partialTicks) { 20 | render.call(stack, player, renderType, partialTicks); 21 | } 22 | 23 | @Override 24 | public void rotateIfSneaking(IPlayer player) { 25 | Helper.rotateIfSneaking(CraftTweakerMC.getPlayer(player)); 26 | } 27 | 28 | @Override 29 | public void translateToHeadLevel(IPlayer player) { 30 | Helper.translateToHeadLevel(CraftTweakerMC.getPlayer(player)); 31 | } 32 | 33 | @Override 34 | public void translateToFace() { 35 | Helper.translateToFace(); 36 | } 37 | 38 | @Override 39 | public void defaultTransforms() { 40 | Helper.defaultTransforms(); 41 | } 42 | 43 | @Override 44 | public void renderItem(IItemStack renderStack, String transformType) { 45 | GlStateManager.pushMatrix(); 46 | Minecraft.getMinecraft().getRenderItem().renderItem(CraftTweakerMC.getItemStack(renderStack), ItemCameraTransforms.TransformType.valueOf(transformType)); 47 | GlStateManager.popMatrix(); 48 | } 49 | 50 | @Override 51 | public void translateToChest() { 52 | Helper.translateToChest(); 53 | } 54 | 55 | @Override 56 | public void bindTexture(String resourceLocation) { 57 | Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(resourceLocation)); 58 | } 59 | 60 | @Override 61 | public void scale(double x, double y, double z) { 62 | GlStateManager.scale(x, y, z); 63 | } 64 | 65 | @Override 66 | public void rotate(float angle, float x, float y, float z) { 67 | GlStateManager.rotate(angle, x, y, z); 68 | } 69 | 70 | @Override 71 | public void translate(double x, double y, double z) { 72 | GlStateManager.translate(x, y, z); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/internal/world/IBlockPosExpansion.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.internal.world; 2 | 3 | import crafttweaker.api.minecraft.CraftTweakerMC; 4 | import crafttweaker.api.world.IBlockPos; 5 | import net.minecraft.util.math.BlockPos; 6 | import stanhebben.zenscript.annotations.Optional; 7 | import stanhebben.zenscript.annotations.ZenClass; 8 | import stanhebben.zenscript.annotations.ZenExpansion; 9 | import stanhebben.zenscript.annotations.ZenMethod; 10 | import stanhebben.zenscript.annotations.ZenMethodStatic; 11 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 12 | 13 | import java.util.stream.StreamSupport; 14 | 15 | 16 | @SidedZenRegister 17 | @ZenExpansion("crafttweaker.world.IBlockPos") 18 | @ZenClass("mods.randomtweaker.vanilla.IBlockPos") 19 | public abstract class IBlockPosExpansion { 20 | 21 | @ZenMethodStatic 22 | public static IBlockPos[] getAllInBox(IBlockPos from, IBlockPos to) { 23 | Iterable allInBox = BlockPos.getAllInBox(CraftTweakerMC.getBlockPos(from), CraftTweakerMC.getBlockPos(to)); 24 | return StreamSupport.stream(allInBox.spliterator(), false) 25 | .map(CraftTweakerMC::getIBlockPos) 26 | .toArray(IBlockPos[]::new); 27 | } 28 | 29 | @ZenMethod 30 | public static IBlockPos add(IBlockPos pos, int x, int y, int z) { 31 | return CraftTweakerMC.getIBlockPos(CraftTweakerMC.getBlockPos(pos).add(x, y, z)); 32 | } 33 | 34 | @ZenMethod 35 | public static IBlockPos up(IBlockPos pos, @Optional(valueLong = 1) int n) { 36 | return CraftTweakerMC.getIBlockPos(CraftTweakerMC.getBlockPos(pos).up(n)); 37 | } 38 | 39 | @ZenMethod 40 | public static IBlockPos down(IBlockPos pos, @Optional(valueLong = 1) int n) { 41 | return CraftTweakerMC.getIBlockPos(CraftTweakerMC.getBlockPos(pos).down(n)); 42 | } 43 | 44 | @ZenMethod 45 | public static IBlockPos north(IBlockPos pos, @Optional(valueLong = 1) int n) { 46 | return CraftTweakerMC.getIBlockPos(CraftTweakerMC.getBlockPos(pos).north(n)); 47 | } 48 | 49 | @ZenMethod 50 | public static IBlockPos south(IBlockPos pos, @Optional(valueLong = 1) int n) { 51 | return CraftTweakerMC.getIBlockPos(CraftTweakerMC.getBlockPos(pos).south(n)); 52 | } 53 | 54 | @ZenMethod 55 | public static IBlockPos west(IBlockPos pos, @Optional(valueLong = 1) int n) { 56 | return CraftTweakerMC.getIBlockPos(CraftTweakerMC.getBlockPos(pos).west(n)); 57 | } 58 | 59 | @ZenMethod 60 | public static IBlockPos east(IBlockPos pos, @Optional(valueLong = 1) int n) { 61 | return CraftTweakerMC.getIBlockPos(CraftTweakerMC.getBlockPos(pos).east(n)); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/mods/jei/JeiPlugin.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.mods.jei; 2 | 3 | import com.google.common.collect.Lists; 4 | import crafttweaker.api.minecraft.CraftTweakerMC; 5 | import ink.ikx.rt.Main; 6 | import ink.ikx.rt.impl.mods.jei.impl.core.MCJeiPanel; 7 | import ink.ikx.rt.impl.mods.jei.impl.core.MCJeiRecipe; 8 | import ink.ikx.rt.impl.mods.jei.recipe.AttunementRecipeWarpper; 9 | import ink.ikx.rt.impl.mods.jei.recipe.DynamicRecipesCategory; 10 | import ink.ikx.rt.impl.mods.jei.recipe.DynamicRecipesWrapper; 11 | import mezz.jei.Internal; 12 | import mezz.jei.api.IModPlugin; 13 | import mezz.jei.api.IModRegistry; 14 | import mezz.jei.api.ISubtypeRegistry; 15 | import mezz.jei.api.JEIPlugin; 16 | import mezz.jei.api.recipe.IRecipeCategoryRegistration; 17 | import mezz.jei.gui.GuiHelper; 18 | import net.minecraft.item.Item; 19 | 20 | import javax.annotation.ParametersAreNonnullByDefault; 21 | import java.util.List; 22 | import java.util.stream.Collectors; 23 | 24 | @JEIPlugin 25 | @ParametersAreNonnullByDefault 26 | public class JeiPlugin implements IModPlugin { 27 | 28 | public static List subtypesToRegister = Lists.newArrayList(); 29 | public static final String DEFAULT_TEXTURE = "randomtweaker:textures/gui/jei/jei_default.png"; 30 | 31 | @Override 32 | public void registerItemSubtypes(ISubtypeRegistry subtypeRegistry) { 33 | subtypeRegistry.useNbtForSubtypes(subtypesToRegister.toArray(new Item[0])); 34 | } 35 | 36 | @Override 37 | public void registerCategories(IRecipeCategoryRegistration registry) { 38 | GuiHelper guiHelper = Internal.getHelpers().getGuiHelper(); 39 | Main.JEI_PANEL_SET.forEach(p -> registry.addRecipeCategories(new DynamicRecipesCategory(guiHelper, (MCJeiPanel) p))); 40 | } 41 | 42 | @Override 43 | public void register(IModRegistry registry) { 44 | Main.JEI_PANEL_SET.forEach(p -> { 45 | MCJeiPanel panel = (MCJeiPanel) p; 46 | panel.recipeCatalysts.forEach(c -> registry.addRecipeCatalyst(CraftTweakerMC.getItemStack(c), panel.uid)); 47 | List recipeList = Main.JEI_RECIPE_SET.stream() 48 | .filter(r -> r.getUid().equals(panel.uid)) 49 | .map(r -> (MCJeiRecipe) r) 50 | .collect(Collectors.toList()); 51 | if (panel.uid.equals(JeiAttunements.UID)) { 52 | registry.addRecipes(recipeList.stream().map(AttunementRecipeWarpper::new).collect(Collectors.toList()), panel.uid); 53 | } else { 54 | registry.addRecipes(recipeList.stream().map(DynamicRecipesWrapper::new).collect(Collectors.toList()), panel.uid); 55 | } 56 | }); 57 | } 58 | 59 | } -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/mixins/botania/MixinBlockCocoon.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.mixins.botania; 2 | 3 | import ink.ikx.rt.impl.mods.botania.cocoon.IMixinTileCocoon; 4 | import net.minecraft.block.state.IBlockState; 5 | import net.minecraft.entity.player.EntityPlayer; 6 | import net.minecraft.init.Items; 7 | import net.minecraft.item.Item; 8 | import net.minecraft.item.ItemStack; 9 | import net.minecraft.tileentity.TileEntity; 10 | import net.minecraft.util.EnumFacing; 11 | import net.minecraft.util.EnumHand; 12 | import net.minecraft.util.math.BlockPos; 13 | import net.minecraft.world.World; 14 | import org.spongepowered.asm.mixin.Mixin; 15 | import org.spongepowered.asm.mixin.Pseudo; 16 | import org.spongepowered.asm.mixin.Unique; 17 | import org.spongepowered.asm.mixin.injection.At; 18 | import org.spongepowered.asm.mixin.injection.Inject; 19 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 20 | import vazkii.botania.common.block.BlockCocoon; 21 | 22 | @Pseudo 23 | @Mixin(value = BlockCocoon.class, remap = false) 24 | public abstract class MixinBlockCocoon { 25 | 26 | @Inject(method = "onBlockActivated", at = @At(value = "HEAD"), cancellable = true, remap = true) 27 | private void injectOnBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing s, float xs, float ys, float zs, CallbackInfoReturnable cir) { 28 | randomTweaker$logic(world, pos, player.getHeldItem(hand), player.capabilities.isCreativeMode, player, cir); 29 | } 30 | 31 | @Inject(method = "addStack", at = @At(value = "HEAD"), cancellable = true) 32 | private void injectAddStack(World world, BlockPos pos, ItemStack stack, boolean creative, CallbackInfoReturnable cir) { 33 | randomTweaker$logic(world, pos, stack, creative, null, cir); 34 | } 35 | 36 | @Unique 37 | private void randomTweaker$logic(World world, BlockPos pos, ItemStack stack, boolean creative, EntityPlayer player, CallbackInfoReturnable cir) { 38 | Item item = stack.getItem(); 39 | TileEntity cocoon = world.getTileEntity(pos); 40 | if (!(cocoon instanceof IMixinTileCocoon) || item == Items.EMERALD || item == Items.CHORUS_FRUIT) { 41 | return; 42 | } 43 | 44 | IMixinTileCocoon mixinCocoon = ((IMixinTileCocoon) cocoon); 45 | if (!world.isRemote && !stack.isEmpty()) { 46 | 47 | int amount = mixinCocoon.randomTweaker$getAmount(world, pos, stack, player); 48 | mixinCocoon.randomTweaker$setAmount(world, pos, stack, player, amount + 1); 49 | 50 | if (!creative) { 51 | stack.shrink(1); 52 | } 53 | 54 | } 55 | cir.setReturnValue(true); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/botania/render/IBotaniaFXHelper.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.botania.render; 2 | 3 | import stanhebben.zenscript.annotations.ZenClass; 4 | import stanhebben.zenscript.annotations.ZenMethod; 5 | import vazkii.botania.common.Botania; 6 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 7 | 8 | 9 | @SidedZenRegister(modDeps = "botania") 10 | @ZenClass("mods.randomtweaker.botania.IBotaniaFXHelper") 11 | public abstract class IBotaniaFXHelper { 12 | 13 | @ZenMethod 14 | public static void setWispFXDistanceLimit(boolean limit) { 15 | Botania.proxy.setWispFXDistanceLimit(limit); 16 | } 17 | 18 | @ZenMethod 19 | public static void setWispFXDepthTest(boolean depth) { 20 | Botania.proxy.setWispFXDepthTest(depth); 21 | } 22 | 23 | @ZenMethod 24 | public static void setSparkleFXNoClip(boolean noclip) { 25 | Botania.proxy.setSparkleFXNoClip(noclip); 26 | } 27 | 28 | @ZenMethod 29 | public static void setSparkleFXCorrupt(boolean corrupt) { 30 | Botania.proxy.setSparkleFXCorrupt(corrupt); 31 | } 32 | 33 | @ZenMethod 34 | public static void sparkleFX(double x, double y, double z, float r, float g, float b, float size, int m) { 35 | sparkleFX(x, y, z, r, g, b, size, m, false); 36 | } 37 | 38 | @ZenMethod 39 | public static void sparkleFX(double x, double y, double z, float r, float g, float b, float size, int m, boolean fake) { 40 | Botania.proxy.sparkleFX(x, y, z, r, g, b, size, m, fake); 41 | } 42 | 43 | @ZenMethod 44 | public static void wispFX(double x, double y, double z, float r, float g, float b, float size) { 45 | wispFX(x, y, z, r, g, b, size, 0F); 46 | } 47 | 48 | @ZenMethod 49 | public static void wispFX(double x, double y, double z, float r, float g, float b, float size, float gravity) { 50 | wispFX(x, y, z, r, g, b, size, gravity, 1F); 51 | } 52 | 53 | @ZenMethod 54 | public static void wispFX(double x, double y, double z, float r, float g, float b, float size, float gravity, float maxAgeMul) { 55 | wispFX(x, y, z, r, g, b, size, 0, -gravity, 0, maxAgeMul); 56 | } 57 | 58 | @ZenMethod 59 | public static void wispFX(double x, double y, double z, float r, float g, float b, float size, float motionX, float motionY, float motionZ) { 60 | wispFX(x, y, z, r, g, b, size, motionX, motionY, motionZ, 1F); 61 | } 62 | 63 | @ZenMethod 64 | public static void wispFX(double x, double y, double z, float r, float g, float b, float size, float motionX, float motionY, float motionZ, float maxAgeMul) { 65 | Botania.proxy.wispFX(x, y, z, r, g, b, size, motionX, motionY, motionZ, maxAgeMul); 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/ExpandVanillaFactoryWithBotania.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker; 2 | 3 | import ink.ikx.rt.api.mods.contenttweaker.mana.bauble.IManaBaubleRepresentation; 4 | import ink.ikx.rt.api.mods.contenttweaker.mana.item.IManaItemRepresentation; 5 | import ink.ikx.rt.api.mods.contenttweaker.mana.item.tool.IIsUsesManaItemRepresentation; 6 | import ink.ikx.rt.api.mods.contenttweaker.subtile.functional.ISubTileEntityFunctionalRepresentation; 7 | import ink.ikx.rt.api.mods.contenttweaker.subtile.generating.ISubTileEntityGeneratingRepresentation; 8 | import ink.ikx.rt.impl.mods.contenttweaker.mana.bauble.MCManaBaubleRepresentation; 9 | import ink.ikx.rt.impl.mods.contenttweaker.mana.item.MCManaItemRepresentation; 10 | import ink.ikx.rt.impl.mods.contenttweaker.mana.item.tool.MCIsUsesManaItemRepresentation; 11 | import ink.ikx.rt.impl.mods.contenttweaker.subtile.MCSubTileEntityRepresentation; 12 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 13 | 14 | import stanhebben.zenscript.annotations.Optional; 15 | import stanhebben.zenscript.annotations.ZenClass; 16 | import stanhebben.zenscript.annotations.ZenExpansion; 17 | import stanhebben.zenscript.annotations.ZenMethodStatic; 18 | 19 | 20 | @SidedZenRegister(modDeps = {"botania", "contenttweaker"}) 21 | @ZenExpansion("mods.contenttweaker.VanillaFactory") 22 | @ZenClass("mods.randomtweaker.cote.VanillaFactoryExpansionWithBotania") 23 | public abstract class ExpandVanillaFactoryWithBotania { 24 | 25 | @ZenMethodStatic 26 | public static IManaItemRepresentation createManaItem(String unlocalizedName, @Optional(valueLong = 500000) int maxMana) { 27 | return new MCManaItemRepresentation(unlocalizedName, maxMana); 28 | } 29 | 30 | @ZenMethodStatic 31 | public static IIsUsesManaItemRepresentation createManaUsingItem(String unlocalizedName, @Optional(valueLong = 500000) int maxMana) { 32 | return new MCIsUsesManaItemRepresentation(unlocalizedName, maxMana); 33 | } 34 | 35 | @ZenMethodStatic 36 | public static IManaBaubleRepresentation createManaBauble(String unlocalizedName, String baubleType, @Optional(valueLong = 500000) int maxMana) { 37 | return new MCManaBaubleRepresentation(unlocalizedName, maxMana, baubleType); 38 | } 39 | 40 | @ZenMethodStatic 41 | public static ISubTileEntityGeneratingRepresentation createSubTileGenerating(String unlocalizedName, @Optional int color) { 42 | return new MCSubTileEntityRepresentation.MCSubTileEntityGeneratingRepresentation(color, unlocalizedName); 43 | } 44 | 45 | @ZenMethodStatic 46 | public static ISubTileEntityFunctionalRepresentation createSubTileFunctional(String unlocalizedName, @Optional int color) { 47 | return new MCSubTileEntityRepresentation.MCSubTileEntityFunctionalRepresentation(color, unlocalizedName); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/botania/event/CTEventManager.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.botania.event; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | import crafttweaker.api.event.IEventHandle; 5 | import crafttweaker.api.event.IEventManager; 6 | import crafttweaker.util.EventList; 7 | import crafttweaker.util.IEventHandler; 8 | import ink.ikx.rt.impl.mods.botania.event.AbstractClassImplement; 9 | import ink.ikx.rt.impl.mods.botania.event.AlfPortalDroppedEvent; 10 | import ink.ikx.rt.impl.mods.botania.event.ElvenTradeEvent; 11 | import ink.ikx.rt.impl.mods.botania.event.PoolTradeEvent; 12 | 13 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 14 | import stanhebben.zenscript.annotations.ZenClass; 15 | import stanhebben.zenscript.annotations.ZenExpansion; 16 | import stanhebben.zenscript.annotations.ZenMethod; 17 | 18 | 19 | @SidedZenRegister(modDeps = "botania") 20 | @ZenClass("mods.randomtweaker.botania.IEventManager") 21 | @ZenExpansion("crafttweaker.events.IEventManager") 22 | public abstract class CTEventManager { 23 | 24 | private static final EventList poolTradeEventList = new EventList<>(); 25 | private static final EventList elvenTradeEventList = new EventList<>(); 26 | private static final EventList alfPortalDroppedEventList = new EventList<>(); 27 | 28 | @ZenMethod 29 | public static IEventHandle onPoolTrade(IEventManager manager, IEventHandler event) { 30 | return poolTradeEventList.add(event); 31 | } 32 | 33 | @ZenMethod 34 | public static IEventHandle onElvenTrade(IEventManager manager, IEventHandler event) { 35 | return elvenTradeEventList.add(event); 36 | } 37 | 38 | @ZenMethod 39 | public static IEventHandle onAlfPortalDropped(IEventManager manager, IEventHandler event) { 40 | return alfPortalDroppedEventList.add(event); 41 | } 42 | 43 | public static final class Handler { 44 | 45 | @SubscribeEvent 46 | public static void onPoolTrade(PoolTradeEvent event) { 47 | if (poolTradeEventList.hasHandlers()) { 48 | poolTradeEventList.publish(new AbstractClassImplement.CTPoolTradeEventImpl(event)); 49 | } 50 | } 51 | 52 | @SubscribeEvent 53 | public static void onElvenTrade(ElvenTradeEvent event) { 54 | if (elvenTradeEventList.hasHandlers()) { 55 | elvenTradeEventList.publish(new AbstractClassImplement.CTElvenTradeEventImpl(event)); 56 | } 57 | } 58 | 59 | @SubscribeEvent 60 | public static void onAlfPortalDropped(AlfPortalDroppedEvent event) { 61 | if (alfPortalDroppedEventList.hasHandlers()) { 62 | alfPortalDroppedEventList.publish(new AbstractClassImplement.CTAlfPortalDroppedEventImpl(event)); 63 | } 64 | } 65 | 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/impl/internal/utils/MCInputPattern.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.impl.internal.utils; 2 | 3 | import com.google.common.collect.Lists; 4 | import com.google.common.collect.Maps; 5 | import crafttweaker.CraftTweakerAPI; 6 | import crafttweaker.api.item.IIngredient; 7 | import ink.ikx.rt.api.internal.utils.IInputPattern; 8 | import java.text.MessageFormat; 9 | import java.util.List; 10 | import java.util.Map; 11 | 12 | public class MCInputPattern implements IInputPattern { 13 | 14 | private final String[] pattern; 15 | private final Map mapping = Maps.newHashMap(); 16 | private final Map> grip = Maps.newLinkedHashMap(); 17 | 18 | public MCInputPattern(String... pattern) { 19 | this.pattern = pattern; 20 | } 21 | 22 | private IIngredient[][] mapToArray2D() { 23 | IIngredient[][] toReturn = new IIngredient[grip.size()][]; 24 | for (Map.Entry> entry : grip.entrySet()) { 25 | toReturn[entry.getKey()] = entry.getValue().toArray(new IIngredient[0]); 26 | } 27 | return toReturn; 28 | } 29 | 30 | @Override 31 | public IInputPattern transform(Map mapping) { 32 | mapping.forEach(this::with); 33 | return this; 34 | } 35 | 36 | @Override 37 | public IInputPattern with(String character, IIngredient ingredient) { 38 | if (character.length() != 1) { 39 | CraftTweakerAPI.getLogger().logError("The Mapping key must be one single character", 40 | new IllegalArgumentException()); 41 | } else { 42 | char char_ = character.charAt(0); 43 | if (Character.isWhitespace(char_)) { 44 | CraftTweakerAPI.getLogger().logError("The Mapping key must not be a whitespace character", 45 | new IllegalArgumentException()); 46 | } else { 47 | this.mapping.put(char_, ingredient); 48 | } 49 | } 50 | return this; 51 | } 52 | 53 | @Override 54 | public IIngredient[][] get() { 55 | for (int i = 0; i < pattern.length; i++) { 56 | String rowStr = pattern[i]; 57 | List row = Lists.newArrayList(); 58 | for (char c : rowStr.toCharArray()) { 59 | if (Character.isWhitespace(c)) { 60 | row.add(null); 61 | } else { 62 | if (mapping.containsKey(c)) { 63 | row.add(mapping.get(c)); 64 | } else { 65 | CraftTweakerAPI.getLogger().logWarning(MessageFormat.format( 66 | "The character ''{0}'' is not found in the mapping.", c)); 67 | } 68 | } 69 | } 70 | this.grip.put(i, row); 71 | } 72 | return mapToArray2D(); 73 | } 74 | 75 | @Override 76 | public IIngredient[] getWithShapeless() { 77 | return get()[0]; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/ftbultimine/IPlayerExpansionFTBU.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.ftbultimine; 2 | 3 | import crafttweaker.CraftTweakerAPI; 4 | import crafttweaker.IAction; 5 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 6 | import crafttweaker.api.minecraft.CraftTweakerMC; 7 | import crafttweaker.api.player.IPlayer; 8 | import ink.ikx.rt.impl.internal.capability.CapabilityRegistryHandler; 9 | import ink.ikx.rt.impl.internal.capability.CapabilityRegistryHandler.FTBUltimineTag; 10 | import ink.ikx.rt.impl.internal.network.NetworkManager; 11 | 12 | import net.minecraft.entity.player.EntityPlayer; 13 | import net.minecraft.entity.player.EntityPlayerMP; 14 | import stanhebben.zenscript.annotations.ZenClass; 15 | import stanhebben.zenscript.annotations.ZenExpansion; 16 | import stanhebben.zenscript.annotations.ZenMethod; 17 | import stanhebben.zenscript.annotations.ZenMethodStatic; 18 | 19 | import java.util.Objects; 20 | 21 | 22 | @SidedZenRegister(modDeps = "ftbultimine") 23 | @ZenExpansion("crafttweaker.player.IPlayer") 24 | @ZenClass("mods.randomtweaker.ftbultimine.IPlayer") 25 | public abstract class IPlayerExpansionFTBU { 26 | 27 | public static String langKey = null; 28 | 29 | @ZenMethod 30 | public static void setAllowFTBUltimine(IPlayer player, boolean flag) { 31 | EntityPlayer mcPlayer = CraftTweakerMC.getPlayer(player); 32 | if (!(mcPlayer instanceof EntityPlayerMP)) { 33 | CraftTweakerAPI.logError("The IPlayer object is not an EntityPlayerMP object."); 34 | return; 35 | } 36 | FTBUltimineTag capability = mcPlayer.getCapability(CapabilityRegistryHandler.FTB_ULTIMINE_CAPABILITY, null); 37 | Objects.requireNonNull(capability).setAllow(flag); 38 | 39 | NetworkManager.FTBUltimineTag.sendClientCustomPacket(mcPlayer); // send to client 40 | } 41 | 42 | @ZenMethod 43 | public static boolean isAllowFTBUltimine(IPlayer player) { 44 | EntityPlayer mcPlayer = CraftTweakerMC.getPlayer(player); 45 | if (!(mcPlayer instanceof EntityPlayerMP)) { 46 | CraftTweakerAPI.logError("The IPlayer object is not an EntityPlayerMP object."); 47 | return false; 48 | } 49 | FTBUltimineTag capability = mcPlayer.getCapability(CapabilityRegistryHandler.FTB_ULTIMINE_CAPABILITY, null); 50 | return Objects.requireNonNull(capability).isAllow(); 51 | } 52 | 53 | @ZenMethodStatic 54 | public static void setFTBUReminderMessage(String langKey) { 55 | CraftTweakerAPI.apply(new ActionReminderMessage(langKey)); 56 | } 57 | 58 | public static class ActionReminderMessage implements IAction { 59 | 60 | private final String langKey; 61 | 62 | public ActionReminderMessage(String langKey) { 63 | this.langKey = langKey; 64 | } 65 | 66 | @Override 67 | public void apply() { 68 | IPlayerExpansionFTBU.langKey = langKey; 69 | } 70 | 71 | @Override 72 | public String describe() { 73 | return "Setting FTBUltimine reminder message to " + langKey; 74 | } 75 | 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 48 | echo. 49 | echo Please set the JAVA_HOME variable in your environment to match the 50 | echo location of your Java installation. 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 62 | echo. 63 | echo Please set the JAVA_HOME variable in your environment to match the 64 | echo location of your Java installation. 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/botania/event/CTPoolTradeEvent.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.botania.event; 2 | 3 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 4 | import crafttweaker.api.entity.IEntityItem; 5 | import crafttweaker.api.event.IEventCancelable; 6 | import crafttweaker.api.item.IItemStack; 7 | import crafttweaker.api.minecraft.CraftTweakerMC; 8 | import crafttweaker.api.world.IBlockPos; 9 | import crafttweaker.api.world.IWorld; 10 | import ink.ikx.rt.impl.mods.botania.event.PoolTradeEvent; 11 | 12 | import stanhebben.zenscript.annotations.ZenClass; 13 | import stanhebben.zenscript.annotations.ZenGetter; 14 | import stanhebben.zenscript.annotations.ZenMethod; 15 | import stanhebben.zenscript.annotations.ZenSetter; 16 | 17 | 18 | @SidedZenRegister(modDeps = "botania") 19 | @ZenClass("mods.randomtweaker.botania.PoolTradeEvent") 20 | public abstract class CTPoolTradeEvent implements IEventCancelable { 21 | 22 | private final PoolTradeEvent event; 23 | 24 | protected CTPoolTradeEvent(PoolTradeEvent event) { 25 | this.event = event; 26 | } 27 | 28 | @ZenGetter("mana") 29 | public int getMana() { 30 | return event.getMana(); 31 | } 32 | 33 | @ZenMethod 34 | @ZenSetter("mana") 35 | public void setMana(int mana) { 36 | event.setMana(mana); 37 | } 38 | 39 | @ZenGetter("output") 40 | public IItemStack getOutput() { 41 | return CraftTweakerMC.getIItemStack(event.getOutput()); 42 | } 43 | 44 | @ZenMethod 45 | @ZenSetter("output") 46 | public void setOutput(IItemStack output) { 47 | event.setOutput(CraftTweakerMC.getItemStack(output)); 48 | } 49 | 50 | @ZenGetter("allowExceed") 51 | public boolean isAllowExceed() { 52 | return event.isAllowExceed(); 53 | } 54 | 55 | @ZenMethod 56 | @ZenSetter("allowExceed") 57 | public void setAllowExceed(boolean allowExceed) { 58 | event.setAllowExceed(allowExceed); 59 | } 60 | 61 | @ZenGetter("currentMana") 62 | public int getCurrentMana() { 63 | return event.getCurrentMana(); 64 | } 65 | 66 | @ZenGetter("input") 67 | public IEntityItem getInput() { 68 | return CraftTweakerMC.getIEntityItem(event.getInput()); 69 | } 70 | 71 | @ZenGetter("world") 72 | public IWorld getWorld() { 73 | return CraftTweakerMC.getIWorld(event.getWorld()); 74 | } 75 | 76 | @ZenGetter("blockPos") 77 | public IBlockPos getBlockPos() { 78 | return CraftTweakerMC.getIBlockPos(event.getBlockPos()); 79 | } 80 | 81 | @ZenGetter("alchemy") 82 | public boolean isAlchemy() { 83 | return event.isAlchemy(); 84 | } 85 | 86 | @ZenGetter("conjuration") 87 | public boolean isConjuration() { 88 | return event.isConjuration(); 89 | } 90 | 91 | @Override 92 | public boolean isCanceled() { 93 | return event.isCanceled(); 94 | } 95 | 96 | @Override 97 | public void setCanceled(boolean canceled) { 98 | event.setCanceled(canceled); 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/mods/contenttweaker/subtile/ISubTileEntityRepresentation.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.mods.contenttweaker.subtile; 2 | 3 | import crafttweaker.CraftTweakerAPI; 4 | import ink.ikx.rt.Main; 5 | import ink.ikx.rt.api.mods.contenttweaker.function.subtile.*; 6 | import org.apache.commons.lang3.tuple.Pair; 7 | import stanhebben.zenscript.annotations.ZenClass; 8 | import stanhebben.zenscript.annotations.ZenMethod; 9 | import stanhebben.zenscript.annotations.ZenProperty; 10 | import vazkii.botania.api.BotaniaAPI; 11 | import vazkii.botania.api.recipe.RecipeMiniFlower; 12 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 13 | 14 | @SidedZenRegister(modDeps = {"contenttweaker", "botania"}) 15 | @ZenClass("mods.randomtweaker.cote.ISubTileEntity") 16 | public abstract class ISubTileEntityRepresentation { 17 | 18 | @ZenProperty 19 | public int color; 20 | @ZenProperty 21 | public String unlocalizedName; 22 | @ZenProperty 23 | public int range = 1; 24 | @ZenProperty 25 | public int maxMana = 1000; 26 | @ZenProperty 27 | public boolean acceptsRedstone; 28 | @ZenProperty 29 | public boolean overgrowthAffected = true; 30 | @ZenProperty 31 | public Update onUpdate; 32 | @ZenProperty 33 | public CanSelect canSelect; 34 | @ZenProperty 35 | public BlockAdded onBlockAdded; 36 | @ZenProperty 37 | public BlockPlacedBy onBlockPlaceBy; 38 | @ZenProperty 39 | public BlockHarvested onBlockHarvested; 40 | @ZenProperty 41 | public BlockActivated onBlockActivated; 42 | 43 | protected ISubTileEntityRepresentation(int color, String unlocalizedName) { 44 | this.color = color; 45 | this.unlocalizedName = unlocalizedName; 46 | } 47 | 48 | @ZenMethod 49 | public void register(String typeName, boolean hasMini) { 50 | if (Main.SUB_TILE_GENERATING_MAP.containsKey(unlocalizedName)) { 51 | CraftTweakerAPI.logError("All SubTileEntity must be unique. Key: contenttweaker:" + unlocalizedName + " is not.", 52 | new UnsupportedOperationException()); 53 | } else { 54 | if (typeName.equals("functional")) { 55 | Main.SUB_TILE_GENERATING_MAP.put(unlocalizedName, Pair.of(typeName, this)); 56 | if (hasMini) 57 | registerMini(this); 58 | } else { 59 | Main.SUB_TILE_GENERATING_MAP.put(unlocalizedName, Pair.of(typeName, this)); 60 | } 61 | BotaniaAPI.subtilesForCreativeMenu.add(unlocalizedName); 62 | } 63 | } 64 | 65 | protected void registerMini(ISubTileEntityRepresentation subtile) { 66 | Main.SUB_TILE_GENERATING_MAP.put(unlocalizedName + "Chibi", Pair.of("functional", this)); 67 | BotaniaAPI.subtilesForCreativeMenu.add(unlocalizedName + "Chibi"); 68 | BotaniaAPI.miniFlowers.put(unlocalizedName, unlocalizedName + "Chibi"); 69 | 70 | RecipeMiniFlower recipe = new RecipeMiniFlower(unlocalizedName + "Chibi", unlocalizedName, 2500); 71 | BotaniaAPI.manaInfusionRecipes.add(recipe); 72 | BotaniaAPI.miniFlowerRecipes.add(recipe); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/ink/ikx/rt/api/vanilla/AttributeModificationListeners.java: -------------------------------------------------------------------------------- 1 | package ink.ikx.rt.api.vanilla; 2 | 3 | import crafttweaker.CraftTweakerAPI; 4 | import crafttweaker.IAction; 5 | import crafttweaker.api.entity.IEntityEquipmentSlot; 6 | import crafttweaker.api.entity.attribute.IEntityAttributeModifier; 7 | import crafttweaker.api.item.IIngredient; 8 | import crafttweaker.util.IEventHandler; 9 | import ink.ikx.rt.impl.internal.config.RTConfig; 10 | import stanhebben.zenscript.annotations.Optional; 11 | import stanhebben.zenscript.annotations.ZenExpansion; 12 | import stanhebben.zenscript.annotations.ZenMethod; 13 | import youyihj.zenutils.api.zenscript.SidedZenRegister; 14 | 15 | /** 16 | * @author youyihj 17 | */ 18 | 19 | @SidedZenRegister 20 | @ZenExpansion("crafttweaker.item.IIngredient") 21 | public class AttributeModificationListeners { 22 | @ZenMethod 23 | public static void addGlobalAttributeModifier(IIngredient ingredient, String attributeName, IEntityEquipmentSlot slot, IEntityAttributeModifier modifier, @Optional boolean clearPrevious) { 24 | CraftTweakerAPI.apply(new AddListenerAction(event -> { 25 | if (slot.equals(event.getSlot()) && ingredient.matches(event.getItem())) { 26 | if (clearPrevious) { 27 | event.clearModifier(attributeName); 28 | } 29 | event.putModifier(attributeName, modifier); 30 | } 31 | })); 32 | } 33 | 34 | @ZenMethod 35 | public static void removeGlobalAttributeModifier(IIngredient ingredient, String attributeName, IEntityEquipmentSlot slot, String uuid) { 36 | CraftTweakerAPI.apply(new AddListenerAction(event -> { 37 | if (slot.equals(event.getSlot()) && ingredient.matches(event.getItem())) { 38 | event.removeModifier(attributeName, uuid); 39 | } 40 | })); 41 | } 42 | 43 | @ZenMethod 44 | public static void clearGlobalAttributeModifier(IIngredient ingredient, String attributeName, IEntityEquipmentSlot slot) { 45 | CraftTweakerAPI.apply(new AddListenerAction(event -> { 46 | if (slot.equals(event.getSlot()) && ingredient.matches(event.getItem())) { 47 | event.clearModifier(attributeName); 48 | } 49 | })); 50 | } 51 | 52 | public static class AddListenerAction implements IAction { 53 | private final IEventHandler handler; 54 | 55 | public AddListenerAction(IEventHandler handler) { 56 | this.handler = handler; 57 | } 58 | 59 | @Override 60 | public void apply() { 61 | CTEventHandler.onItemAttributeModificationEvent(handler); 62 | } 63 | 64 | @Override 65 | public String describe() { 66 | return ""; 67 | } 68 | 69 | @Override 70 | public boolean validate() { 71 | return RTConfig.RandomTweaker.itemAttributeModification; 72 | } 73 | 74 | @Override 75 | public String describeInvalid() { 76 | return "Please change itemAttributeModification config to true"; 77 | } 78 | 79 | } 80 | 81 | } 82 | --------------------------------------------------------------------------------