Skip to content

Commit

Permalink
Merge branch 'dev/transfer' of https://github.com/KessokuTeaTime/Kess…
Browse files Browse the repository at this point in the history
…oku-Lib into dev/transfer
  • Loading branch information
Chemiofitor4096 committed Nov 30, 2024
2 parents ff6c35b + bf5eb27 commit 935b5ba
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import band.kessoku.lib.api.data.DataAccess;
import band.kessoku.lib.api.data.DataStructure;

import net.minecraft.block.entity.BlockEntity;

@FunctionalInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@

import band.kessoku.lib.api.data.Storage;
import band.kessoku.lib.impl.ItemSidinator;
import net.minecraft.block.entity.BlockEntityType;
import org.slf4j.Marker;
import org.slf4j.MarkerFactory;

import net.minecraft.block.entity.BlockEntityType;

public class KessokuBlockEntity {
public static final String MOD_ID = "kessoku_blockentity";
public static final String NAME = "Kessoku Block Entity API";
Expand Down
19 changes: 17 additions & 2 deletions data/common/src/main/java/band/kessoku/lib/api/data/Sidinator.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
/*
* Copyright (c) 2024 KessokuTeaTime
*
* Licensed under the GNU Lesser General Pubic License, Version 3 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.gnu.org/licenses/lgpl-3.0.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package band.kessoku.lib.api.data;

import net.minecraft.util.math.Direction;

import java.util.List;

import net.minecraft.util.math.Direction;

public interface Sidinator<S extends DataStructure> extends DataStructure {
List<Integer> get(Direction direction);
}
15 changes: 15 additions & 0 deletions data/common/src/main/java/band/kessoku/lib/api/data/Storage.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (c) 2024 KessokuTeaTime
*
* Licensed under the GNU Lesser General Pubic License, Version 3 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.gnu.org/licenses/lgpl-3.0.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package band.kessoku.lib.api.data;

import net.minecraft.inventory.Inventory;
Expand Down
15 changes: 15 additions & 0 deletions data/common/src/main/java/band/kessoku/lib/api/data/Timer.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (c) 2024 KessokuTeaTime
*
* Licensed under the GNU Lesser General Pubic License, Version 3 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.gnu.org/licenses/lgpl-3.0.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package band.kessoku.lib.api.data;

public interface Timer extends DataStructure {
Expand Down
26 changes: 21 additions & 5 deletions data/common/src/main/java/band/kessoku/lib/impl/ItemSidinator.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
/*
* Copyright (c) 2024 KessokuTeaTime
*
* Licensed under the GNU Lesser General Pubic License, Version 3 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.gnu.org/licenses/lgpl-3.0.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package band.kessoku.lib.impl;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.BiConsumer;

import band.kessoku.lib.api.data.Sidinator;
import band.kessoku.lib.api.data.Storage;
import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;

import net.minecraft.item.ItemStack;
import net.minecraft.network.RegistryByteBuf;
import net.minecraft.network.codec.PacketCodec;
import net.minecraft.util.math.Direction;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.BiConsumer;

public class ItemSidinator implements Sidinator<Storage<ItemStack>> {
public static Codec<ItemSidinator> CODEC = RecordCodecBuilder.create(instance -> instance.group(
Codec.INT.listOf().fieldOf("down").forGetter((sidinator -> sidinator.get(Direction.DOWN))),
Expand Down

0 comments on commit 935b5ba

Please sign in to comment.