reorganization
|
Before Width: | Height: | Size: 1.3 KiB |
BIN
core/assets-raw/sprites/blocks/payload/constructor-top.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
core/assets-raw/sprites/blocks/payload/constructor.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 651 B After Width: | Height: | Size: 651 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
BIN
core/assets-raw/sprites/blocks/payload/large-constructor.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 7.8 KiB |
@@ -96,7 +96,7 @@ public class Blocks implements ContentList{
|
||||
repairPoint, repairTurret, resupplyPoint,
|
||||
|
||||
//payloads
|
||||
payloadConveyor, payloadRouter, payloadPropulsionTower, payloadDeconstructor, blockForge, blockLoader, blockUnloader,
|
||||
payloadConveyor, payloadRouter, payloadPropulsionTower, deconstructor, constructor, blockLoader, blockUnloader,
|
||||
|
||||
//logic
|
||||
message, switchBlock, microProcessor, logicProcessor, hyperProcessor, largeLogicDisplay, logicDisplay, memoryCell, memoryBank,
|
||||
@@ -108,6 +108,10 @@ public class Blocks implements ContentList{
|
||||
nuclearWarhead, warheadAssembler, ballisticSilo //TODO
|
||||
;
|
||||
|
||||
/** @deprecated use the blocks with proper names, */
|
||||
@Deprecated
|
||||
public static Block blockForge;
|
||||
|
||||
@Override
|
||||
public void load(){
|
||||
//region environment
|
||||
@@ -2227,7 +2231,7 @@ public class Blocks implements ContentList{
|
||||
consumes.power(6f);
|
||||
}};
|
||||
|
||||
payloadDeconstructor = new PayloadDeconstructor("payload-deconstructor"){{
|
||||
deconstructor = new PayloadDeconstructor("deconstructor"){{
|
||||
requirements(Category.units, with(Items.thorium, 250, Items.silicon, 200, Items.graphite, 250));
|
||||
itemCapacity = 250;
|
||||
consumes.power(3f);
|
||||
@@ -2235,7 +2239,7 @@ public class Blocks implements ContentList{
|
||||
deconstructSpeed = 2f;
|
||||
}};
|
||||
|
||||
blockForge = new BlockForge("block-forge"){{
|
||||
constructor = new Constructor("constructor"){{
|
||||
requirements(Category.units, BuildVisibility.debugOnly, with(Items.thorium, 100));
|
||||
hasPower = true;
|
||||
consumes.power(2f);
|
||||
@@ -2256,6 +2260,9 @@ public class Blocks implements ContentList{
|
||||
size = 3;
|
||||
}};
|
||||
|
||||
//TODO deprecated
|
||||
blockForge = deconstructor;
|
||||
|
||||
//endregion
|
||||
//region sandbox
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package mindustry.mod;
|
||||
|
||||
import arc.struct.*;
|
||||
import mindustry.world.blocks.payloads.*;
|
||||
|
||||
/** Generated class. Maps simple class names to concrete classes. For use in JSON mods. */
|
||||
@SuppressWarnings("deprecation")
|
||||
public class ClassMap{
|
||||
@@ -220,8 +222,8 @@ public class ClassMap{
|
||||
classes.put("SwitchBuild", mindustry.world.blocks.logic.SwitchBlock.SwitchBuild.class);
|
||||
classes.put("BallisticSilo", mindustry.world.blocks.payloads.BallisticSilo.class);
|
||||
classes.put("BallisticSiloBuild", mindustry.world.blocks.payloads.BallisticSilo.BallisticSiloBuild.class);
|
||||
classes.put("BlockForge", mindustry.world.blocks.payloads.BlockForge.class);
|
||||
classes.put("BlockForgeBuild", mindustry.world.blocks.payloads.BlockForge.BlockForgeBuild.class);
|
||||
classes.put("BlockForge", Constructor.class);
|
||||
classes.put("BlockForgeBuild", Constructor.BlockForgeBuild.class);
|
||||
classes.put("BlockLoader", mindustry.world.blocks.payloads.BlockLoader.class);
|
||||
classes.put("BlockLoaderBuild", mindustry.world.blocks.payloads.BlockLoader.BlockLoaderBuild.class);
|
||||
classes.put("BlockProducer", mindustry.world.blocks.payloads.BlockProducer.class);
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
package mindustry.world.blocks.experimental;
|
||||
|
||||
import mindustry.world.blocks.payloads.*;
|
||||
|
||||
@Deprecated
|
||||
public class BlockForge extends mindustry.world.blocks.payloads.BlockForge{
|
||||
public class BlockForge extends Constructor{
|
||||
|
||||
public BlockForge(String name){
|
||||
super(name);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public class BlockForgeBuild extends mindustry.world.blocks.payloads.BlockForge.BlockForgeBuild{
|
||||
public class BlockForgeBuild extends Constructor.BlockForgeBuild{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,14 @@ public abstract class BlockProducer extends PayloadBlock{
|
||||
|
||||
@Override
|
||||
public TextureRegion[] icons(){
|
||||
return new TextureRegion[]{region, outRegion};
|
||||
return new TextureRegion[]{region, outRegion, topRegion};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawRequestRegion(BuildPlan req, Eachable<BuildPlan> list){
|
||||
Draw.rect(region, req.drawx(), req.drawy());
|
||||
Draw.rect(outRegion, req.drawx(), req.drawy(), req.rotation * 90);
|
||||
Draw.rect(topRegion, req.drawx(), req.drawy());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -43,12 +50,6 @@ public abstract class BlockProducer extends PayloadBlock{
|
||||
|
||||
bars.add("progress", (BlockProducerBuild entity) -> new Bar("bar.progress", Pal.ammo, () -> entity.recipe() == null ? 0f : (entity.progress / entity.recipe().buildCost)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawRequestRegion(BuildPlan req, Eachable<BuildPlan> list){
|
||||
Draw.rect(region, req.drawx(), req.drawy());
|
||||
Draw.rect(outRegion, req.drawx(), req.drawy(), req.rotation * 90);
|
||||
}
|
||||
|
||||
public abstract class BlockProducerBuild extends PayloadBlockBuild<BuildPayload>{
|
||||
public float progress, time, heat;
|
||||
@@ -126,6 +127,9 @@ public abstract class BlockProducer extends PayloadBlock{
|
||||
}
|
||||
|
||||
drawPayload();
|
||||
|
||||
Draw.z(Layer.blockBuilding + 1.1f);
|
||||
Draw.rect(topRegion, x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,17 +13,17 @@ import mindustry.world.meta.*;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
/** Configurable BlockProducer variant. */
|
||||
public class BlockForge extends BlockProducer{
|
||||
public class Constructor extends BlockProducer{
|
||||
public float buildSpeed = 0.4f;
|
||||
public int minBlockSize = 1, maxBlockSize = 2;
|
||||
|
||||
public BlockForge(String name){
|
||||
public Constructor(String name){
|
||||
super(name);
|
||||
|
||||
size = 3;
|
||||
configurable = true;
|
||||
|
||||
config(Block.class, (BlockForgeBuild tile, Block block) -> {
|
||||
config(Block.class, (ConstructorBuild tile, Block block) -> {
|
||||
if(tile.recipe != block) tile.progress = 0f;
|
||||
if(canProduce(block)){
|
||||
tile.recipe = block;
|
||||
@@ -42,7 +42,7 @@ public class BlockForge extends BlockProducer{
|
||||
return b.isVisible() && b.size >= minBlockSize && b.size <= maxBlockSize;
|
||||
}
|
||||
|
||||
public class BlockForgeBuild extends BlockProducerBuild{
|
||||
public class ConstructorBuild extends BlockProducerBuild{
|
||||
public @Nullable Block recipe;
|
||||
|
||||
@Override
|
||||
@@ -52,7 +52,7 @@ public class BlockForge extends BlockProducer{
|
||||
|
||||
@Override
|
||||
public void buildConfiguration(Table table){
|
||||
ItemSelection.buildTable(table, content.blocks().select(BlockForge.this::canProduce), () -> recipe, this::configure);
|
||||
ItemSelection.buildTable(table, content.blocks().select(Constructor.this::canProduce), () -> recipe, this::configure);
|
||||
}
|
||||
|
||||
@Override
|
||||