use maven-publish plugin

This commit is contained in:
dags- 2020-02-26 14:20:32 +00:00
parent 8b58e0fac7
commit 179965fc9c
10 changed files with 227 additions and 269 deletions

@ -1 +1 @@
Subproject commit a53367b857a43107877096869c40d53fa16fd216
Subproject commit 8ec2190c3b28a0299e4e6610bdccfbe10cd10266

View File

@ -9,7 +9,7 @@ repositories {
}
dependencies {
implementation "com.terraforged:TerraForgedAPI:0.0.1-mc1.15.2:deobf@jar"
implementation "com.terraforged:TerraForgedAPI:0.0.1-mc1.15.2"
}
```

View File

@ -10,10 +10,10 @@ buildscript {
}
apply plugin: "net.minecraftforge.gradle"
apply plugin: "maven-publish"
apply plugin: "eclipse"
apply plugin: "maven"
version = "${version}-mc${mc_version}"
version = "${mc_version}-${version}"
archivesBaseName = "TerraForgedAPI"
repositories {
@ -32,28 +32,29 @@ minecraft {
mappings channel: mcp_channel, version: mcp_version
}
task deobfApiJar(type: Jar, dependsOn: classes) {
classifier = "deobf"
duplicatesStrategy = "EXCLUDE"
jar {
from("$buildDir/classes/java/main")
from(project(":Noise2D").buildDir.getPath() + "/classes/java/main")
from(project(":FeatureManager").buildDir.getPath() + "/classes/java/main")
from(project(":TerraForgedCore").buildDir.getPath() + "/classes/java/main")
}
jar {
dependsOn(deobfApiJar)
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
}
}
artifacts{
archives deobfApiJar
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: "https://io.terraforged.com/repository/maven/") {
authentication(userName: System.getenv("MAVEN_USER"), password: System.getenv("MAVEN_PASS"))
if (System.getenv("MAVEN_USER") != null && System.getenv("MAVEN_PASS") != null) {
repositories {
maven {
credentials {
username System.getenv("MAVEN_USER")
password System.getenv("MAVEN_PASS")
}
name = "nexus"
url = "https://io.terraforged.com/repository/maven/"
}
}
}

View File

@ -1,35 +0,0 @@
/*
*
* MIT License
*
* Copyright (c) 2020 TerraForged
*
* 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 com.terraforged.api.chunk;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.chunk.IChunk;
public interface ChunkAccess extends IChunk {
BlockState getState(BlockPos pos);
}

View File

@ -41,7 +41,6 @@ import net.minecraft.util.math.RayTraceContext;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.palette.UpgradeData;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.ITickList;
import net.minecraft.world.IWorld;
import net.minecraft.world.biome.BiomeContainer;
@ -57,296 +56,273 @@ import java.util.BitSet;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.stream.Stream;
public class ChunkDelegate implements ChunkAccess {
public interface ChunkDelegate extends IChunk {
private final IChunk chunk;
IChunk getDelegate();
public ChunkDelegate(IChunk chunk) {
this.chunk = chunk;
}
public IChunk getChunk() {
return chunk;
@Override
@Nullable
default BlockState setBlockState(BlockPos pos, BlockState state, boolean isMoving) {
return getDelegate().setBlockState(pos, state, isMoving);
}
@Override
public BlockState getState(BlockPos pos) {
return chunk.getBlockState(pos);
default void addTileEntity(BlockPos pos, TileEntity tileEntityIn) {
getDelegate().addTileEntity(pos, tileEntityIn);
}
@Override
default void addEntity(Entity entityIn) {
getDelegate().addEntity(entityIn);
}
@Override
@Nullable
public BlockState setBlockState(BlockPos pos, BlockState state, boolean isMoving) {
return chunk.setBlockState(pos, state, isMoving);
default ChunkSection getLastExtendedBlockStorage() {
return getDelegate().getLastExtendedBlockStorage();
}
@Override
public void addTileEntity(BlockPos pos, TileEntity tileEntityIn) {
chunk.addTileEntity(pos, tileEntityIn);
default int getTopFilledSegment() {
return getDelegate().getTopFilledSegment();
}
@Override
public void addEntity(Entity entityIn) {
chunk.addEntity(entityIn);
default Set<BlockPos> getTileEntitiesPos() {
return getDelegate().getTileEntitiesPos();
}
@Override
default ChunkSection[] getSections() {
return getDelegate().getSections();
}
@Override
default Collection<Map.Entry<Heightmap.Type, Heightmap>> getHeightmaps() {
return getDelegate().getHeightmaps();
}
@Override
default void setHeightmap(Heightmap.Type type, long[] data) {
getDelegate().setHeightmap(type, data);
}
@Override
default Heightmap getHeightmap(Heightmap.Type type) {
return getDelegate().getHeightmap(type);
}
@Override
default int getTopBlockY(Heightmap.Type heightmapType, int x, int z) {
return getDelegate().getTopBlockY(heightmapType, x, z);
}
@Override
default ChunkPos getPos() {
return getDelegate().getPos();
}
@Override
default void setLastSaveTime(long saveTime) {
getDelegate().setLastSaveTime(saveTime);
}
@Override
default Map<String, StructureStart> getStructureStarts() {
return getDelegate().getStructureStarts();
}
@Override
default void setStructureStarts(Map<String, StructureStart> structureStartsIn) {
getDelegate().setStructureStarts(structureStartsIn);
}
@Override
default boolean isEmptyBetween(int startY, int endY) {
return getDelegate().isEmptyBetween(startY, endY);
}
@Override
@Nullable
public ChunkSection getLastExtendedBlockStorage() {
return chunk.getLastExtendedBlockStorage();
default BiomeContainer getBiomes() {
return getDelegate().getBiomes();
}
@Override
public int getTopFilledSegment() {
return chunk.getTopFilledSegment();
default void setModified(boolean modified) {
getDelegate().setModified(modified);
}
@Override
public Set<BlockPos> getTileEntitiesPos() {
return chunk.getTileEntitiesPos();
default boolean isModified() {
return getDelegate().isModified();
}
@Override
public ChunkSection[] getSections() {
return chunk.getSections();
default ChunkStatus getStatus() {
return getDelegate().getStatus();
}
@Override
public Collection<Map.Entry<Heightmap.Type, Heightmap>> getHeightmaps() {
return chunk.getHeightmaps();
default void removeTileEntity(BlockPos pos) {
getDelegate().removeTileEntity(pos);
}
@Override
public void setHeightmap(Heightmap.Type type, long[] data) {
chunk.setHeightmap(type, data);
default void markBlockForPostprocessing(BlockPos pos) {
getDelegate().markBlockForPostprocessing(pos);
}
@Override
public Heightmap getHeightmap(Heightmap.Type type) {
return chunk.getHeightmap(type);
default ShortList[] getPackedPositions() {
return getDelegate().getPackedPositions();
}
@Override
public int getTopBlockY(Heightmap.Type heightmapType, int x, int z) {
return chunk.getTopBlockY(heightmapType, x, z);
default void func_201636_b(short packedPosition, int index) {
getDelegate().func_201636_b(packedPosition, index);
}
@Override
public ChunkPos getPos() {
return chunk.getPos();
}
@Override
public void setLastSaveTime(long saveTime) {
chunk.setLastSaveTime(saveTime);
}
@Override
public Map<String, StructureStart> getStructureStarts() {
return chunk.getStructureStarts();
}
@Override
public void setStructureStarts(Map<String, StructureStart> structureStartsIn) {
chunk.setStructureStarts(structureStartsIn);
}
@Override
public boolean isEmptyBetween(int startY, int endY) {
return chunk.isEmptyBetween(startY, endY);
default void addTileEntity(CompoundNBT nbt) {
getDelegate().addTileEntity(nbt);
}
@Override
@Nullable
public BiomeContainer getBiomes() {
return chunk.getBiomes();
}
@Override
public void setModified(boolean modified) {
chunk.setModified(modified);
}
@Override
public boolean isModified() {
return chunk.isModified();
}
@Override
public ChunkStatus getStatus() {
return chunk.getStatus();
}
@Override
public void removeTileEntity(BlockPos pos) {
chunk.removeTileEntity(pos);
}
@Override
public void markBlockForPostprocessing(BlockPos pos) {
chunk.markBlockForPostprocessing(pos);
}
@Override
public ShortList[] getPackedPositions() {
return chunk.getPackedPositions();
}
@Override
public void func_201636_b(short packedPosition, int index) {
chunk.func_201636_b(packedPosition, index);
}
@Override
public void addTileEntity(CompoundNBT nbt) {
chunk.addTileEntity(nbt);
default CompoundNBT getDeferredTileEntity(BlockPos pos) {
return getDelegate().getDeferredTileEntity(pos);
}
@Override
@Nullable
public CompoundNBT getDeferredTileEntity(BlockPos pos) {
return chunk.getDeferredTileEntity(pos);
default CompoundNBT getTileEntityNBT(BlockPos pos) {
return getDelegate().getTileEntityNBT(pos);
}
@Override
default Stream<BlockPos> getLightSources() {
return getDelegate().getLightSources();
}
@Override
default ITickList<Block> getBlocksToBeTicked() {
return getDelegate().getBlocksToBeTicked();
}
@Override
default ITickList<Fluid> getFluidsToBeTicked() {
return getDelegate().getFluidsToBeTicked();
}
@Override
default BitSet getCarvingMask(GenerationStage.Carving type) {
return getDelegate().getCarvingMask(type);
}
@Override
default UpgradeData getUpgradeData() {
return getDelegate().getUpgradeData();
}
@Override
default void setInhabitedTime(long newInhabitedTime) {
getDelegate().setInhabitedTime(newInhabitedTime);
}
@Override
default long getInhabitedTime() {
return getDelegate().getInhabitedTime();
}
@Override
default boolean hasLight() {
return getDelegate().hasLight();
}
@Override
default void setLight(boolean p_217305_1_) {
getDelegate().setLight(p_217305_1_);
}
@Override
@Nullable
public CompoundNBT getTileEntityNBT(BlockPos pos) {
return chunk.getTileEntityNBT(pos);
}
@Override
public Stream<BlockPos> getLightSources() {
return chunk.getLightSources();
}
@Override
public ITickList<Block> getBlocksToBeTicked() {
return chunk.getBlocksToBeTicked();
}
@Override
public ITickList<Fluid> getFluidsToBeTicked() {
return chunk.getFluidsToBeTicked();
}
@Override
public BitSet getCarvingMask(GenerationStage.Carving type) {
return chunk.getCarvingMask(type);
}
@Override
public UpgradeData getUpgradeData() {
return chunk.getUpgradeData();
}
@Override
public void setInhabitedTime(long newInhabitedTime) {
chunk.setInhabitedTime(newInhabitedTime);
}
@Override
public long getInhabitedTime() {
return chunk.getInhabitedTime();
}
public static ShortList getList(ShortList[] p_217308_0_, int p_217308_1_) {
return IChunk.getList(p_217308_0_, p_217308_1_);
}
@Override
public boolean hasLight() {
return chunk.hasLight();
}
@Override
public void setLight(boolean p_217305_1_) {
chunk.setLight(p_217305_1_);
default IWorld getWorldForge() {
return getDelegate().getWorldForge();
}
@Override
@Nullable
public IWorld getWorldForge() {
return chunk.getWorldForge();
default TileEntity getTileEntity(BlockPos pos) {
return getDelegate().getTileEntity(pos);
}
@Override
default BlockState getBlockState(BlockPos pos) {
return getDelegate().getBlockState(pos);
}
@Override
default IFluidState getFluidState(BlockPos pos) {
return getDelegate().getFluidState(pos);
}
@Override
default int getLightValue(BlockPos pos) {
return getDelegate().getLightValue(pos);
}
@Override
default int getMaxLightLevel() {
return getDelegate().getMaxLightLevel();
}
@Override
default int getHeight() {
return getDelegate().getHeight();
}
@Override
default BlockRayTraceResult rayTraceBlocks(RayTraceContext context) {
return getDelegate().rayTraceBlocks(context);
}
@Override
@Nullable
public TileEntity getTileEntity(BlockPos pos) {
return chunk.getTileEntity(pos);
}
@Override
public BlockState getBlockState(BlockPos pos) {
return chunk.getBlockState(pos);
}
@Override
public IFluidState getFluidState(BlockPos pos) {
return chunk.getFluidState(pos);
}
@Override
public int getLightValue(BlockPos pos) {
return chunk.getLightValue(pos);
}
@Override
public int getMaxLightLevel() {
return chunk.getMaxLightLevel();
}
@Override
public int getHeight() {
return chunk.getHeight();
}
@Override
public BlockRayTraceResult rayTraceBlocks(RayTraceContext context) {
return chunk.rayTraceBlocks(context);
default BlockRayTraceResult rayTraceBlocks(Vec3d p_217296_1_, Vec3d p_217296_2_, BlockPos p_217296_3_, VoxelShape p_217296_4_, BlockState p_217296_5_) {
return getDelegate().rayTraceBlocks(p_217296_1_, p_217296_2_, p_217296_3_, p_217296_4_, p_217296_5_);
}
@Override
@Nullable
public BlockRayTraceResult rayTraceBlocks(Vec3d p_217296_1_, Vec3d p_217296_2_, BlockPos p_217296_3_, VoxelShape p_217296_4_, BlockState p_217296_5_) {
return chunk.rayTraceBlocks(p_217296_1_, p_217296_2_, p_217296_3_, p_217296_4_, p_217296_5_);
}
public static <T> T func_217300_a(RayTraceContext p_217300_0_, BiFunction<RayTraceContext, BlockPos, T> p_217300_1_, Function<RayTraceContext, T> p_217300_2_) {
return IBlockReader.func_217300_a(p_217300_0_, p_217300_1_, p_217300_2_);
default StructureStart getStructureStart(String stucture) {
return getDelegate().getStructureStart(stucture);
}
@Override
@Nullable
public StructureStart getStructureStart(String stucture) {
return chunk.getStructureStart(stucture);
default void putStructureStart(String structureIn, StructureStart structureStartIn) {
getDelegate().putStructureStart(structureIn, structureStartIn);
}
@Override
public void putStructureStart(String structureIn, StructureStart structureStartIn) {
chunk.putStructureStart(structureIn, structureStartIn);
default LongSet getStructureReferences(String structureIn) {
return getDelegate().getStructureReferences(structureIn);
}
@Override
public LongSet getStructureReferences(String structureIn) {
return chunk.getStructureReferences(structureIn);
default void addStructureReference(String strucutre, long reference) {
getDelegate().addStructureReference(strucutre, reference);
}
@Override
public void addStructureReference(String strucutre, long reference) {
chunk.addStructureReference(strucutre, reference);
default Map<String, LongSet> getStructureReferences() {
return getDelegate().getStructureReferences();
}
@Override
public Map<String, LongSet> getStructureReferences() {
return chunk.getStructureReferences();
}
@Override
public void setStructureReferences(Map<String, LongSet> p_201606_1_) {
chunk.setStructureReferences(p_201606_1_);
default void setStructureReferences(Map<String, LongSet> p_201606_1_) {
getDelegate().setStructureReferences(p_201606_1_);
}
}

View File

@ -25,7 +25,7 @@
package com.terraforged.api.chunk.column;
import com.terraforged.api.chunk.ChunkSurfaceBuffer;
import com.terraforged.api.chunk.surface.ChunkSurfaceBuffer;
import me.dags.noise.Source;
import me.dags.noise.source.FastSource;
import net.minecraft.block.BlockState;
@ -41,7 +41,7 @@ public interface ColumnDecorator {
void decorate(IChunk chunk, ProcessorContext context, int x, int y, int z);
default void decorate(ChunkSurfaceBuffer buffer, ProcessorContext context, int x, int y, int z) {
decorate(buffer.getChunk(), context, x, y, z);
decorate(buffer.getDelegate(), context, x, y, z);
}
default void fillDown(IChunk chunk, int x, int z, int from, int to, BlockState state) {

View File

@ -23,21 +23,28 @@
* SOFTWARE.
*/
package com.terraforged.api.chunk;
package com.terraforged.api.chunk.surface;
import com.terraforged.api.chunk.ChunkDelegate;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.chunk.IChunk;
import javax.annotation.Nullable;
public class ChunkSurfaceBuffer extends ChunkDelegate {
public class ChunkSurfaceBuffer implements ChunkDelegate {
private int surfaceTop;
private int surfaceBottom;
private final IChunk delegate;
public ChunkSurfaceBuffer(IChunk chunk) {
super(chunk);
this.delegate = chunk;
}
@Override
public IChunk getDelegate() {
return delegate;
}
@Nullable
@ -49,7 +56,7 @@ public class ChunkSurfaceBuffer extends ChunkDelegate {
if (pos.getY() < surfaceBottom) {
surfaceBottom = pos.getY();
}
return super.setBlockState(pos, state, isMoving);
return getDelegate().setBlockState(pos, state, isMoving);
}
public int getSurfaceTop() {

View File

@ -32,6 +32,7 @@ import com.terraforged.core.world.heightmap.RegionConfig;
import com.terraforged.core.world.terrain.LandForms;
import com.terraforged.core.world.terrain.Terrain;
import com.terraforged.core.world.terrain.TerrainPopulator;
import com.terraforged.core.world.terrain.Terrains;
import com.terraforged.core.world.terrain.VolcanoPopulator;
import me.dags.noise.Module;
import me.dags.noise.Source;
@ -77,6 +78,11 @@ public class StandardTerrainProvider implements TerrainProvider {
registerUnMixable(context.terrain.mountains, landForms.mountains3(context.seed));
}
@Override
public Terrains getTerrain() {
return context.terrain;
}
@Override
public void registerMixable(TerrainPopulator populator) {
populators.putIfAbsent(populator.getType(), populator);

View File

@ -29,6 +29,7 @@ import com.terraforged.core.cell.Populator;
import com.terraforged.core.world.terrain.LandForms;
import com.terraforged.core.world.terrain.Terrain;
import com.terraforged.core.world.terrain.TerrainPopulator;
import com.terraforged.core.world.terrain.Terrains;
import me.dags.noise.Module;
import java.util.List;
@ -38,6 +39,8 @@ import java.util.List;
*/
public interface TerrainProvider {
Terrains getTerrain();
LandForms getLandforms();
/**

@ -1 +1 @@
Subproject commit 2e18fe66d631773288b1e27db0246514ce74d681
Subproject commit f7e27c70a2a2b30225a85137688d2014f9ad1b6f