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

Commit

Permalink
Merge branch 'dev/0.4' into feat/dev/0.4/teams-rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
JustPyrrha committed Aug 27, 2021
2 parents 251ef6f + 5a1babe commit 63eb74b
Show file tree
Hide file tree
Showing 120 changed files with 3,893 additions and 746 deletions.
32 changes: 17 additions & 15 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@ import java.time.format.DateTimeFormatter
plugins {
java
`maven-publish`
id("fabric-loom") version "0.8-SNAPSHOT"
id("org.cadixdev.licenser") version "0.5.1"
id("fabric-loom") version "0.9-SNAPSHOT"
id("org.cadixdev.licenser") version "0.6.1"
}

val mc = "1.17"
val yarn = "1"
val loader = "0.11.3"
val fabric = "0.34.9+1.17"
val mc = "1.17.1"
val yarn = "29"
val loader = "0.11.6"
val fabric = "0.37.1+1.17"
val lba = "0.9.0"

group = "dev.galacticraft"
version ="0.4.0-prealpha3+$mc"
version ="0.4.0-prealpha.18+$mc"

base {
archivesBaseName = "GalacticraftAPI"
}
base.archivesName.set("GalacticraftAPI")

val testmodSourceSet = sourceSets.create("testmod") {
compileClasspath += sourceSets.main.get().compileClasspath
Expand All @@ -29,8 +27,11 @@ val testmodSourceSet = sourceSets.create("testmod") {
}

loom {
refmapName = "galacticraft-api.refmap.json"
accessWidener(project.file("src/main/resources/galacticraft-api.accesswidener"))
accessWidenerPath.set(project.file("src/main/resources/galacticraft-api.accesswidener"))
mixin {
add(sourceSets.getByName("testmod"), "gc-testmod.refmap.json")
add(sourceSets.getByName("main"), "galacticraft-api.refmap.json")
}

runs {
register("TestModClient") {
Expand Down Expand Up @@ -78,6 +79,7 @@ dependencies {
}

modImplementation("alexiil.mc.lib:libblockattributes-core:$lba")
modImplementation("alexiil.mc.lib:libblockattributes-items:$lba")
modRuntime("net.fabricmc.fabric-api:fabric-api:$fabric")

testmodCompile(sourceSets.main.get().output)
Expand Down Expand Up @@ -117,12 +119,12 @@ tasks.withType<JavaCompile> {

val sourcesJar = tasks.create<Jar>("sourcesJarGC") {
dependsOn(tasks.classes)
classifier = "sources"
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}

val javadocJar = tasks.create<Jar>("javadocJarGC") {
classifier = "javadoc"
archiveClassifier.set("javadoc")
from(tasks.javadoc)
}

Expand Down Expand Up @@ -170,7 +172,7 @@ publishing {
}

license {
header = project.file("LICENSE_HEADER.txt")
setHeader(project.file("LICENSE_HEADER.txt"))
include("**/dev/galacticraft/**/*.java")
include("build.gradle.kts")
ext {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright (c) 2019-2021 Team Galacticraft
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package dev.galacticraft.api.accessor;

/**
* @author <a href="https://github.com/TeamGalacticraft">TeamGalacticraft</a>
*/
public interface ChunkOxygenAccessor {
/**
* Returns whether the supplied position in the chunk is breathable for entities
* @param x the position to test on the X-axis, normalized from 0 to 15
* @param y the position to test on the Y-axis, will return {@code false} if it is outside the world's min/max height
* @param z the position to test on the Z-axis, normalized from 0 to 15
* @return whether the supplied position in the chunk is breathable for entities
*/
boolean isBreathable(int x, int y, int z);

/**
* Sets the breathable state for entities for the supplied position
* @param x the position to test on the X-axis, normalized from 0 to 15
* @param y the position to test on the Y-axis, this method will do nothing if it is outside the world's min/max height
* @param z the position to test on the Z-axis, normalized from 0 to 15
* @param value whether the supplied position is breathable
*/
void setBreathable(int x, int y, int z, boolean value);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2019-2021 Team Galacticraft
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package dev.galacticraft.api.accessor;

/**
* @author <a href="https://github.com/TeamGalacticraft">TeamGalacticraft</a>
*/
public interface ChunkSectionOxygenAccessor {
boolean isBreathable(int x, int y, int z);

void setBreathable(int x, int y, int z, boolean value);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Copyright (c) 2019-2021 Team Galacticraft
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package dev.galacticraft.api.accessor;

import alexiil.mc.lib.attributes.item.FixedItemInv;
import net.minecraft.nbt.NbtCompound;

/**
* @author <a href="https://github.com/TeamGalacticraft">TeamGalacticraft</a>
*/
public interface GearInventoryProvider {
FixedItemInv getGearInv();

FixedItemInv getOxygenTanks();

FixedItemInv getThermalArmor();

FixedItemInv getAccessories();

NbtCompound writeGearToNbt(NbtCompound tag);

void readGearFromNbt(NbtCompound tag);
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,10 @@
import net.minecraft.util.Identifier;

public interface ResearchAccessor {
boolean hasUnlocked_gcr(Identifier id);
/**
* Returns whether the supplied rocket part is unlocked for the player
* @param id The ID of the rocket part to test for
* @return whether the supplied rocket part is unlocked for the player
*/
boolean hasUnlocked_gc(Identifier id);
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@
import dev.galacticraft.impl.universe.celestialbody.type.SatelliteType;
import dev.galacticraft.impl.universe.position.config.SatelliteConfig;
import net.minecraft.util.Identifier;
import org.jetbrains.annotations.Unmodifiable;

import java.util.Map;

public interface SatelliteAccessor {
@Unmodifiable Map<Identifier, CelestialBody<SatelliteConfig, SatelliteType>> satellites();
Map<Identifier, CelestialBody<SatelliteConfig, SatelliteType>> satellites();

void addSatellite(Identifier id, CelestialBody<SatelliteConfig, SatelliteType> satellite);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
import net.minecraft.util.Identifier;

public interface ServerResearchAccessor extends ResearchAccessor {
void setUnlocked_gcr(Identifier id, boolean unlocked);
void setUnlocked_gc(Identifier id, boolean unlocked);

boolean changed_gcr();
boolean changed_gc();

PacketByteBuf writeResearchChanges_gcr(PacketByteBuf buf);
PacketByteBuf writeResearchChanges_gc(PacketByteBuf buf);

NbtCompound writeToNbt_gcr(NbtCompound nbt);
NbtCompound writeToNbt_gc(NbtCompound nbt);

void readFromNbt_gcr(NbtCompound nbt);
void readFromNbt_gc(NbtCompound nbt);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright (c) 2019-2021 Team Galacticraft
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package dev.galacticraft.api.accessor;

import org.jetbrains.annotations.ApiStatus;

/**
* @author <a href="https://github.com/TeamGalacticraft">TeamGalacticraft</a>
*/
@ApiStatus.Internal
public interface SoundSystemAccessor {
void gc_updateAtmosphericMultiplier(float multiplier);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2019-2021 Team Galacticraft
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package dev.galacticraft.api.accessor;

import net.minecraft.util.math.BlockPos;

/**
* @author <a href="https://github.com/TeamGalacticraft">TeamGalacticraft</a>
*/
public interface WorldOxygenAccessor {
/**
* Returns whether the supplied position in this world is breathable for entities
* @param pos the position to test
* @return whether the supplied position in the chunk is breathable for entities
*/
boolean isBreathable(BlockPos pos);

void setBreathable(BlockPos pos, boolean value);
}
41 changes: 41 additions & 0 deletions src/main/java/dev/galacticraft/api/attribute/GcApiAttributes.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright (c) 2019-2021 Team Galacticraft
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package dev.galacticraft.api.attribute;

import alexiil.mc.lib.attributes.Attributes;
import alexiil.mc.lib.attributes.DefaultedAttribute;
import dev.galacticraft.api.attribute.oxygen.EmptyOxygenTank;
import dev.galacticraft.api.attribute.oxygen.OxygenTank;
import dev.galacticraft.api.attribute.oxygen.extractable.EmptyOxygenExtractable;
import dev.galacticraft.api.attribute.oxygen.extractable.OxygenExtractable;
import dev.galacticraft.api.attribute.oxygen.insertable.OxygenInsertable;
import dev.galacticraft.api.attribute.oxygen.insertable.RejectingOxygenInsertable;
import dev.galacticraft.api.attribute.oxygen.transferable.EmptyOxygenTransferable;
import dev.galacticraft.api.attribute.oxygen.transferable.OxygenTransferable;

public class GcApiAttributes {
public static final DefaultedAttribute<OxygenTank> OXYGEN_TANK = Attributes.createDefaulted(OxygenTank.class, EmptyOxygenTank.NULL);
public static final DefaultedAttribute<OxygenInsertable> OXYGEN_INSERTABLE = Attributes.createDefaulted(OxygenInsertable.class, RejectingOxygenInsertable.NULL);
public static final DefaultedAttribute<OxygenExtractable> OXYGEN_EXTRACTABLE = Attributes.createDefaulted(OxygenExtractable.class, EmptyOxygenExtractable.NULL);
public static final DefaultedAttribute<OxygenTransferable> OXYGEN_TRANSFERABLE = Attributes.createDefaulted(OxygenTransferable.class, EmptyOxygenTransferable.NULL);
}
Loading

0 comments on commit 63eb74b

Please sign in to comment.