Skip to content

Commit

Permalink
Merge branch '8.0.x' into 8.0.x-alexiil-oil-by-generate
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexIIL committed Jul 4, 2017
2 parents 7f5ba0a + 9c806a5 commit 8bcea60
Show file tree
Hide file tree
Showing 248 changed files with 5,523 additions and 2,660 deletions.
26 changes: 15 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ sourceSets {
main {
java {
srcDir "common"
srcDir "common_old_license"
// srcDir "src_old_license"
}
resources {
Expand Down Expand Up @@ -178,6 +177,10 @@ def parseConfig(File config) {
}
}

def libsDir = new File(System.getenv("LIBS_DIR") ?: "build/libs/", version)
def modulesDir = new File(libsDir, "modules")
def modulesDirSrc = new File(modulesDir, "src")

// add a source jar
//task sourceJar(type: Jar) {
// from sourceSets.main.allSource
Expand All @@ -192,22 +195,21 @@ javadoc {

// add a javadoc jar
task javadocJar(type: Jar, dependsOn: javadoc) {
destinationDir = libsDir
classifier = 'javadoc'
from 'build/docs/javadoc'
}

// because the normal output has been made to be obfuscated
task deobfJar(type: Jar) {
destinationDir = libsDir
from sourceSets.main.output
from sourceSets.api.output
classifier = 'dev'
}

def modulesDir = file("build/libs/modules")
def modulesDirSrc = new File(modulesDir, "src")

task apiJar(type: Jar, dependsOn: reobfJar) {
destinationDir = modulesDir
destinationDir = libsDir
appendix = "api"

doFirst {
Expand Down Expand Up @@ -343,7 +345,7 @@ task roboticsJar(type: Jar, dependsOn: reobfJar) {
}

task allJar(type: Jar, dependsOn:reobfJar) {
destinationDir = modulesDir
destinationDir = libsDir

doFirst {
from(project.ext.jarFile) {
Expand All @@ -353,7 +355,7 @@ task allJar(type: Jar, dependsOn:reobfJar) {
}

task allSrcJar(type: Jar, dependsOn:reobfJar) {
destinationDir = modulesDir
destinationDir = libsDir
classifier = "sources"

doFirst {
Expand All @@ -362,13 +364,15 @@ task allSrcJar(type: Jar, dependsOn:reobfJar) {
}
}

sourceJar.destinationDir = libsDir

// add api classes to main package
jar {
from sourceSets.api.output
}

// make sure all of these happen when we run build
build.dependsOn sourceJar, apiJar, deobfJar, javadocJar
build.dependsOn allSrcJar, apiJar, deobfJar, javadocJar

// --------------------
// maven section
Expand Down Expand Up @@ -426,21 +430,21 @@ def sftp(String subPath, Closure antFileset = {}) {
publishing {
repositories {
maven {
url "build/maven"
url System.getenv("MAVEN_DIR") ?: "build/maven"
}
}
publications {
pub_apiJar(MavenPublication) {
groupId "com.mod-buildcraft"
artifactId "buildcraft-api"
version "8.0"
version "7.99"

artifact apiJar
}
pub_apiSrcJar(MavenPublication) {
groupId "com.mod-buildcraft"
artifactId "buildcraft-api"
version "8.0"
version "7.99"

artifact apiSrcJar
}
Expand Down
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mc_version=1.11.2
forge_version=13.20.0.2296
mappings_version=snapshot_20170304
mod_version=7.99.4
mod_version=7.99.5
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions common/buildcraft/builders/BCBuilders.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class BCBuilders {
public static void preInit(FMLPreInitializationEvent evt) {
RegistryHelper.useOtherModConfigFor(MODID, BCCore.MODID);

BCBuildersRegistries.preInit();
BCBuildersItems.preInit();
BCBuildersBlocks.preInit();

Expand Down Expand Up @@ -98,6 +99,7 @@ public static void preInit(FMLPreInitializationEvent evt) {
@Mod.EventHandler
public static void init(FMLInitializationEvent evt) {
BCBuildersProxy.getProxy().fmlInit();
BCBuildersRegistries.init();
BCBuildersRecipes.init();
}

Expand Down
19 changes: 8 additions & 11 deletions common/buildcraft/builders/BCBuildersEventDist.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
package buildcraft.builders;

import java.lang.ref.WeakReference;
import java.time.Instant;
import java.util.Date;
import java.util.Deque;
import java.util.Iterator;
import java.util.LinkedList;
Expand Down Expand Up @@ -102,18 +100,17 @@ public void onRenderTooltipPostText(RenderTooltipEvent.PostText event) {
ItemStack stack = event.getStack();
Header header = BCBuildersItems.snapshot.getHeader(stack);
if (header != null) {
snapshot = ClientSnapshots.INSTANCE.getSnapshot(header);
snapshot = ClientSnapshots.INSTANCE.getSnapshot(header.key);
} else {
ISchematicBlock<?> schematic = ItemSchematicSingle.getSchematicSafe(stack);
if (schematic != null) {
// Create a blueprint specific for this given item
Blueprint bpt = new Blueprint();
bpt.size = new BlockPos(1, 1, 1);
bpt.offset = BlockPos.ORIGIN;
bpt.data = new int[][][] { { { 0 } } };
bpt.palette.add(schematic);
bpt.header = new Header(bpt.computeHash(), UUID_SINGLE_SCHEMATIC, Date.from(Instant.EPOCH), "_item");
snapshot = bpt;
Blueprint blueprint = new Blueprint();
blueprint.size = new BlockPos(1, 1, 1);
blueprint.offset = BlockPos.ORIGIN;
blueprint.data = new int[][][] { { { 0 } } };
blueprint.palette.add(schematic);
blueprint.computeKey();
snapshot = blueprint;
}
}

Expand Down
7 changes: 3 additions & 4 deletions common/buildcraft/builders/BCBuildersProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
import buildcraft.builders.gui.GuiArchitectTable;
import buildcraft.builders.gui.GuiBuilder;
import buildcraft.builders.gui.GuiElectronicLibrary;
import buildcraft.builders.gui.GuiFiller;
import buildcraft.builders.gui.GuiFillingPlanner;
import buildcraft.builders.gui.GuiFilling;
import buildcraft.builders.gui.GuiReplacer;
import buildcraft.builders.tile.TileArchitectTable;
import buildcraft.builders.tile.TileBuilder;
Expand Down Expand Up @@ -127,7 +126,7 @@ public Object getClientGuiElement(int id, EntityPlayer player, World world, int
if (id == BCBuildersGuis.FILLER.ordinal()) {
if (tile instanceof TileFiller) {
TileFiller filler = (TileFiller) tile;
return new GuiFiller(new ContainerFiller(player, filler));
return new GuiFilling(new ContainerFiller(player, filler));
}
}
if (id == BCBuildersGuis.ARCHITECT.ordinal()) {
Expand All @@ -143,7 +142,7 @@ public Object getClientGuiElement(int id, EntityPlayer player, World world, int
}
}
if (id == BCBuildersGuis.FILLING_PLANNER.ordinal()) {
return new GuiFillingPlanner(new ContainerFillingPlanner(player));
return new GuiFilling(new ContainerFillingPlanner(player));
}
return null;
}
Expand Down
22 changes: 22 additions & 0 deletions common/buildcraft/builders/BCBuildersRegistries.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2017 SpaceToad and the BuildCraft team
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
* distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/
*/

package buildcraft.builders;

import buildcraft.api.template.TemplateApi;

import buildcraft.builders.snapshot.TemplateHandlerDefault;
import buildcraft.builders.snapshot.TemplateRegistry;

public class BCBuildersRegistries {
public static void preInit() {
TemplateApi.templateRegistry = TemplateRegistry.INSTANCE;
}

public static void init() {
TemplateApi.templateRegistry.addHandler(TemplateHandlerDefault.INSTANCE);
}
}
2 changes: 2 additions & 0 deletions common/buildcraft/builders/BCBuildersSprites.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@

public class BCBuildersSprites {
public static final SpriteHolder FILLING_PLANNER;
public static final SpriteHolder ROBOT;

static {
FILLING_PLANNER = getHolder("addons/filling_planner");
ROBOT = getHolder("robot");
}

private static SpriteHolder getHolder(String suffix) {
Expand Down
58 changes: 20 additions & 38 deletions common/buildcraft/builders/addon/AddonFillingPlanner.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos;

import net.minecraftforge.common.util.Constants;

import buildcraft.lib.misc.NBTUtilBC;

Expand All @@ -32,25 +28,22 @@
import buildcraft.core.marker.volume.ISingleAddon;

public class AddonFillingPlanner extends Addon implements ISingleAddon {
public List<IParameter> parameters = new ArrayList<>();
public final List<IParameter> parameters = new ArrayList<>();
public boolean inverted;
public Template.BuildingInfo buildingInfo;

public boolean[][][] getFillingPlan() {
BlockPos size = box.box.size();
boolean[][][] fillingPlan = Filling.INSTANCE.getFillingPlan(size, parameters);
if (inverted) {
fillingPlan = Filling.INSTANCE.invertFillingPlan(size, fillingPlan);
}
return fillingPlan;
public void updateBuildingInfo() {
buildingInfo = Filling.createBuildingInfo(
box.box.min(),
box.box.size(),
parameters,
inverted
);
}

public void markDirty() {
Template template = new Template();
template.size = box.box.size();
template.offset = BlockPos.ORIGIN;
template.data = getFillingPlan();
buildingInfo = template.new BuildingInfo(box.box.min(), Rotation.NONE);
@Override
public void onBoxSizeChange() {
updateBuildingInfo();
}

@Override
Expand All @@ -61,16 +54,8 @@ public IFastAddonRenderer<AddonFillingPlanner> getRenderer() {

@Override
public void onAdded() {
while (true) {
Class<? extends IParameter> nextParameterClass = Filling.INSTANCE.getNextParameterClass(parameters);
if (nextParameterClass != null) {
// noinspection ConstantConditions
parameters.add(nextParameterClass.getEnumConstants()[0]);
} else {
break;
}
}
markDirty();
parameters.addAll(Filling.initParameters());
updateBuildingInfo();
}

@Override
Expand All @@ -87,20 +72,17 @@ public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
.map(parameter -> IParameter.writeToNBT(new NBTTagCompound(), parameter))
)
);
nbt.setBoolean("inverted", inverted);
return nbt;
}

@Override
public void readFromNBT(NBTTagCompound nbt) {
NBTUtilBC.readCompoundList(
nbt.getTagList(
"parameters",
Constants.NBT.TAG_COMPOUND
)
)
.map(IParameter::readFromNBT)
.forEach(parameters::add);
markDirty();
NBTUtilBC.readCompoundList(nbt.getTag("parameters"))
.map(IParameter::readFromNBT)
.forEach(parameters::add);
inverted = nbt.getBoolean("inverted");
updateBuildingInfo();
}

@Override
Expand All @@ -115,6 +97,6 @@ public void fromBytes(ByteBuf buf) {
parameters.clear();
IntStream.range(0, buf.readInt()).mapToObj(i -> IParameter.fromBytes(buf)).forEach(parameters::add);
inverted = buf.readBoolean();
markDirty();
updateBuildingInfo();
}
}
2 changes: 1 addition & 1 deletion common/buildcraft/builders/block/BlockArchitectTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, En
}

@Override
public boolean canBeRotated(World world, BlockPos pos, IBlockState state, EnumFacing sideWrenched) {
public boolean canBeRotated(World world, BlockPos pos, IBlockState state) {
return false;
}
}
2 changes: 1 addition & 1 deletion common/buildcraft/builders/block/BlockBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, En
}

@Override
public boolean canBeRotated(World world, BlockPos pos, IBlockState state, EnumFacing sideWrenched) {
public boolean canBeRotated(World world, BlockPos pos, IBlockState state) {
TileEntity tile = world.getTileEntity(pos);
return !(tile instanceof TileBuilder) || ((TileBuilder) tile).getBuilder() == null;
}
Expand Down
8 changes: 7 additions & 1 deletion common/buildcraft/builders/block/BlockFiller.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,20 @@ public TileEntity createNewTileEntity(World world, int meta) {

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileFiller) {
if (!((TileFiller) tile).isValid()) {
return false;
}
}
if (!world.isRemote) {
BCBuildersGuis.FILLER.openGUI(player, pos);
}
return true;
}

@Override
public boolean canBeRotated(World world, BlockPos pos, IBlockState state, EnumFacing sideWrenched) {
public boolean canBeRotated(World world, BlockPos pos, IBlockState state) {
return false;
}
}
2 changes: 1 addition & 1 deletion common/buildcraft/builders/block/BlockQuarry.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public TileEntity createNewTileEntity(World world, int meta) {
}

@Override
public boolean canBeRotated(World world, BlockPos pos, IBlockState state, EnumFacing sideWrenched) {
public boolean canBeRotated(World world, BlockPos pos, IBlockState state) {
return false;
}

Expand Down
Loading

0 comments on commit 8bcea60

Please sign in to comment.