Skip to content

Commit

Permalink
Merge branch 'refs/heads/dev/1.20.1' into fork/generic-peripherals
Browse files Browse the repository at this point in the history
  • Loading branch information
SirEndii committed Apr 10, 2024
2 parents 077a820 + 048e4b9 commit 30ad1f0
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 21 deletions.
36 changes: 28 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ repositories {
maven {
name = "Blamejared maven botania patchouli"
url = 'https://maven.blamejared.com'
content {
includeGroup("vazkii.botania")
includeGroup("vazkii.patchouli")
}
}
maven {
name = "Squiddev maven cct"
Expand All @@ -178,6 +182,9 @@ repositories {
maven {
name = "Theillusivec4 maven curios"
url = "https://maven.theillusivec4.top/"
content {
includeGroup("top.theillusivec4.curios")
}
}
maven {
name = "LDT Team minecolonies"
Expand All @@ -189,13 +196,19 @@ repositories {
maven {
name = "Modmaven Jei"
url = 'https://modmaven.dev/'
content {
includeGroup("mezz.jei")
includeGroup("appeng")
includeGroup("mekanism")
}
}
maven {
name = "Create maven"
url = "https://maven.tterrag.com/"
content {
includeGroup("com.simibubi.create")
includeGroup("com.jozufozu.flywheel")
includeGroup("com.tterrag.registrate")
}
}
maven {
Expand All @@ -208,28 +221,34 @@ repositories {
maven {
name = "Shedaniel cloth"
url = "https://maven.shedaniel.me/"
content {
includeGroup("dev.architectury")
includeGroup("me.shedaniel.cloth")
}
}
maven {
url = uri("https://maven.pkg.github.com/refinedmods/refinedstorage")
credentials {
username = "anything"
password = "\u0067hp_oGjcDFCn8jeTzIj4Ke9pLoEVtpnZMP4VQgaX"
}
content {
includeModule("com.refinedmods", "refinedstorage")
}
}
maven {
name = 'Kotlin for Forge'
url = 'https://thedarkcolour.github.io/KotlinForForge/'
content {
includeModule("thedarkcolour", "kotlinforforge")
}
}
maven {
url = "https://cursemaven.com"
content {
includeGroup "curse.maven"
}
}
maven {
name = "Intelligence repository"
url = "https://mvn.intelligence-modding.de/Intelligence"
}
}

configurations {
Expand Down Expand Up @@ -286,7 +305,7 @@ dependencies {

// Botania
compileOnly fg.deobf("vazkii.botania:Botania:${botania_version}")

runtimeOnly fg.deobf("vazkii.botania:Botania:${botania_version}")

// Minecolonies
// Remove/Comment this section if you want to use runData.
Expand All @@ -305,6 +324,7 @@ dependencies {

// Create
compileOnly fg.deobf("com.simibubi.create:create-1.20.1:${create_version}:all")
runtimeOnly fg.deobf("com.simibubi.create:create-1.20.1:${create_version}:all")

//Powah
implementation fg.deobf("curse.maven:powah-633483:${powah_version}")
Expand All @@ -327,8 +347,8 @@ dependencies {
implementation fg.deobf("mezz.jei:jei-${jei_version}")

// Create Crafts & Additions
compileOnly fg.deobf("curse.maven:createaddition-439890:5099757")
// runtimeOnly fg.deobf("curse.maven:createaddition-439890:5099757")
compileOnly fg.deobf("curse.maven:createaddition-439890:${createadditions_version}")
runtimeOnly fg.deobf("curse.maven:createaddition-439890:${createadditions_version}")
}


Expand Down Expand Up @@ -594,4 +614,4 @@ publishing {
}
}
}
}
}
9 changes: 5 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ cc_version=1.110.0
curios_version=5.2.0+1.20.1
minecolonies_version=1.20.1-1.1.472-BETA
appliedenergistics_version=15.0.9-beta
patchouli_version=1.20.1-81
patchouli_version=1.20.1-84
refinedstorage_version=1.12.3
botania_version=1.19.2-436-SNAPSHOT
create_version=0.5.1.d-9
botania_version=1.20.1-443-FORGE
create_version=0.5.1.f-27
createca_version=5099757
mekanism_version=1.20.1-10.4.2.16
ae2things_version=4616683
Expand All @@ -49,4 +49,5 @@ domumornamentum_version=1.20-1.0.150-BETA
flywheel_version=0.6.8.a-1

# Mod dependencies for testing stuff(Only used in the dev environment)
jei_version=1.20.1-forge:15.2.0.22
jei_version=1.20.1-forge:15.2.0.22
createadditions_version=5099752
12 changes: 8 additions & 4 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ pluginManagement {
maven {
name = 'NeoForged'
url = 'https://maven.neoforged.net/releases'
}
maven {
name = "Intelligence Minecraft"
url = "https://mvn.intelligence-modding.de/Minecraft"

content {
includeGroup("net.minecraftforge")
includeGroup("net.neoforged.gradle")
includeGroup("net.neoforged")
includeGroup("org.spongepowered.mixin")
includeGroup("org.spongepowered")
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,15 @@ public final int getMana() {
public final boolean isOnEnchantedSoil() {
return blockEntity.overgrowth;
}

@LuaFunction(mainThread = true)
public final boolean isFull() {
return blockEntity.getMana() >= blockEntity.getMaxMana();
}

@LuaFunction(mainThread = true)
public final boolean isEmpty() {
return blockEntity.getMana() == 0;
}

}
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
package de.srendi.advancedperipherals.common.addons.botania;

import dan200.computercraft.api.lua.LuaFunction;
import de.srendi.advancedperipherals.common.util.LuaConverter;
import de.srendi.advancedperipherals.lib.peripherals.BlockEntityIntegrationPeripheral;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.phys.AABB;
import org.jetbrains.annotations.NotNull;
import vazkii.botania.common.block.block_entity.mana.ManaPoolBlockEntity;

import java.util.List;
import java.util.stream.Collectors;

public class ManaPoolIntegration extends BlockEntityIntegrationPeripheral<ManaPoolBlockEntity> {

public ManaPoolIntegration(BlockEntity entity) {
Expand All @@ -25,8 +33,7 @@ public final int getMana() {

@LuaFunction(mainThread = true)
public final int getMaxMana() {
//TODO
return 0;
return blockEntity.getMaxMana();
}

@LuaFunction(mainThread = true)
Expand All @@ -39,4 +46,41 @@ public final boolean isFull() {
return blockEntity.isFull();
}

@LuaFunction(mainThread = true)
public final boolean isEmpty() {
return blockEntity.getCurrentMana() == 0;
}

@LuaFunction(mainThread = true)
public final boolean canChargeItem() {
return blockEntity.isOutputtingPower();
}

@LuaFunction(mainThread = true)
public final boolean hasItems() {
return !getPoolItems().isEmpty();
}

@LuaFunction(mainThread = true)
public final Object getItems() {
List<ItemStack> items = getPoolItems();
if(items.isEmpty())
return null;
Object[] luaStacks = new Object[items.size()];

for (int item = 0; item < items.size(); item++) {
luaStacks[item] = LuaConverter.stackToObject(items.get(item));
}

return luaStacks;
}

private List<ItemStack> getPoolItems() {
BlockPos position = blockEntity.getBlockPos();
return blockEntity.getLevel().getEntitiesOfClass(ItemEntity.class, new AABB(position, position.offset(1, 1, 1)))
.stream()
.map(ItemEntity::getItem)
.collect(Collectors.toList());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import dan200.computercraft.api.lua.LuaFunction;
import de.srendi.advancedperipherals.common.util.LuaConverter;
import de.srendi.advancedperipherals.lib.peripherals.BlockEntityIntegrationPeripheral;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.entity.BlockEntity;
import org.jetbrains.annotations.NotNull;
import vazkii.botania.common.block.block_entity.mana.ManaSpreaderBlockEntity;
Expand Down Expand Up @@ -47,7 +48,19 @@ public final boolean isFull() {

@LuaFunction(mainThread = true)
public final boolean isEmpty() {
return blockEntity.isEmpty();
return blockEntity.getCurrentMana() == 0;
}

@LuaFunction(mainThread = true)
public final boolean hasLens() {
return blockEntity.getItem(0) != ItemStack.EMPTY;
}

@LuaFunction(mainThread = true)
public final Object getLens() {
if(blockEntity.getItem(0) == ItemStack.EMPTY)
return null;
return LuaConverter.stackToObject(blockEntity.getItem(0));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@

public class IntegrationPeripheralProvider implements IPeripheralProvider {

//private static final String[] SUPPORTED_MODS = new String[]{"botania", "create", "mekanism", "powah"};
private static final String[] SUPPORTED_MODS = new String[]{"powah", "create", "mekanism"};
private static final String[] SUPPORTED_MODS = new String[]{"powah", "create", "mekanism", "botania"};

private static final PriorityQueue<IPeripheralIntegration> integrations = new PriorityQueue<>(Comparator.comparingInt(IPeripheralIntegration::getPriority));

Expand Down

0 comments on commit 30ad1f0

Please sign in to comment.