Skip to content
This repository was archived by the owner on Jul 18, 2023. It is now read-only.

Commit a0d296b

Browse files
committed
feat: split gear inverntory into smaller sub-inventories
1 parent 7a15d67 commit a0d296b

19 files changed

+266
-24
lines changed

build.gradle.kts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import java.time.format.DateTimeFormatter
44
plugins {
55
java
66
`maven-publish`
7-
id("fabric-loom") version "0.8-SNAPSHOT"
7+
id("fabric-loom") version "0.9-SNAPSHOT"
88
id("org.cadixdev.licenser") version "0.6.1"
99
}
1010

@@ -15,7 +15,7 @@ val fabric = "0.37.1+1.17"
1515
val lba = "0.9.0"
1616

1717
group = "dev.galacticraft"
18-
version ="0.4.0-prealpha.15-m+$mc"
18+
version ="0.4.0-prealpha.15+$mc"
1919

2020
base.archivesName.set("GalacticraftAPI")
2121

@@ -27,8 +27,11 @@ val testmodSourceSet = sourceSets.create("testmod") {
2727
}
2828

2929
loom {
30-
refmapName = "galacticraft-api.refmap.json"
31-
accessWidener(project.file("src/main/resources/galacticraft-api.accesswidener"))
30+
accessWidenerPath.set(project.file("src/main/resources/galacticraft-api.accesswidener"))
31+
mixin {
32+
add(sourceSets.getByName("testmod"), "gc-testmod.refmap.json")
33+
add(sourceSets.getByName("main"), "galacticraft-api.refmap.json")
34+
}
3235

3336
runs {
3437
register("TestModClient") {

src/main/java/dev/galacticraft/api/accessor/GearInventoryProvider.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@
3131
public interface GearInventoryProvider {
3232
FixedItemInv getGearInv();
3333

34+
FixedItemInv getOxygenTanks();
35+
36+
FixedItemInv getThermalArmor();
37+
38+
FixedItemInv getAccessories();
39+
3440
NbtCompound writeGearToNbt(NbtCompound tag);
3541

3642
void readGearFromNbt(NbtCompound tag);

src/main/java/dev/galacticraft/api/gas/GasComposition.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import com.mojang.serialization.Codec;
2626
import com.mojang.serialization.codecs.RecordCodecBuilder;
2727
import dev.galacticraft.api.registry.AddonRegistry;
28-
import dev.galacticraft.impl.internal.codec.MapCodec;
28+
import dev.galacticraft.impl.codec.MapCodec;
2929
import it.unimi.dsi.fastutil.objects.Object2DoubleArrayMap;
3030
import it.unimi.dsi.fastutil.objects.Object2DoubleMap;
3131
import net.minecraft.network.PacketByteBuf;

src/main/java/dev/galacticraft/api/item/Accessory.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,17 @@
2222

2323
package dev.galacticraft.api.item;
2424

25+
import net.minecraft.entity.LivingEntity;
26+
2527
/**
2628
* @author <a href="https://github.com/TeamGalacticraft">TeamGalacticraft</a>
2729
*/
2830
public interface Accessory {
2931
default boolean enablesHearing() {
3032
return false;
3133
}
34+
35+
default void tick(LivingEntity entity) {
36+
37+
}
3238
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright (c) 2019-2021 Team Galacticraft
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in all
12+
* copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*/
22+
23+
package dev.galacticraft.api.item;
24+
25+
public interface OxygenGear extends Accessory {
26+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright (c) 2019-2021 Team Galacticraft
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in all
12+
* copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*/
22+
23+
package dev.galacticraft.api.item;
24+
25+
public interface OxygenMask extends Accessory {
26+
}

src/main/java/dev/galacticraft/impl/internal/codec/MapCodec.java renamed to src/main/java/dev/galacticraft/impl/codec/MapCodec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* SOFTWARE.
2121
*/
2222

23-
package dev.galacticraft.impl.internal.codec;
23+
package dev.galacticraft.impl.codec;
2424

2525
import com.mojang.datafixers.util.Pair;
2626
import com.mojang.serialization.*;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* SOFTWARE.
2121
*/
2222

23-
package dev.galacticraft.impl.internal.command.argument;
23+
package dev.galacticraft.impl.command.argument;
2424

2525
import com.google.common.collect.ImmutableList;
2626
import com.mojang.brigadier.StringReader;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright (c) 2019-2021 Team Galacticraft
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in all
12+
* copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*/
22+
23+
@ApiStatus.Internal
24+
package dev.galacticraft.impl.internal.accessor;
25+
26+
import org.jetbrains.annotations.ApiStatus;

src/main/java/dev/galacticraft/impl/internal/client/fabric/GalacticraftAPIClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@
3939
import net.minecraft.nbt.NbtOps;
4040
import net.minecraft.network.PacketByteBuf;
4141
import net.minecraft.util.Identifier;
42+
import org.jetbrains.annotations.ApiStatus;
4243

4344
import java.util.Objects;
4445

46+
@ApiStatus.Internal
4547
@Environment(EnvType.CLIENT)
4648
public class GalacticraftAPIClient implements ClientModInitializer {
4749
@Override

0 commit comments

Comments
 (0)