mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-12-06 02:40:23 -08:00
Merge b5497179bc into a01e4be75d
This commit is contained in:
commit
8bc2a760ad
4 changed files with 42 additions and 2 deletions
|
|
@ -187,3 +187,4 @@ Iniquit
|
||||||
DSFdsfWxp
|
DSFdsfWxp
|
||||||
Someone's Shadow
|
Someone's Shadow
|
||||||
buj
|
buj
|
||||||
|
MCxzfwq/m1cxzfw3q
|
||||||
|
|
|
||||||
|
|
@ -94,16 +94,18 @@ public class Blocks{
|
||||||
//sandbox
|
//sandbox
|
||||||
powerSource, powerVoid, itemSource, itemVoid, liquidSource, liquidVoid, payloadSource, payloadVoid, illuminator, heatSource,
|
powerSource, powerVoid, itemSource, itemVoid, liquidSource, liquidVoid, payloadSource, payloadVoid, illuminator, heatSource,
|
||||||
|
|
||||||
//defense
|
//walls
|
||||||
copperWall, copperWallLarge, titaniumWall, titaniumWallLarge, plastaniumWall, plastaniumWallLarge, thoriumWall, thoriumWallLarge, door, doorLarge,
|
copperWall, copperWallLarge, titaniumWall, titaniumWallLarge, plastaniumWall, plastaniumWallLarge, thoriumWall, thoriumWallLarge, door, doorLarge,
|
||||||
phaseWall, phaseWallLarge, surgeWall, surgeWallLarge,
|
phaseWall, phaseWallLarge, surgeWall, surgeWallLarge,
|
||||||
|
|
||||||
|
scrapWall, scrapWallLarge, scrapWallHuge, scrapWallGigantic, thruster, //ok, these names are getting ridiculous, but at least I don't have humongous walls yet
|
||||||
|
|
||||||
//walls - erekir
|
//walls - erekir
|
||||||
berylliumWall, berylliumWallLarge, tungstenWall, tungstenWallLarge, blastDoor, reinforcedSurgeWall, reinforcedSurgeWallLarge, carbideWall, carbideWallLarge,
|
berylliumWall, berylliumWallLarge, tungstenWall, tungstenWallLarge, blastDoor, reinforcedSurgeWall, reinforcedSurgeWallLarge, carbideWall, carbideWallLarge,
|
||||||
shieldedWall,
|
shieldedWall,
|
||||||
|
|
||||||
|
//defense
|
||||||
mender, mendProjector, overdriveProjector, overdriveDome, forceProjector, shockMine,
|
mender, mendProjector, overdriveProjector, overdriveDome, forceProjector, shockMine,
|
||||||
scrapWall, scrapWallLarge, scrapWallHuge, scrapWallGigantic, thruster, //ok, these names are getting ridiculous, but at least I don't have humongous walls yet
|
|
||||||
|
|
||||||
//defense - erekir
|
//defense - erekir
|
||||||
radar,
|
radar,
|
||||||
|
|
|
||||||
|
|
@ -516,12 +516,43 @@ public class ContentParser{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "powerBuffered" -> block.consumePowerBuffered(child.asFloat());
|
case "powerBuffered" -> block.consumePowerBuffered(child.asFloat());
|
||||||
|
case "itemsBoost" -> block.consume(
|
||||||
|
child.isArray()? new ConsumeItems(parser.readValue(ItemStack[].class, child)) :
|
||||||
|
child.isString() ? new ConsumeItems(new ItemStack[]{parser.readValue(ItemStack.class, child)}) :
|
||||||
|
parser.readValue(ConsumeItems.class, child)).boost();
|
||||||
|
case "liquidsBoost" -> block.consume(
|
||||||
|
child.isArray() ? new ConsumeLiquids(parser.readValue(LiquidStack[].class, child)) :
|
||||||
|
parser.readValue(ConsumeLiquids.class, child)).boost();
|
||||||
default -> throw new IllegalArgumentException("Unknown consumption type: '" + child.name + "' for block '" + block.name + "'.");
|
default -> throw new IllegalArgumentException("Unknown consumption type: '" + child.name + "' for block '" + block.name + "'.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
value.remove("consumes");
|
value.remove("consumes");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void readBlockCanInputItems(Block block, JsonValue value){
|
||||||
|
boolean[] booleans = block.itemFilter;
|
||||||
|
for(JsonValue child : value){
|
||||||
|
switch(child.name){
|
||||||
|
case "add" -> {
|
||||||
|
for (Item it : parser.readValue(Item[].class, child)) {
|
||||||
|
if (!booleans[it.id]) {
|
||||||
|
block.itemFilter[it.id] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case "remove" -> {
|
||||||
|
for (Item it : parser.readValue(Item[].class, child)) {
|
||||||
|
if(booleans[it.id]){
|
||||||
|
block.itemFilter[it.id] = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default -> throw new IllegalArgumentException("Unknown consumption type: '" + child.name + "' for block '" + block.name + "'.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
value.remove("canInputItems");
|
||||||
|
}
|
||||||
|
|
||||||
private ObjectMap<ContentType, TypeParser<?>> parsers = ObjectMap.of(
|
private ObjectMap<ContentType, TypeParser<?>> parsers = ObjectMap.of(
|
||||||
ContentType.block, (TypeParser<Block>)(mod, name, value) -> {
|
ContentType.block, (TypeParser<Block>)(mod, name, value) -> {
|
||||||
readBundle(ContentType.block, name, value);
|
readBundle(ContentType.block, name, value);
|
||||||
|
|
@ -547,6 +578,11 @@ public class ContentParser{
|
||||||
value.remove("consumes");
|
value.remove("consumes");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(value.has("canInputItems") && value.get("canInputItems").isObject()){
|
||||||
|
readBlockCanInputItems(block, value.get("canInputItems"));
|
||||||
|
value.remove("canInputItems");
|
||||||
|
}
|
||||||
|
|
||||||
readFields(block, value, true);
|
readFields(block, value, true);
|
||||||
|
|
||||||
if(block.size > maxBlockSize){
|
if(block.size > maxBlockSize){
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import arc.math.*;
|
||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import arc.util.io.*;
|
import arc.util.io.*;
|
||||||
|
import mindustry.Vars;
|
||||||
import mindustry.annotations.Annotations.*;
|
import mindustry.annotations.Annotations.*;
|
||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.entities.*;
|
import mindustry.entities.*;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue