mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-10-30 21:23:00 +00:00
Support resource conditions in upgrade JSON
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
package dan200.computercraft.shared.platform;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.brigadier.arguments.ArgumentType;
|
||||
import dan200.computercraft.api.ComputerCraftAPI;
|
||||
@@ -26,6 +27,7 @@ import net.fabricmc.fabric.api.lookup.v1.block.BlockApiCache;
|
||||
import net.fabricmc.fabric.api.lookup.v1.block.BlockApiLookup;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder;
|
||||
import net.fabricmc.fabric.api.registry.FuelRegistry;
|
||||
import net.fabricmc.fabric.api.resource.conditions.v1.ResourceConditions;
|
||||
import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerFactory;
|
||||
import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerType;
|
||||
import net.fabricmc.fabric.api.tag.convention.v1.ConventionalItemTags;
|
||||
@@ -119,6 +121,11 @@ public class PlatformHelperImpl implements PlatformHelper {
|
||||
return getRegistry(registry).get(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldLoadResource(JsonObject object) {
|
||||
return ResourceConditions.objectMatchesConditions(object);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends BlockEntity> BlockEntityType<T> createBlockEntityType(BiFunction<BlockPos, BlockState, T> factory, Block block) {
|
||||
return FabricBlockEntityTypeBuilder.create(factory::apply).addBlock(block).build();
|
||||
|
||||
Reference in New Issue
Block a user