Skip to content

Commit

Permalink
Fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Juuxel committed Dec 5, 2019
1 parent 1e36ca8 commit d15f8b4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ dependencies {
modRuntime "artificemc:artifice:$project.artifice"

modRuntime group: "alexiil.mc.mod", name: "simplepipes-all", version: project.simplepipes

compileOnly "com.google.code.findbugs:jsr305:3.0.2"
}

processResources {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ yarn_mappings = 1.14.4+build.13
loader_version = 0.6.3+build.168

# Mod Properties
mod_version = 1.1.0
mod_version = 1.1.1
maven_group = io.github.juuxel
archives_base_name = VanillaParts

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/juuxel/vanillaparts/mixin/FenceBlockMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package juuxel.vanillaparts.mixin;

import alexiil.mc.lib.multipart.api.MultipartContainer;
import alexiil.mc.lib.multipart.api.MultipartUtil;
import alexiil.mc.lib.multipart.api.NativeMultipart;
import juuxel.vanillaparts.part.FencePart;
import juuxel.vanillaparts.part.VPartDefinitions;
Expand Down Expand Up @@ -43,7 +42,7 @@ public List<MultipartContainer.MultipartCreator> getMultipartConversion(World wo

@Override
public boolean vanillaParts_canConnect(IWorld world, BlockPos neighborPos, Direction sideOfOther) {
MultipartContainer container = MultipartUtil.get((World) world, neighborPos);
MultipartContainer container = Util.getPartContainer(world, neighborPos);
return container != null && !container.getAllParts(part -> part instanceof FencePart && ((FencePart) part).getBlock().getDefaultState().getMaterial() == this.material && !((FencePart) part).isBlocked(sideOfOther)).isEmpty();
}

Expand Down
14 changes: 14 additions & 0 deletions src/main/java/juuxel/vanillaparts/util/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@

package juuxel.vanillaparts.util;

import alexiil.mc.lib.multipart.api.MultipartContainer;
import alexiil.mc.lib.multipart.api.MultipartUtil;
import net.fabricmc.fabric.api.event.registry.RegistryEntryAddedCallback;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.IWorld;
import net.minecraft.world.World;

import javax.annotation.Nullable;
import java.util.function.BiConsumer;
import java.util.function.Consumer;

Expand Down Expand Up @@ -51,4 +56,13 @@ public static Direction compare(BlockPos origin, BlockPos target) {
else if (y == -1) return Direction.DOWN;
else return Direction.UP;
}

/**
* @deprecated See <a href="https://github.com/AlexIIL/LibMultiPart/issues/8">AlexIIL/LibMultipart#8</a>.
*/
@Deprecated
@Nullable
public static MultipartContainer getPartContainer(IWorld world, BlockPos pos) {
return world instanceof World ? MultipartUtil.get((World) world, pos) : null;
}
}

0 comments on commit d15f8b4

Please sign in to comment.