improved block destroy animation, and implemented filler pattern
This commit is contained in:
parent
2431d82225
commit
757bea50dc
6 changed files with 78 additions and 2 deletions
|
@ -27,6 +27,7 @@ fillerpattern.pyramid=Pyramid
|
||||||
fillerpattern.stairs=Stairs
|
fillerpattern.stairs=Stairs
|
||||||
fillerpattern.box=Box
|
fillerpattern.box=Box
|
||||||
fillerpattern.cylinder=Cylinder
|
fillerpattern.cylinder=Cylinder
|
||||||
|
fillerpattern.frame=Frame
|
||||||
|
|
||||||
fluid.oil=Oil
|
fluid.oil=Oil
|
||||||
fluid.fuel=Fuel
|
fluid.fuel=Fuel
|
||||||
|
|
BIN
buildcraft_resources/assets/buildcraft/textures/blocks/fillerPatterns/frame.png
Executable file
BIN
buildcraft_resources/assets/buildcraft/textures/blocks/fillerPatterns/frame.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 454 B |
|
@ -54,6 +54,7 @@ import buildcraft.builders.filler.pattern.PatternClear;
|
||||||
import buildcraft.builders.filler.pattern.PatternCylinder;
|
import buildcraft.builders.filler.pattern.PatternCylinder;
|
||||||
import buildcraft.builders.filler.pattern.PatternFill;
|
import buildcraft.builders.filler.pattern.PatternFill;
|
||||||
import buildcraft.builders.filler.pattern.PatternFlatten;
|
import buildcraft.builders.filler.pattern.PatternFlatten;
|
||||||
|
import buildcraft.builders.filler.pattern.PatternFrame;
|
||||||
import buildcraft.builders.filler.pattern.PatternHorizon;
|
import buildcraft.builders.filler.pattern.PatternHorizon;
|
||||||
import buildcraft.builders.filler.pattern.PatternPyramid;
|
import buildcraft.builders.filler.pattern.PatternPyramid;
|
||||||
import buildcraft.builders.filler.pattern.PatternStairs;
|
import buildcraft.builders.filler.pattern.PatternStairs;
|
||||||
|
@ -364,6 +365,7 @@ public class BuildCraftBuilders extends BuildCraftMod {
|
||||||
FillerManager.registry.addPattern(new PatternPyramid());
|
FillerManager.registry.addPattern(new PatternPyramid());
|
||||||
FillerManager.registry.addPattern(new PatternStairs());
|
FillerManager.registry.addPattern(new PatternStairs());
|
||||||
FillerManager.registry.addPattern(new PatternCylinder());
|
FillerManager.registry.addPattern(new PatternCylinder());
|
||||||
|
FillerManager.registry.addPattern(new PatternFrame());
|
||||||
} catch (Error error) {
|
} catch (Error error) {
|
||||||
BCLog.logErrorAPI("Buildcraft", error, IFillerPattern.class);
|
BCLog.logErrorAPI("Buildcraft", error, IFillerPattern.class);
|
||||||
throw error;
|
throw error;
|
||||||
|
|
|
@ -11,6 +11,7 @@ package buildcraft.builders;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import buildcraft.BuildCraftBuilders;
|
import buildcraft.BuildCraftBuilders;
|
||||||
import buildcraft.api.blueprints.IBuilderContext;
|
import buildcraft.api.blueprints.IBuilderContext;
|
||||||
|
@ -174,6 +175,17 @@ public class BuildingItem implements IBuilder {
|
||||||
|
|
||||||
private void build() {
|
private void build() {
|
||||||
if (slotToBuild != null) {
|
if (slotToBuild != null) {
|
||||||
|
Block block = context.world().getBlock((int) destination.x, (int)destination.y, (int)destination.z);
|
||||||
|
int meta = context.world().getBlockMetadata((int) destination.x, (int)destination.y, (int)destination.z);
|
||||||
|
|
||||||
|
context.world().playAuxSFXAtEntity(
|
||||||
|
null,
|
||||||
|
2001,
|
||||||
|
(int) destination.x,
|
||||||
|
(int) destination.y,
|
||||||
|
(int) destination.z,
|
||||||
|
Block.getIdFromBlock(block) + (meta << 12));
|
||||||
|
|
||||||
slotToBuild.writeToWorld(context);
|
slotToBuild.writeToWorld(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
55
common/buildcraft/builders/filler/pattern/PatternFrame.java
Executable file
55
common/buildcraft/builders/filler/pattern/PatternFrame.java
Executable file
|
@ -0,0 +1,55 @@
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
|
||||||
|
* http://www.mod-buildcraft.com
|
||||||
|
*
|
||||||
|
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||||
|
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||||
|
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||||
|
*/
|
||||||
|
package buildcraft.builders.filler.pattern;
|
||||||
|
|
||||||
|
import buildcraft.api.blueprints.SchematicMask;
|
||||||
|
import buildcraft.core.Box;
|
||||||
|
import buildcraft.core.blueprints.Template;
|
||||||
|
|
||||||
|
|
||||||
|
public class PatternFrame extends FillerPattern {
|
||||||
|
|
||||||
|
public PatternFrame() {
|
||||||
|
super("frame");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Template getBlueprint(Box box) {
|
||||||
|
Template template = new Template (box.sizeX(), box.sizeY(), box.sizeZ());
|
||||||
|
|
||||||
|
int xMin = 0;
|
||||||
|
int yMin = 0;
|
||||||
|
int zMin = 0;
|
||||||
|
|
||||||
|
int xMax = box.sizeX() - 1;
|
||||||
|
int yMax = box.sizeY() - 1;
|
||||||
|
int zMax = box.sizeZ() - 1;
|
||||||
|
|
||||||
|
for (int it = 0; it < 2; it++) {
|
||||||
|
for (int i = 0; i < template.sizeX; ++i) {
|
||||||
|
template.contents [i][it * (box.sizeY() - 1)][0] = new SchematicMask (true);
|
||||||
|
template.contents [i][it * (box.sizeY() - 1)][template.sizeZ - 1] = new SchematicMask (true);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int k = 0; k < template.sizeZ; ++k) {
|
||||||
|
template.contents [0][it * (box.sizeY() - 1)][k] = new SchematicMask (true);
|
||||||
|
template.contents [template.sizeX - 1][it * (box.sizeY() - 1)][k] = new SchematicMask (true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int h = 1; h < box.sizeY(); ++h) {
|
||||||
|
template.contents [0][h][0] = new SchematicMask (true);
|
||||||
|
template.contents [0][h][template.sizeZ - 1] = new SchematicMask (true);
|
||||||
|
template.contents [template.sizeX - 1][h][0] = new SchematicMask (true);
|
||||||
|
template.contents [template.sizeX - 1][h][template.sizeZ - 1] = new SchematicMask (true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return template;
|
||||||
|
}
|
||||||
|
}
|
|
@ -449,8 +449,14 @@ public class TileQuarry extends TileAbstractBuilder implements IMachine, IPowerR
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: fix sound here
|
worldObj.playAuxSFXAtEntity(
|
||||||
//worldObj.playAuxSFXAtEntity(null, 2001, i, j, k, blockId + (worldObj.getBlockMetadata(i, j, k) << 12));
|
null,
|
||||||
|
2001,
|
||||||
|
i,
|
||||||
|
j,
|
||||||
|
k,
|
||||||
|
Block.getIdFromBlock(block)
|
||||||
|
+ (worldObj.getBlockMetadata(i, j, k) << 12));
|
||||||
worldObj.setBlockToAir(i, j, k);
|
worldObj.setBlockToAir(i, j, k);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue