This commit is contained in:
SD 2021-04-12 15:19:07 +05:30
parent 1c26a37b46
commit 0436f81e6d
6 changed files with 49 additions and 4 deletions

View file

@ -0,0 +1,15 @@
package org.dimdev.dimdoors.api.util.function;
import java.util.Objects;
import java.util.function.Function;
@FunctionalInterface
public interface HexFunction<T, U, V, W, X, Y, R> {
R apply(T t, U u, V v, W w, X x, Y y);
default <A> HexFunction<T, U, V, W, X, Y, A> andThen(Function<R, A> after) {
Objects.requireNonNull(after);
return (T t, U u, V v, W w, X x, Y y) -> after.apply(apply(t, u, v, w, x, y));
}
}

View file

@ -0,0 +1,15 @@
package org.dimdev.dimdoors.api.util.function;
import java.util.Objects;
import java.util.function.Function;
@FunctionalInterface
public interface PentFunction<T, U, V, W, X, R> {
R apply(T t, U u, V v, W w, X x);
default <A> PentFunction<T, U, V, W, X, A> andThen(Function<R, A> after) {
Objects.requireNonNull(after);
return (T t, U u, V v, W w, X x) -> after.apply(apply(t, u, v, w, x));
}
}

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.api.util;
package org.dimdev.dimdoors.api.util.function;
import java.util.Objects;
import java.util.function.Function;

View file

@ -0,0 +1,15 @@
package org.dimdev.dimdoors.api.util.function;
import java.util.Objects;
import java.util.function.Function;
@FunctionalInterface
public interface SeptFunction<T, U, V, W, X, Y, Z, R> {
R apply(T t, U u, V v, W w, X x, Y y, Z z);
default <A> SeptFunction<T, U, V, W, X, Y, Z, A> andThen(Function<R, A> after) {
Objects.requireNonNull(after);
return (T t, U u, V v, W w, X x, Y y, Z z) -> after.apply(apply(t, u, v, w, x, y, z));
}
}

View file

@ -1,4 +1,4 @@
package org.dimdev.dimdoors.api.util;
package org.dimdev.dimdoors.api.util.function;
import java.util.Objects;
import java.util.function.Function;

View file

@ -1,7 +1,7 @@
package org.dimdev.dimdoors.item;
import net.fabricmc.fabric.api.event.registry.RegistryEntryAddedCallback;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.minecraft.block.Block;
import net.minecraft.block.DoorBlock;
import net.minecraft.block.TrapdoorBlock;
@ -15,7 +15,7 @@ import net.minecraft.text.TranslatableText;
import net.minecraft.util.Identifier;
import net.minecraft.util.Pair;
import net.minecraft.util.registry.Registry;
import org.dimdev.dimdoors.api.util.QuadFunction;
import org.dimdev.dimdoors.api.util.function.QuadFunction;
import org.dimdev.dimdoors.block.door.DimensionalDoorBlock;
import org.dimdev.dimdoors.block.door.DimensionalTrapdoorBlock;
import org.dimdev.dimdoors.block.entity.EntranceRiftBlockEntity;