Block class merge

This commit is contained in:
Anuken 2019-01-07 18:39:06 -05:00
parent a1a69f62e1
commit ee9f65d4a3
65 changed files with 1597 additions and 1799 deletions

View File

@ -5,7 +5,7 @@ import io.anuke.arc.collection.*;
import io.anuke.arc.function.Predicate;
import io.anuke.arc.math.Mathf;
import io.anuke.arc.math.geom.Geometry;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.game.EventType.TileChangeEvent;
import io.anuke.mindustry.game.EventType.WorldLoadEvent;

View File

@ -5,7 +5,7 @@ import io.anuke.arc.collection.Array;
import io.anuke.arc.collection.GridBits;
import io.anuke.arc.math.Mathf;
import io.anuke.arc.util.Structs;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.entities.units.BaseUnit;
import io.anuke.mindustry.entities.units.Squad;
import io.anuke.mindustry.game.EventType.WorldLoadEvent;

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,6 @@ import io.anuke.mindustry.entities.effect.Puddle;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.graphics.Shapes;
import io.anuke.mindustry.type.ContentType;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.BuildBlock;
@ -644,9 +643,4 @@ public class Bullets implements ContentList{
}
};
}
@Override
public ContentType type(){
return ContentType.bullet;
}
}

View File

@ -8,12 +8,10 @@ import io.anuke.arc.graphics.g2d.Fill;
import io.anuke.arc.graphics.g2d.Lines;
import io.anuke.arc.math.Angles;
import io.anuke.arc.math.Mathf;
import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.graphics.Shapes;
import io.anuke.mindustry.type.ContentType;
import io.anuke.mindustry.type.Item;
import static io.anuke.mindustry.Vars.tilesize;
@ -24,7 +22,7 @@ public class Fx implements ContentList{
none, placeBlock, breakBlock, smoke, spawn, tapBlock, select,
vtolHover, unitDrop, unitPickup, unitLand, pickup, healWave, heal, landShock, reactorsmoke, nuclearsmoke, nuclearcloud,
redgeneratespark, generatespark, fuelburn, plasticburn, pulverize, pulverizeRed, pulverizeRedder, pulverizeSmall, pulverizeMedium,
producesmoke, smeltsmoke, formsmoke, blastsmoke, lava, doorclose, dooropenlarge, doorcloselarge, purify, purifyoil, purifystone, generate,
producesmoke, smeltsmoke, formsmoke, blastsmoke, lava, doorclose, dooropen, dooropenlarge, doorcloselarge, purify, purifyoil, purifystone, generate,
mine, mineBig, mineHuge, smelt, teleportActivate, teleport, teleportOut, ripple, bubble, commandSend,
healBlock, healBlockFull, healWaveMend, overdriveWave, overdriveBlockFull, shieldBreak, hitBulletSmall, hitFuse,
hitBulletBig, hitFlameSmall, hitLiquid, hitLaser, hitLancer, hitMeltdown, despawn, flakExplosion, blastExplosion,
@ -806,9 +804,4 @@ public class Fx implements ContentList{
Draw.reset();
});
}
@Override
public ContentType type(){
return ContentType.effect;
}
}

View File

@ -2,7 +2,6 @@ package io.anuke.mindustry.content;
import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.type.ContentType;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.type.ItemType;
@ -101,9 +100,4 @@ public class Items implements ContentList{
explosiveness = 0.2f;
}};
}
@Override
public ContentType type(){
return ContentType.item;
}
}

View File

@ -2,7 +2,6 @@ package io.anuke.mindustry.content;
import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.type.ContentType;
import io.anuke.mindustry.type.Liquid;
public class Liquids implements ContentList{
@ -53,9 +52,4 @@ public class Liquids implements ContentList{
}
};
}
@Override
public ContentType type(){
return ContentType.liquid;
}
}

View File

@ -15,7 +15,6 @@ import io.anuke.mindustry.entities.effect.Lightning;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.graphics.Shaders;
import io.anuke.mindustry.type.ContentType;
import io.anuke.mindustry.type.Mech;
public class Mechs implements ContentList{
@ -291,9 +290,4 @@ public class Mechs implements ContentList{
starterDesktop = alpha;
starterMobile = dart;
}
@Override
public ContentType type(){
return ContentType.mech;
}
}

View File

@ -1,9 +1,7 @@
package io.anuke.mindustry.content;
import io.anuke.mindustry.content.blocks.*;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.game.GameMode;
import io.anuke.mindustry.type.ContentType;
import io.anuke.mindustry.type.ItemStack;
import io.anuke.mindustry.type.Recipe;
import io.anuke.mindustry.type.Recipe.RecipeVisibility;
@ -15,186 +13,181 @@ public class Recipes implements ContentList{
@Override
public void load(){
//DEBUG
new Recipe(distribution, DebugBlocks.itemSource).setMode(GameMode.sandbox).setHidden(true).setAlwaysUnlocked(true);
new Recipe(distribution, DebugBlocks.itemVoid).setMode(GameMode.sandbox).setHidden(true).setAlwaysUnlocked(true);
new Recipe(liquid, DebugBlocks.liquidSource).setMode(GameMode.sandbox).setHidden(true).setAlwaysUnlocked(true);
new Recipe(power, DebugBlocks.powerVoid).setMode(GameMode.sandbox).setHidden(true).setAlwaysUnlocked(true);
new Recipe(power, DebugBlocks.powerInfinite).setMode(GameMode.sandbox).setHidden(true).setAlwaysUnlocked(true);
new Recipe(distribution, Blocks.itemSource).setMode(GameMode.sandbox).setHidden(true).setAlwaysUnlocked(true);
new Recipe(distribution, Blocks.itemVoid).setMode(GameMode.sandbox).setHidden(true).setAlwaysUnlocked(true);
new Recipe(liquid, Blocks.liquidSource).setMode(GameMode.sandbox).setHidden(true).setAlwaysUnlocked(true);
new Recipe(power, Blocks.powerVoid).setMode(GameMode.sandbox).setHidden(true).setAlwaysUnlocked(true);
new Recipe(power, Blocks.powerSource).setMode(GameMode.sandbox).setHidden(true).setAlwaysUnlocked(true);
//DEFENSE
//walls
new Recipe(defense, DefenseBlocks.copperWall, new ItemStack(Items.copper, 12)).setAlwaysUnlocked(true);
new Recipe(defense, DefenseBlocks.copperWallLarge, new ItemStack(Items.copper, 12 * 4)).setAlwaysUnlocked(true);
new Recipe(defense, Blocks.copperWall, new ItemStack(Items.copper, 12)).setAlwaysUnlocked(true);
new Recipe(defense, Blocks.copperWallLarge, new ItemStack(Items.copper, 12 * 4)).setAlwaysUnlocked(true);
new Recipe(defense, DefenseBlocks.denseAlloyWall, new ItemStack(Items.densealloy, 12));
new Recipe(defense, DefenseBlocks.denseAlloyWallLarge, new ItemStack(Items.densealloy, 12 * 4));
new Recipe(defense, Blocks.denseAlloyWall, new ItemStack(Items.densealloy, 12));
new Recipe(defense, Blocks.denseAlloyWallLarge, new ItemStack(Items.densealloy, 12 * 4));
new Recipe(defense, DefenseBlocks.door, new ItemStack(Items.densealloy, 12), new ItemStack(Items.silicon, 8));
new Recipe(defense, DefenseBlocks.doorLarge, new ItemStack(Items.densealloy, 12 * 4), new ItemStack(Items.silicon, 8 * 4));
new Recipe(defense, Blocks.door, new ItemStack(Items.densealloy, 12), new ItemStack(Items.silicon, 8));
new Recipe(defense, Blocks.doorLarge, new ItemStack(Items.densealloy, 12 * 4), new ItemStack(Items.silicon, 8 * 4));
new Recipe(defense, DefenseBlocks.thoriumWall, new ItemStack(Items.thorium, 12));
new Recipe(defense, DefenseBlocks.thoriumWallLarge, new ItemStack(Items.thorium, 12 * 4));
new Recipe(defense, Blocks.thoriumWall, new ItemStack(Items.thorium, 12));
new Recipe(defense, Blocks.thoriumWallLarge, new ItemStack(Items.thorium, 12 * 4));
new Recipe(defense, DefenseBlocks.phaseWall, new ItemStack(Items.phasefabric, 12));
new Recipe(defense, DefenseBlocks.phaseWallLarge, new ItemStack(Items.phasefabric, 12 * 4));
new Recipe(defense, Blocks.phaseWall, new ItemStack(Items.phasefabric, 12));
new Recipe(defense, Blocks.phaseWallLarge, new ItemStack(Items.phasefabric, 12 * 4));
new Recipe(defense, DefenseBlocks.surgeWall, new ItemStack(Items.surgealloy, 12));
new Recipe(defense, DefenseBlocks.surgeWallLarge, new ItemStack(Items.surgealloy, 12 * 4));
new Recipe(defense, Blocks.surgeWall, new ItemStack(Items.surgealloy, 12));
new Recipe(defense, Blocks.surgeWallLarge, new ItemStack(Items.surgealloy, 12 * 4));
new Recipe(effect, StorageBlocks.container, new ItemStack(Items.densealloy, 200));
new Recipe(effect, StorageBlocks.vault, new ItemStack(Items.densealloy, 500), new ItemStack(Items.thorium, 250));
new Recipe(effect, Blocks.container, new ItemStack(Items.densealloy, 200));
new Recipe(effect, Blocks.vault, new ItemStack(Items.densealloy, 500), new ItemStack(Items.thorium, 250));
new Recipe(effect, StorageBlocks.core,
new Recipe(effect, Blocks.core,
new ItemStack(Items.copper, 2000), new ItemStack(Items.densealloy, 2000),
new ItemStack(Items.silicon, 1750), new ItemStack(Items.thorium, 1000),
new ItemStack(Items.surgealloy, 500), new ItemStack(Items.phasefabric, 750)
);
//projectors
new Recipe(effect, DefenseBlocks.mendProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 50), new ItemStack(Items.silicon, 180));
new Recipe(effect, DefenseBlocks.overdriveProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250));
new Recipe(effect, DefenseBlocks.forceProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250));
new Recipe(effect, Blocks.mendProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 50), new ItemStack(Items.silicon, 180));
new Recipe(effect, Blocks.overdriveProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250));
new Recipe(effect, Blocks.forceProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250));
new Recipe(effect, DefenseBlocks.shockMine, new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 25))
new Recipe(effect, Blocks.shockMine, new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 25))
.setDependencies(Items.blastCompound);
//TURRETS
new Recipe(turret, TurretBlocks.duo, new ItemStack(Items.copper, 40)).setAlwaysUnlocked(true);
new Recipe(turret, TurretBlocks.arc, new ItemStack(Items.copper, 50), new ItemStack(Items.lead, 30), new ItemStack(Items.silicon, 20));
new Recipe(turret, TurretBlocks.hail, new ItemStack(Items.copper, 60), new ItemStack(Items.densealloy, 35));
new Recipe(turret, TurretBlocks.lancer, new ItemStack(Items.copper, 50), new ItemStack(Items.lead, 100), new ItemStack(Items.silicon, 90));
new Recipe(turret, TurretBlocks.wave, new ItemStack(Items.densealloy, 60), new ItemStack(Items.titanium, 70), new ItemStack(Items.lead, 150));
new Recipe(turret, TurretBlocks.salvo, new ItemStack(Items.copper, 210), new ItemStack(Items.densealloy, 190), new ItemStack(Items.thorium, 130));
new Recipe(turret, TurretBlocks.swarmer, new ItemStack(Items.densealloy, 70), new ItemStack(Items.titanium, 70), new ItemStack(Items.plastanium, 90), new ItemStack(Items.silicon, 60));
new Recipe(turret, TurretBlocks.ripple, new ItemStack(Items.copper, 300), new ItemStack(Items.densealloy, 220), new ItemStack(Items.thorium, 120));
new Recipe(turret, TurretBlocks.cyclone, new ItemStack(Items.copper, 400), new ItemStack(Items.densealloy, 400), new ItemStack(Items.surgealloy, 200), new ItemStack(Items.plastanium, 150));
new Recipe(turret, TurretBlocks.fuse, new ItemStack(Items.copper, 450), new ItemStack(Items.densealloy, 450), new ItemStack(Items.surgealloy, 250));
new Recipe(turret, TurretBlocks.spectre, new ItemStack(Items.copper, 700), new ItemStack(Items.densealloy, 600), new ItemStack(Items.surgealloy, 500), new ItemStack(Items.plastanium, 350), new ItemStack(Items.thorium, 500));
new Recipe(turret, TurretBlocks.meltdown, new ItemStack(Items.copper, 500), new ItemStack(Items.lead, 700), new ItemStack(Items.densealloy, 600), new ItemStack(Items.surgealloy, 650), new ItemStack(Items.silicon, 650));
new Recipe(turret, Blocks.duo, new ItemStack(Items.copper, 40)).setAlwaysUnlocked(true);
new Recipe(turret, Blocks.arc, new ItemStack(Items.copper, 50), new ItemStack(Items.lead, 30), new ItemStack(Items.silicon, 20));
new Recipe(turret, Blocks.hail, new ItemStack(Items.copper, 60), new ItemStack(Items.densealloy, 35));
new Recipe(turret, Blocks.lancer, new ItemStack(Items.copper, 50), new ItemStack(Items.lead, 100), new ItemStack(Items.silicon, 90));
new Recipe(turret, Blocks.wave, new ItemStack(Items.densealloy, 60), new ItemStack(Items.titanium, 70), new ItemStack(Items.lead, 150));
new Recipe(turret, Blocks.salvo, new ItemStack(Items.copper, 210), new ItemStack(Items.densealloy, 190), new ItemStack(Items.thorium, 130));
new Recipe(turret, Blocks.swarmer, new ItemStack(Items.densealloy, 70), new ItemStack(Items.titanium, 70), new ItemStack(Items.plastanium, 90), new ItemStack(Items.silicon, 60));
new Recipe(turret, Blocks.ripple, new ItemStack(Items.copper, 300), new ItemStack(Items.densealloy, 220), new ItemStack(Items.thorium, 120));
new Recipe(turret, Blocks.cyclone, new ItemStack(Items.copper, 400), new ItemStack(Items.densealloy, 400), new ItemStack(Items.surgealloy, 200), new ItemStack(Items.plastanium, 150));
new Recipe(turret, Blocks.fuse, new ItemStack(Items.copper, 450), new ItemStack(Items.densealloy, 450), new ItemStack(Items.surgealloy, 250));
new Recipe(turret, Blocks.spectre, new ItemStack(Items.copper, 700), new ItemStack(Items.densealloy, 600), new ItemStack(Items.surgealloy, 500), new ItemStack(Items.plastanium, 350), new ItemStack(Items.thorium, 500));
new Recipe(turret, Blocks.meltdown, new ItemStack(Items.copper, 500), new ItemStack(Items.lead, 700), new ItemStack(Items.densealloy, 600), new ItemStack(Items.surgealloy, 650), new ItemStack(Items.silicon, 650));
//DISTRIBUTION
new Recipe(distribution, DistributionBlocks.conveyor, new ItemStack(Items.copper, 1)).setAlwaysUnlocked(true);
new Recipe(distribution, DistributionBlocks.titaniumconveyor, new ItemStack(Items.copper, 2), new ItemStack(Items.titanium, 1));
new Recipe(distribution, DistributionBlocks.phaseConveyor, new ItemStack(Items.phasefabric, 10), new ItemStack(Items.silicon, 15), new ItemStack(Items.lead, 20), new ItemStack(Items.densealloy, 20));
new Recipe(distribution, Blocks.conveyor, new ItemStack(Items.copper, 1)).setAlwaysUnlocked(true);
new Recipe(distribution, Blocks.titaniumconveyor, new ItemStack(Items.copper, 2), new ItemStack(Items.titanium, 1));
new Recipe(distribution, Blocks.phaseConveyor, new ItemStack(Items.phasefabric, 10), new ItemStack(Items.silicon, 15), new ItemStack(Items.lead, 20), new ItemStack(Items.densealloy, 20));
//starter transport
new Recipe(distribution, DistributionBlocks.junction, new ItemStack(Items.copper, 2)).setAlwaysUnlocked(true);
new Recipe(distribution, DistributionBlocks.router, new ItemStack(Items.copper, 6)).setAlwaysUnlocked(true);
new Recipe(distribution, Blocks.junction, new ItemStack(Items.copper, 2)).setAlwaysUnlocked(true);
new Recipe(distribution, Blocks.router, new ItemStack(Items.copper, 6)).setAlwaysUnlocked(true);
//advanced densealloy transport
new Recipe(distribution, DistributionBlocks.distributor, new ItemStack(Items.densealloy, 8), new ItemStack(Items.copper, 8));
new Recipe(distribution, DistributionBlocks.sorter, new ItemStack(Items.densealloy, 4), new ItemStack(Items.copper, 4));
new Recipe(distribution, DistributionBlocks.overflowGate, new ItemStack(Items.densealloy, 4), new ItemStack(Items.copper, 8));
new Recipe(distribution, DistributionBlocks.itemBridge, new ItemStack(Items.densealloy, 8), new ItemStack(Items.copper, 8));
new Recipe(distribution, StorageBlocks.unloader, new ItemStack(Items.densealloy, 50), new ItemStack(Items.silicon, 60));
new Recipe(distribution, DistributionBlocks.massDriver, new ItemStack(Items.densealloy, 250), new ItemStack(Items.silicon, 150), new ItemStack(Items.lead, 250), new ItemStack(Items.thorium, 100));
new Recipe(distribution, Blocks.distributor, new ItemStack(Items.densealloy, 8), new ItemStack(Items.copper, 8));
new Recipe(distribution, Blocks.sorter, new ItemStack(Items.densealloy, 4), new ItemStack(Items.copper, 4));
new Recipe(distribution, Blocks.overflowGate, new ItemStack(Items.densealloy, 4), new ItemStack(Items.copper, 8));
new Recipe(distribution, Blocks.itemBridge, new ItemStack(Items.densealloy, 8), new ItemStack(Items.copper, 8));
new Recipe(distribution, Blocks.unloader, new ItemStack(Items.densealloy, 50), new ItemStack(Items.silicon, 60));
new Recipe(distribution, Blocks.massDriver, new ItemStack(Items.densealloy, 250), new ItemStack(Items.silicon, 150), new ItemStack(Items.lead, 250), new ItemStack(Items.thorium, 100));
//CRAFTING
//smelting
new Recipe(crafting, CraftingBlocks.smelter, new ItemStack(Items.copper, 100));
new Recipe(crafting, CraftingBlocks.arcsmelter, new ItemStack(Items.copper, 110), new ItemStack(Items.densealloy, 70), new ItemStack(Items.lead, 50));
new Recipe(crafting, CraftingBlocks.siliconsmelter, new ItemStack(Items.copper, 60), new ItemStack(Items.lead, 50));
new Recipe(crafting, Blocks.smelter, new ItemStack(Items.copper, 100));
new Recipe(crafting, Blocks.arcsmelter, new ItemStack(Items.copper, 110), new ItemStack(Items.densealloy, 70), new ItemStack(Items.lead, 50));
new Recipe(crafting, Blocks.siliconsmelter, new ItemStack(Items.copper, 60), new ItemStack(Items.lead, 50));
//advanced fabrication
new Recipe(crafting, CraftingBlocks.plastaniumCompressor, new ItemStack(Items.silicon, 160), new ItemStack(Items.lead, 230), new ItemStack(Items.densealloy, 120), new ItemStack(Items.titanium, 160));
new Recipe(crafting, CraftingBlocks.phaseWeaver, new ItemStack(Items.silicon, 260), new ItemStack(Items.lead, 240), new ItemStack(Items.thorium, 150));
new Recipe(crafting, CraftingBlocks.alloySmelter, new ItemStack(Items.silicon, 160), new ItemStack(Items.lead, 160), new ItemStack(Items.thorium, 140));
new Recipe(crafting, Blocks.plastaniumCompressor, new ItemStack(Items.silicon, 160), new ItemStack(Items.lead, 230), new ItemStack(Items.densealloy, 120), new ItemStack(Items.titanium, 160));
new Recipe(crafting, Blocks.phaseWeaver, new ItemStack(Items.silicon, 260), new ItemStack(Items.lead, 240), new ItemStack(Items.thorium, 150));
new Recipe(crafting, Blocks.alloySmelter, new ItemStack(Items.silicon, 160), new ItemStack(Items.lead, 160), new ItemStack(Items.thorium, 140));
//misc
new Recipe(crafting, CraftingBlocks.pulverizer, new ItemStack(Items.copper, 60), new ItemStack(Items.lead, 50));
new Recipe(crafting, CraftingBlocks.pyratiteMixer, new ItemStack(Items.copper, 100), new ItemStack(Items.lead, 50));
new Recipe(crafting, CraftingBlocks.blastMixer, new ItemStack(Items.lead, 60), new ItemStack(Items.densealloy, 40));
new Recipe(crafting, CraftingBlocks.cryofluidmixer, new ItemStack(Items.lead, 130), new ItemStack(Items.silicon, 80), new ItemStack(Items.thorium, 90));
new Recipe(crafting, Blocks.pulverizer, new ItemStack(Items.copper, 60), new ItemStack(Items.lead, 50));
new Recipe(crafting, Blocks.pyratiteMixer, new ItemStack(Items.copper, 100), new ItemStack(Items.lead, 50));
new Recipe(crafting, Blocks.blastMixer, new ItemStack(Items.lead, 60), new ItemStack(Items.densealloy, 40));
new Recipe(crafting, Blocks.cryofluidmixer, new ItemStack(Items.lead, 130), new ItemStack(Items.silicon, 80), new ItemStack(Items.thorium, 90));
new Recipe(crafting, CraftingBlocks.solidifier, new ItemStack(Items.densealloy, 30), new ItemStack(Items.copper, 20));
new Recipe(crafting, CraftingBlocks.melter, new ItemStack(Items.copper, 60), new ItemStack(Items.lead, 70), new ItemStack(Items.densealloy, 90));
new Recipe(crafting, CraftingBlocks.incinerator, new ItemStack(Items.densealloy, 10), new ItemStack(Items.lead, 30));
new Recipe(crafting, Blocks.solidifier, new ItemStack(Items.densealloy, 30), new ItemStack(Items.copper, 20));
new Recipe(crafting, Blocks.melter, new ItemStack(Items.copper, 60), new ItemStack(Items.lead, 70), new ItemStack(Items.densealloy, 90));
new Recipe(crafting, Blocks.incinerator, new ItemStack(Items.densealloy, 10), new ItemStack(Items.lead, 30));
//processing
new Recipe(crafting, CraftingBlocks.biomatterCompressor, new ItemStack(Items.lead, 70), new ItemStack(Items.silicon, 60));
new Recipe(crafting, CraftingBlocks.separator, new ItemStack(Items.copper, 60), new ItemStack(Items.densealloy, 50));
new Recipe(crafting, CraftingBlocks.centrifuge, new ItemStack(Items.copper, 130), new ItemStack(Items.densealloy, 130), new ItemStack(Items.silicon, 60), new ItemStack(Items.titanium, 50));
new Recipe(crafting, Blocks.biomatterCompressor, new ItemStack(Items.lead, 70), new ItemStack(Items.silicon, 60));
new Recipe(crafting, Blocks.separator, new ItemStack(Items.copper, 60), new ItemStack(Items.densealloy, 50));
new Recipe(crafting, Blocks.centrifuge, new ItemStack(Items.copper, 130), new ItemStack(Items.densealloy, 130), new ItemStack(Items.silicon, 60), new ItemStack(Items.titanium, 50));
//POWER
new Recipe(power, PowerBlocks.powerNode, new ItemStack(Items.copper, 2), new ItemStack(Items.lead, 6))
.setDependencies(PowerBlocks.combustionGenerator);
new Recipe(power, PowerBlocks.powerNodeLarge, new ItemStack(Items.densealloy, 10), new ItemStack(Items.lead, 20), new ItemStack(Items.silicon, 6))
.setDependencies(PowerBlocks.powerNode);
new Recipe(power, PowerBlocks.battery, new ItemStack(Items.copper, 8), new ItemStack(Items.lead, 30), new ItemStack(Items.silicon, 4))
.setDependencies(PowerBlocks.powerNode);
new Recipe(power, PowerBlocks.batteryLarge, new ItemStack(Items.densealloy, 40), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 30))
.setDependencies(PowerBlocks.powerNode);
new Recipe(power, Blocks.powerNode, new ItemStack(Items.copper, 2), new ItemStack(Items.lead, 6))
.setDependencies(Blocks.combustionGenerator);
new Recipe(power, Blocks.powerNodeLarge, new ItemStack(Items.densealloy, 10), new ItemStack(Items.lead, 20), new ItemStack(Items.silicon, 6))
.setDependencies(Blocks.powerNode);
new Recipe(power, Blocks.battery, new ItemStack(Items.copper, 8), new ItemStack(Items.lead, 30), new ItemStack(Items.silicon, 4))
.setDependencies(Blocks.powerNode);
new Recipe(power, Blocks.batteryLarge, new ItemStack(Items.densealloy, 40), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 30))
.setDependencies(Blocks.powerNode);
//generators - combustion
new Recipe(power, PowerBlocks.combustionGenerator, new ItemStack(Items.copper, 50), new ItemStack(Items.lead, 30));
new Recipe(power, PowerBlocks.turbineGenerator, new ItemStack(Items.copper, 70), new ItemStack(Items.densealloy, 50), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 60));
new Recipe(power, PowerBlocks.thermalGenerator, new ItemStack(Items.copper, 80), new ItemStack(Items.densealloy, 70), new ItemStack(Items.lead, 100), new ItemStack(Items.silicon, 70), new ItemStack(Items.thorium, 70));
new Recipe(power, Blocks.combustionGenerator, new ItemStack(Items.copper, 50), new ItemStack(Items.lead, 30));
new Recipe(power, Blocks.turbineGenerator, new ItemStack(Items.copper, 70), new ItemStack(Items.densealloy, 50), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 60));
new Recipe(power, Blocks.thermalGenerator, new ItemStack(Items.copper, 80), new ItemStack(Items.densealloy, 70), new ItemStack(Items.lead, 100), new ItemStack(Items.silicon, 70), new ItemStack(Items.thorium, 70));
//generators - solar
new Recipe(power, PowerBlocks.solarPanel, new ItemStack(Items.lead, 20), new ItemStack(Items.silicon, 30));
new Recipe(power, PowerBlocks.largeSolarPanel, new ItemStack(Items.lead, 200), new ItemStack(Items.silicon, 290), new ItemStack(Items.phasefabric, 30));
new Recipe(power, Blocks.solarPanel, new ItemStack(Items.lead, 20), new ItemStack(Items.silicon, 30));
new Recipe(power, Blocks.largeSolarPanel, new ItemStack(Items.lead, 200), new ItemStack(Items.silicon, 290), new ItemStack(Items.phasefabric, 30));
//generators - nuclear
new Recipe(power, PowerBlocks.thoriumReactor, new ItemStack(Items.lead, 600), new ItemStack(Items.silicon, 400), new ItemStack(Items.densealloy, 300), new ItemStack(Items.thorium, 300));
new Recipe(power, PowerBlocks.rtgGenerator, new ItemStack(Items.lead, 200), new ItemStack(Items.silicon, 150), new ItemStack(Items.phasefabric, 50), new ItemStack(Items.plastanium, 150), new ItemStack(Items.thorium, 100));
new Recipe(power, Blocks.thoriumReactor, new ItemStack(Items.lead, 600), new ItemStack(Items.silicon, 400), new ItemStack(Items.densealloy, 300), new ItemStack(Items.thorium, 300));
new Recipe(power, Blocks.rtgGenerator, new ItemStack(Items.lead, 200), new ItemStack(Items.silicon, 150), new ItemStack(Items.phasefabric, 50), new ItemStack(Items.plastanium, 150), new ItemStack(Items.thorium, 100));
//DRILLS, PRODUCERS
new Recipe(production, ProductionBlocks.mechanicalDrill, new ItemStack(Items.copper, 45)).setAlwaysUnlocked(true);
new Recipe(production, ProductionBlocks.pneumaticDrill, new ItemStack(Items.copper, 60), new ItemStack(Items.densealloy, 50));
new Recipe(production, ProductionBlocks.laserDrill, new ItemStack(Items.copper, 70), new ItemStack(Items.densealloy, 90), new ItemStack(Items.silicon, 60), new ItemStack(Items.titanium, 50));
new Recipe(production, ProductionBlocks.blastDrill, new ItemStack(Items.copper, 130), new ItemStack(Items.densealloy, 180), new ItemStack(Items.silicon, 120), new ItemStack(Items.titanium, 100), new ItemStack(Items.thorium, 60));
new Recipe(production, Blocks.mechanicalDrill, new ItemStack(Items.copper, 45)).setAlwaysUnlocked(true);
new Recipe(production, Blocks.pneumaticDrill, new ItemStack(Items.copper, 60), new ItemStack(Items.densealloy, 50));
new Recipe(production, Blocks.laserDrill, new ItemStack(Items.copper, 70), new ItemStack(Items.densealloy, 90), new ItemStack(Items.silicon, 60), new ItemStack(Items.titanium, 50));
new Recipe(production, Blocks.blastDrill, new ItemStack(Items.copper, 130), new ItemStack(Items.densealloy, 180), new ItemStack(Items.silicon, 120), new ItemStack(Items.titanium, 100), new ItemStack(Items.thorium, 60));
new Recipe(production, ProductionBlocks.waterExtractor, new ItemStack(Items.copper, 50), new ItemStack(Items.densealloy, 50), new ItemStack(Items.lead, 40));
new Recipe(production, ProductionBlocks.cultivator, new ItemStack(Items.copper, 20), new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 20));
new Recipe(production, ProductionBlocks.oilExtractor, new ItemStack(Items.copper, 300), new ItemStack(Items.densealloy, 350), new ItemStack(Items.lead, 230), new ItemStack(Items.thorium, 230), new ItemStack(Items.silicon, 150));
new Recipe(production, Blocks.waterExtractor, new ItemStack(Items.copper, 50), new ItemStack(Items.densealloy, 50), new ItemStack(Items.lead, 40));
new Recipe(production, Blocks.cultivator, new ItemStack(Items.copper, 20), new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 20));
new Recipe(production, Blocks.oilExtractor, new ItemStack(Items.copper, 300), new ItemStack(Items.densealloy, 350), new ItemStack(Items.lead, 230), new ItemStack(Items.thorium, 230), new ItemStack(Items.silicon, 150));
//UNITS
//upgrades
new Recipe(upgrade, UpgradeBlocks.dartPad, new ItemStack(Items.lead, 150), new ItemStack(Items.copper, 150), new ItemStack(Items.silicon, 200), new ItemStack(Items.titanium, 240)).setVisible(RecipeVisibility.desktopOnly);
new Recipe(upgrade, UpgradeBlocks.tridentPad, new ItemStack(Items.lead, 250), new ItemStack(Items.copper, 250), new ItemStack(Items.silicon, 250), new ItemStack(Items.titanium, 300), new ItemStack(Items.plastanium, 200));
new Recipe(upgrade, UpgradeBlocks.javelinPad, new ItemStack(Items.lead, 350), new ItemStack(Items.silicon, 450), new ItemStack(Items.titanium, 500), new ItemStack(Items.plastanium, 400), new ItemStack(Items.phasefabric, 200));
new Recipe(upgrade, UpgradeBlocks.glaivePad, new ItemStack(Items.lead, 450), new ItemStack(Items.silicon, 650), new ItemStack(Items.titanium, 700), new ItemStack(Items.plastanium, 600), new ItemStack(Items.surgealloy, 200));
new Recipe(upgrade, Blocks.dartPad, new ItemStack(Items.lead, 150), new ItemStack(Items.copper, 150), new ItemStack(Items.silicon, 200), new ItemStack(Items.titanium, 240)).setVisible(RecipeVisibility.desktopOnly);
new Recipe(upgrade, Blocks.tridentPad, new ItemStack(Items.lead, 250), new ItemStack(Items.copper, 250), new ItemStack(Items.silicon, 250), new ItemStack(Items.titanium, 300), new ItemStack(Items.plastanium, 200));
new Recipe(upgrade, Blocks.javelinPad, new ItemStack(Items.lead, 350), new ItemStack(Items.silicon, 450), new ItemStack(Items.titanium, 500), new ItemStack(Items.plastanium, 400), new ItemStack(Items.phasefabric, 200));
new Recipe(upgrade, Blocks.glaivePad, new ItemStack(Items.lead, 450), new ItemStack(Items.silicon, 650), new ItemStack(Items.titanium, 700), new ItemStack(Items.plastanium, 600), new ItemStack(Items.surgealloy, 200));
new Recipe(upgrade, UpgradeBlocks.alphaPad, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 100), new ItemStack(Items.copper, 150)).setVisible(RecipeVisibility.mobileOnly);
new Recipe(upgrade, UpgradeBlocks.tauPad, new ItemStack(Items.lead, 250), new ItemStack(Items.densealloy, 250), new ItemStack(Items.copper, 250), new ItemStack(Items.silicon, 250));
new Recipe(upgrade, UpgradeBlocks.deltaPad, new ItemStack(Items.lead, 350), new ItemStack(Items.densealloy, 350), new ItemStack(Items.copper, 400), new ItemStack(Items.silicon, 450), new ItemStack(Items.thorium, 300));
new Recipe(upgrade, UpgradeBlocks.omegaPad, new ItemStack(Items.lead, 450), new ItemStack(Items.densealloy, 550), new ItemStack(Items.silicon, 650), new ItemStack(Items.thorium, 600), new ItemStack(Items.surgealloy, 240));
new Recipe(upgrade, Blocks.alphaPad, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 100), new ItemStack(Items.copper, 150)).setVisible(RecipeVisibility.mobileOnly);
new Recipe(upgrade, Blocks.tauPad, new ItemStack(Items.lead, 250), new ItemStack(Items.densealloy, 250), new ItemStack(Items.copper, 250), new ItemStack(Items.silicon, 250));
new Recipe(upgrade, Blocks.deltaPad, new ItemStack(Items.lead, 350), new ItemStack(Items.densealloy, 350), new ItemStack(Items.copper, 400), new ItemStack(Items.silicon, 450), new ItemStack(Items.thorium, 300));
new Recipe(upgrade, Blocks.omegaPad, new ItemStack(Items.lead, 450), new ItemStack(Items.densealloy, 550), new ItemStack(Items.silicon, 650), new ItemStack(Items.thorium, 600), new ItemStack(Items.surgealloy, 240));
//actual unit related stuff
new Recipe(units, UnitBlocks.spiritFactory, new ItemStack(Items.copper, 70), new ItemStack(Items.lead, 110), new ItemStack(Items.silicon, 130));
new Recipe(units, UnitBlocks.phantomFactory, new ItemStack(Items.densealloy, 90), new ItemStack(Items.thorium, 80), new ItemStack(Items.lead, 110), new ItemStack(Items.silicon, 210));
new Recipe(units, Blocks.spiritFactory, new ItemStack(Items.copper, 70), new ItemStack(Items.lead, 110), new ItemStack(Items.silicon, 130));
new Recipe(units, Blocks.phantomFactory, new ItemStack(Items.densealloy, 90), new ItemStack(Items.thorium, 80), new ItemStack(Items.lead, 110), new ItemStack(Items.silicon, 210));
new Recipe(units, UnitBlocks.daggerFactory, new ItemStack(Items.lead, 90), new ItemStack(Items.silicon, 70));
new Recipe(units, UnitBlocks.titanFactory, new ItemStack(Items.thorium, 90), new ItemStack(Items.lead, 140), new ItemStack(Items.silicon, 90));
new Recipe(units, UnitBlocks.fortressFactory, new ItemStack(Items.thorium, 200), new ItemStack(Items.lead, 220), new ItemStack(Items.silicon, 150), new ItemStack(Items.surgealloy, 100), new ItemStack(Items.phasefabric, 50));
new Recipe(units, Blocks.daggerFactory, new ItemStack(Items.lead, 90), new ItemStack(Items.silicon, 70));
new Recipe(units, Blocks.titanFactory, new ItemStack(Items.thorium, 90), new ItemStack(Items.lead, 140), new ItemStack(Items.silicon, 90));
new Recipe(units, Blocks.fortressFactory, new ItemStack(Items.thorium, 200), new ItemStack(Items.lead, 220), new ItemStack(Items.silicon, 150), new ItemStack(Items.surgealloy, 100), new ItemStack(Items.phasefabric, 50));
new Recipe(units, UnitBlocks.wraithFactory, new ItemStack(Items.titanium, 60), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 90));
new Recipe(units, UnitBlocks.ghoulFactory, new ItemStack(Items.plastanium, 80), new ItemStack(Items.titanium, 100), new ItemStack(Items.lead, 130), new ItemStack(Items.silicon, 220));
new Recipe(units, UnitBlocks.revenantFactory, new ItemStack(Items.plastanium, 300), new ItemStack(Items.titanium, 400), new ItemStack(Items.lead, 300), new ItemStack(Items.silicon, 400), new ItemStack(Items.surgealloy, 100));
new Recipe(units, Blocks.wraithFactory, new ItemStack(Items.titanium, 60), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 90));
new Recipe(units, Blocks.ghoulFactory, new ItemStack(Items.plastanium, 80), new ItemStack(Items.titanium, 100), new ItemStack(Items.lead, 130), new ItemStack(Items.silicon, 220));
new Recipe(units, Blocks.revenantFactory, new ItemStack(Items.plastanium, 300), new ItemStack(Items.titanium, 400), new ItemStack(Items.lead, 300), new ItemStack(Items.silicon, 400), new ItemStack(Items.surgealloy, 100));
new Recipe(units, UnitBlocks.repairPoint, new ItemStack(Items.lead, 30), new ItemStack(Items.copper, 30), new ItemStack(Items.silicon, 30));
new Recipe(units, UnitBlocks.commandCenter, new ItemStack(Items.lead, 100), new ItemStack(Items.densealloy, 100), new ItemStack(Items.silicon, 200));
new Recipe(units, Blocks.repairPoint, new ItemStack(Items.lead, 30), new ItemStack(Items.copper, 30), new ItemStack(Items.silicon, 30));
new Recipe(units, Blocks.commandCenter, new ItemStack(Items.lead, 100), new ItemStack(Items.densealloy, 100), new ItemStack(Items.silicon, 200));
//LIQUIDS
new Recipe(liquid, LiquidBlocks.conduit, new ItemStack(Items.lead, 1)).setDependencies(CraftingBlocks.smelter);
new Recipe(liquid, LiquidBlocks.pulseConduit, new ItemStack(Items.titanium, 1), new ItemStack(Items.lead, 1));
new Recipe(liquid, LiquidBlocks.phaseConduit, new ItemStack(Items.phasefabric, 10), new ItemStack(Items.silicon, 15), new ItemStack(Items.lead, 20), new ItemStack(Items.titanium, 20));
new Recipe(liquid, Blocks.conduit, new ItemStack(Items.lead, 1)).setDependencies(Blocks.smelter);
new Recipe(liquid, Blocks.pulseConduit, new ItemStack(Items.titanium, 1), new ItemStack(Items.lead, 1));
new Recipe(liquid, Blocks.phaseConduit, new ItemStack(Items.phasefabric, 10), new ItemStack(Items.silicon, 15), new ItemStack(Items.lead, 20), new ItemStack(Items.titanium, 20));
new Recipe(liquid, LiquidBlocks.liquidRouter, new ItemStack(Items.titanium, 4), new ItemStack(Items.lead, 4));
new Recipe(liquid, LiquidBlocks.liquidtank, new ItemStack(Items.titanium, 50), new ItemStack(Items.lead, 50));
new Recipe(liquid, LiquidBlocks.liquidJunction, new ItemStack(Items.titanium, 4), new ItemStack(Items.lead, 4));
new Recipe(liquid, LiquidBlocks.bridgeConduit, new ItemStack(Items.titanium, 8), new ItemStack(Items.lead, 8));
new Recipe(liquid, Blocks.liquidRouter, new ItemStack(Items.titanium, 4), new ItemStack(Items.lead, 4));
new Recipe(liquid, Blocks.liquidtank, new ItemStack(Items.titanium, 50), new ItemStack(Items.lead, 50));
new Recipe(liquid, Blocks.liquidJunction, new ItemStack(Items.titanium, 4), new ItemStack(Items.lead, 4));
new Recipe(liquid, Blocks.bridgeConduit, new ItemStack(Items.titanium, 8), new ItemStack(Items.lead, 8));
new Recipe(liquid, LiquidBlocks.mechanicalPump, new ItemStack(Items.copper, 30), new ItemStack(Items.lead, 20)).setDependencies(CraftingBlocks.smelter);
new Recipe(liquid, LiquidBlocks.rotaryPump, new ItemStack(Items.copper, 140), new ItemStack(Items.lead, 100), new ItemStack(Items.silicon, 40), new ItemStack(Items.titanium, 70));
new Recipe(liquid, LiquidBlocks.thermalPump, new ItemStack(Items.copper, 160), new ItemStack(Items.lead, 130), new ItemStack(Items.silicon, 60), new ItemStack(Items.titanium, 80), new ItemStack(Items.thorium, 70));
}
@Override
public ContentType type(){
return ContentType.recipe;
new Recipe(liquid, Blocks.mechanicalPump, new ItemStack(Items.copper, 30), new ItemStack(Items.lead, 20)).setDependencies(Blocks.smelter);
new Recipe(liquid, Blocks.rotaryPump, new ItemStack(Items.copper, 140), new ItemStack(Items.lead, 100), new ItemStack(Items.silicon, 40), new ItemStack(Items.titanium, 70));
new Recipe(liquid, Blocks.thermalPump, new ItemStack(Items.copper, 160), new ItemStack(Items.lead, 130), new ItemStack(Items.silicon, 60), new ItemStack(Items.titanium, 80), new ItemStack(Items.thorium, 70));
}
}

View File

@ -6,7 +6,6 @@ import io.anuke.arc.util.Time;
import io.anuke.mindustry.entities.StatusController.StatusEntry;
import io.anuke.mindustry.entities.Unit;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.type.ContentType;
import io.anuke.mindustry.type.StatusEffect;
public class StatusEffects implements ContentList{
@ -168,9 +167,4 @@ public class StatusEffects implements ContentList{
freezing.setOpposites(burning, melting);
burning.setOpposites(wet, freezing);
}
@Override
public ContentType type(){
return ContentType.status;
}
}

View File

@ -4,7 +4,6 @@ import io.anuke.arc.collection.ObjectSet;
import io.anuke.mindustry.entities.units.UnitType;
import io.anuke.mindustry.entities.units.types.*;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.type.ContentType;
public class UnitTypes implements ContentList{
public static UnitType
@ -106,9 +105,4 @@ public class UnitTypes implements ContentList{
toMine = ObjectSet.with(Items.lead, Items.copper, Items.titanium);
}};
}
@Override
public ContentType type(){
return ContentType.unit;
}
}

View File

@ -1,7 +1,6 @@
package io.anuke.mindustry.content;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.type.ContentType;
import io.anuke.mindustry.type.Weapon;
public class Weapons implements ContentList{
@ -180,9 +179,4 @@ public class Weapons implements ContentList{
ammo = Bullets.healBullet;
}};
}
@Override
public ContentType type(){
return ContentType.weapon;
}
}

View File

@ -1,12 +0,0 @@
package io.anuke.mindustry.content.blocks;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.type.ContentType;
public abstract class BlockList implements ContentList{
@Override
public ContentType type(){
return ContentType.item;
}
}

View File

@ -1,177 +0,0 @@
package io.anuke.mindustry.content.blocks;
import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.content.StatusEffects;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.graphics.CacheLayer;
import io.anuke.mindustry.type.ItemStack;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.*;
import io.anuke.arc.util.Time;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.Lines;
import io.anuke.arc.math.Mathf;
public class Blocks extends BlockList implements ContentList{
public static Block air, blockpart, spawn, space, metalfloor, deepwater, water, lava, tar, stone,
blackstone, dirt, sand, ice, snow, grass, shrub, rock, icerock, blackrock;
@Override
public void load(){
air = new Floor("air"){
{
blend = false;
alwaysReplace = true;
}
public void draw(Tile tile){}
public void load(){}
public void init(){}
};
blockpart = new BlockPart();
spawn = new Block("spawn"){
public void drawShadow(Tile tile){}
public void draw(Tile tile){
Draw.color(Color.SCARLET);
Lines.circle(tile.worldx(), tile.worldy(), 4f +Mathf.absin(Time.time(), 6f, 6f));
Draw.color();
}
};
//Registers build blocks from size 1-6
//no reference is needed here since they can be looked up by name later
for(int i = 1; i <= 6; i++){
new BuildBlock("build" + i);
}
space = new Floor("space"){{
placeableOn = false;
variants = 0;
cacheLayer = CacheLayer.space;
solid = true;
blend = false;
minimapColor = Color.valueOf("000001");
}};
metalfloor = new Floor("metalfloor"){{
variants = 6;
}};
deepwater = new Floor("deepwater"){{
liquidColor = Color.valueOf("546bb3");
speedMultiplier = 0.2f;
variants = 0;
liquidDrop = Liquids.water;
isLiquid = true;
status = StatusEffects.wet;
statusIntensity = 1f;
drownTime = 140f;
cacheLayer = CacheLayer.water;
minimapColor = Color.valueOf("465a96");
}};
water = new Floor("water"){{
liquidColor = Color.valueOf("546bb3");
speedMultiplier = 0.5f;
variants = 0;
status = StatusEffects.wet;
statusIntensity = 0.9f;
liquidDrop = Liquids.water;
isLiquid = true;
cacheLayer = CacheLayer.water;
minimapColor = Color.valueOf("506eb4");
}};
lava = new Floor("lava"){{
drownTime = 100f;
liquidColor = Color.valueOf("ed5334");
speedMultiplier = 0.2f;
damageTaken = 0.5f;
status = StatusEffects.melting;
statusIntensity = 0.8f;
variants = 0;
liquidDrop = Liquids.lava;
isLiquid = true;
cacheLayer = CacheLayer.lava;
minimapColor = Color.valueOf("ed5334");
}};
tar = new Floor("tar"){{
drownTime = 150f;
liquidColor = Color.valueOf("292929");
status = StatusEffects.tarred;
statusIntensity = 1f;
speedMultiplier = 0.19f;
variants = 0;
liquidDrop = Liquids.oil;
isLiquid = true;
cacheLayer = CacheLayer.oil;
minimapColor = Color.valueOf("292929");
}};
stone = new Floor("stone"){{
hasOres = true;
drops = new ItemStack(Items.stone, 1);
blends = block -> block != this && !(block instanceof OreBlock);
minimapColor = Color.valueOf("323232");
playerUnmineable = true;
}};
blackstone = new Floor("blackstone"){{
drops = new ItemStack(Items.stone, 1);
minimapColor = Color.valueOf("252525");
playerUnmineable = true;
hasOres = true;
}};
dirt = new Floor("dirt"){{
minimapColor = Color.valueOf("6e501e");
}};
sand = new Floor("sand"){{
drops = new ItemStack(Items.sand, 1);
minimapColor = Color.valueOf("988a67");
hasOres = true;
playerUnmineable = true;
}};
ice = new Floor("ice"){{
dragMultiplier = 0.2f;
speedMultiplier = 0.4f;
minimapColor = Color.valueOf("b8eef8");
hasOres = true;
}};
snow = new Floor("snow"){{
minimapColor = Color.valueOf("c2d1d2");
hasOres = true;
}};
grass = new Floor("grass"){{
hasOres = true;
minimapColor = Color.valueOf("549d5b");
}};
shrub = new Rock("shrub");
rock = new Rock("rock"){{
variants = 2;
}};
icerock = new Rock("icerock"){{
variants = 2;
}};
blackrock = new Rock("blackrock"){{
variants = 1;
}};
}
}

View File

@ -1,235 +0,0 @@
package io.anuke.mindustry.content.blocks;
import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.type.ItemStack;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.production.*;
public class CraftingBlocks extends BlockList implements ContentList{
public static Block smelter, arcsmelter, siliconsmelter, plastaniumCompressor, phaseWeaver, alloySmelter,
pyratiteMixer, blastMixer,
cryofluidmixer, melter, separator, centrifuge, biomatterCompressor, pulverizer, solidifier, incinerator;
@Override
public void load(){
smelter = new Smelter("smelter"){{
health = 70;
result = Items.densealloy;
craftTime = 45f;
burnDuration = 46f;
useFlux = true;
consumes.items(new ItemStack(Items.copper, 1), new ItemStack(Items.lead, 2));
consumes.item(Items.coal).optional(true);
}};
arcsmelter = new PowerSmelter("arc-smelter"){{
health = 90;
craftEffect = Fx.smeltsmoke;
result = Items.densealloy;
craftTime = 30f;
size = 2;
useFlux = true;
fluxNeeded = 2;
consumes.items(new ItemStack(Items.copper, 1), new ItemStack(Items.lead, 2));
consumes.power(0.1f);
}};
siliconsmelter = new PowerSmelter("silicon-smelter"){{
health = 90;
craftEffect = Fx.smeltsmoke;
result = Items.silicon;
craftTime = 40f;
size = 2;
hasLiquids = false;
flameColor = Color.valueOf("ffef99");
consumes.items(new ItemStack(Items.coal, 1), new ItemStack(Items.sand, 2));
consumes.power(0.05f);
}};
plastaniumCompressor = new PlastaniumCompressor("plastanium-compressor"){{
hasItems = true;
liquidCapacity = 60f;
craftTime = 60f;
output = Items.plastanium;
itemCapacity = 30;
size = 2;
health = 320;
hasPower = hasLiquids = true;
craftEffect = Fx.formsmoke;
updateEffect = Fx.plasticburn;
consumes.liquid(Liquids.oil, 0.25f);
consumes.power(0.3f);
consumes.item(Items.titanium, 2);
}};
phaseWeaver = new PhaseWeaver("phase-weaver"){{
craftEffect = Fx.smeltsmoke;
result = Items.phasefabric;
craftTime = 120f;
size = 2;
consumes.items(new ItemStack(Items.thorium, 4), new ItemStack(Items.sand, 10));
consumes.power(0.5f);
}};
alloySmelter = new PowerSmelter("alloy-smelter"){{
craftEffect = Fx.smeltsmoke;
result = Items.surgealloy;
craftTime = 75f;
size = 2;
useFlux = true;
fluxNeeded = 3;
consumes.power(0.4f);
consumes.items(new ItemStack(Items.titanium, 2), new ItemStack(Items.lead, 4), new ItemStack(Items.silicon, 3), new ItemStack(Items.copper, 3));
}};
cryofluidmixer = new LiquidMixer("cryofluidmixer"){{
outputLiquid = Liquids.cryofluid;
liquidPerItem = 50f;
itemCapacity = 50;
size = 2;
hasPower = true;
consumes.power(0.1f);
consumes.item(Items.titanium);
consumes.liquid(Liquids.water, 0.3f);
}};
blastMixer = new GenericCrafter("blast-mixer"){{
itemCapacity = 20;
hasItems = true;
hasPower = true;
hasLiquids = true;
output = Items.blastCompound;
size = 2;
consumes.liquid(Liquids.oil, 0.05f);
consumes.item(Items.pyratite, 1);
consumes.power(0.04f);
}};
pyratiteMixer = new PowerSmelter("pyratite-mixer"){{
flameColor = Color.CLEAR;
itemCapacity = 20;
hasItems = true;
hasPower = true;
result = Items.pyratite;
size = 2;
consumes.power(0.02f);
consumes.items(new ItemStack(Items.coal, 1), new ItemStack(Items.lead, 2), new ItemStack(Items.sand, 2));
}};
melter = new PowerCrafter("melter"){{
health = 200;
outputLiquid = Liquids.lava;
outputLiquidAmount = 1f;
itemCapacity = 20;
craftTime = 10f;
hasLiquids = hasPower = true;
consumes.power(0.1f);
consumes.item(Items.stone, 1);
}};
separator = new Separator("separator"){{
results = new ItemStack[]{
new ItemStack(null, 10),
new ItemStack(Items.sand, 10),
new ItemStack(Items.stone, 9),
new ItemStack(Items.copper, 4),
new ItemStack(Items.lead, 2),
new ItemStack(Items.coal, 2),
new ItemStack(Items.titanium, 1),
};
filterTime = 40f;
itemCapacity = 40;
health = 50;
consumes.item(Items.stone, 2);
consumes.liquid(Liquids.water, 0.3f);
}};
centrifuge = new Separator("centrifuge"){{
results = new ItemStack[]{
new ItemStack(null, 13),
new ItemStack(Items.sand, 12),
new ItemStack(Items.stone, 11),
new ItemStack(Items.copper, 5),
new ItemStack(Items.lead, 3),
new ItemStack(Items.coal, 3),
new ItemStack(Items.titanium, 2),
new ItemStack(Items.thorium, 1)
};
hasPower = true;
filterTime = 15f;
itemCapacity = 60;
health = 50 * 4;
spinnerLength = 1.5f;
spinnerRadius = 3.5f;
spinnerThickness = 1.5f;
spinnerSpeed = 3f;
size = 2;
consumes.item(Items.stone, 2);
consumes.power(0.2f);
consumes.liquid(Liquids.water, 0.5f);
}};
biomatterCompressor = new Compressor("biomattercompressor"){{
liquidCapacity = 60f;
itemCapacity = 50;
craftTime = 20f;
outputLiquid = Liquids.oil;
outputLiquidAmount = 2.5f;
size = 2;
health = 320;
hasLiquids = true;
consumes.item(Items.biomatter, 1);
consumes.power(0.06f);
}};
pulverizer = new Pulverizer("pulverizer"){{
itemCapacity = 40;
output = Items.sand;
health = 80;
craftEffect = Fx.pulverize;
craftTime = 40f;
updateEffect = Fx.pulverizeSmall;
hasItems = hasPower = true;
consumes.item(Items.stone, 1);
consumes.power(0.05f);
}};
solidifier = new GenericCrafter("solidifer"){{
liquidCapacity = 21f;
craftTime = 14;
output = Items.stone;
itemCapacity = 20;
health = 80;
craftEffect = Fx.purifystone;
hasLiquids = hasItems = true;
consumes.liquid(Liquids.lava, 1f);
}};
incinerator = new Incinerator("incinerator"){{
health = 90;
}};
}
}

View File

@ -1,180 +0,0 @@
package io.anuke.mindustry.content.blocks;
import io.anuke.arc.collection.Array;
import io.anuke.annotations.Annotations.Loc;
import io.anuke.annotations.Annotations.Remote;
import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.gen.Call;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.type.Liquid;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.PowerBlock;
import io.anuke.mindustry.world.blocks.distribution.Sorter;
import io.anuke.mindustry.world.blocks.power.PowerNode;
import io.anuke.mindustry.world.meta.BlockStat;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.scene.ui.ButtonGroup;
import io.anuke.arc.scene.ui.ImageButton;
import io.anuke.arc.scene.ui.layout.Table;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import static io.anuke.mindustry.Vars.*;
public class DebugBlocks extends BlockList implements ContentList{
public static Block powerVoid, powerInfinite, itemSource, liquidSource, itemVoid;
@Remote(targets = Loc.both, called = Loc.both, forward = true)
public static void setLiquidSourceLiquid(Player player, Tile tile, Liquid liquid){
LiquidSourceEntity entity = tile.entity();
entity.source = liquid;
}
@Override
public void load(){
powerVoid = new PowerBlock("powervoid"){
{
consumes.power(Float.MAX_VALUE);
}
@Override
public void init(){
super.init();
stats.remove(BlockStat.powerUse);
}
};
powerInfinite = new PowerNode("powerinfinite"){
{
maxNodes = 100;
outputsPower = true;
consumesPower = false;
}
@Override
public float getPowerProduction(Tile tile){
return 10000f;
}
};
itemSource = new Sorter("itemsource"){
{
hasItems = true;
}
@Override
public boolean outputsItems(){
return true;
}
@Override
public void update(Tile tile){
SorterEntity entity = tile.entity();
if(entity.sortItem == null) return;
entity.items.set(entity.sortItem, 1);
tryDump(tile, entity.sortItem);
entity.items.set(entity.sortItem, 0);
}
@Override
public boolean acceptItem(Item item, Tile tile, Tile source){
return false;
}
};
liquidSource = new Block("liquidsource"){
{
update = true;
solid = true;
hasLiquids = true;
liquidCapacity = 100f;
configurable = true;
outputsLiquid = true;
}
@Override
public void update(Tile tile){
LiquidSourceEntity entity = tile.entity();
tile.entity.liquids.add(entity.source, liquidCapacity);
tryDumpLiquid(tile, entity.source);
}
@Override
public void draw(Tile tile){
super.draw(tile);
LiquidSourceEntity entity = tile.entity();
Draw.color(entity.source.color);
Draw.rect("blank", tile.worldx(), tile.worldy(), 4f, 4f);
Draw.color();
}
@Override
public void buildTable(Tile tile, Table table){
LiquidSourceEntity entity = tile.entity();
Array<Liquid> items = content.liquids();
ButtonGroup<ImageButton> group = new ButtonGroup<>();
Table cont = new Table();
for(int i = 0; i < items.size; i++){
if(!control.unlocks.isUnlocked(items.get(i))) continue;
final int f = i;
ImageButton button = cont.addImageButton("liquid-icon-" + items.get(i).name, "clear-toggle", 24,
() -> Call.setLiquidSourceLiquid(null, tile, items.get(f))).size(38).group(group).get();
button.setChecked(entity.source.id == f);
if(i % 4 == 3){
cont.row();
}
}
table.add(cont);
}
@Override
public TileEntity newEntity(){
return new LiquidSourceEntity();
}
};
itemVoid = new Block("itemvoid"){
{
update = solid = true;
}
@Override
public void handleItem(Item item, Tile tile, Tile source){
}
@Override
public boolean acceptItem(Item item, Tile tile, Tile source){
return true;
}
};
}
class LiquidSourceEntity extends TileEntity{
public Liquid source = Liquids.water;
@Override
public void writeConfig(DataOutput stream) throws IOException{
stream.writeByte(source.id);
}
@Override
public void readConfig(DataInput stream) throws IOException{
source = content.liquid(stream.readByte());
}
}
}

View File

@ -1,98 +0,0 @@
package io.anuke.mindustry.content.blocks;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.defense.*;
public class DefenseBlocks extends BlockList implements ContentList{
public static Block copperWall, copperWallLarge, denseAlloyWall, denseAlloyWallLarge, thoriumWall, thoriumWallLarge, door, doorLarge,
phaseWall, phaseWallLarge, surgeWall, surgeWallLarge, mendProjector, overdriveProjector, forceProjector, shockMine;
@Override
public void load(){
int wallHealthMultiplier = 3;
copperWall = new Wall("copper-wall"){{
health = 80 * wallHealthMultiplier;
}};
copperWallLarge = new Wall("copper-wall-large"){{
health = 80 * 4 * wallHealthMultiplier;
size = 2;
}};
denseAlloyWall = new Wall("dense-alloy-wall"){{
health = 110 * wallHealthMultiplier;
}};
denseAlloyWallLarge = new Wall("dense-alloy-wall-large"){{
health = 110 * wallHealthMultiplier * 4;
size = 2;
}};
thoriumWall = new Wall("thorium-wall"){{
health = 200 * wallHealthMultiplier;
}};
thoriumWallLarge = new Wall("thorium-wall-large"){{
health = 200 * wallHealthMultiplier * 4;
size = 2;
}};
phaseWall = new DeflectorWall("phase-wall"){{
health = 150 * wallHealthMultiplier;
}};
phaseWallLarge = new DeflectorWall("phase-wall-large"){{
health = 150 * 4 * wallHealthMultiplier;
size = 2;
}};
surgeWall = new SurgeWall("surge-wall"){{
health = 230 * wallHealthMultiplier;
}};
surgeWallLarge = new SurgeWall("surge-wall-large"){{
health = 230 * 4 * wallHealthMultiplier;
size = 2;
}};
door = new Door("door"){{
health = 100 * wallHealthMultiplier;
}};
doorLarge = new Door("door-large"){{
openfx = Fx.dooropenlarge;
closefx = Fx.doorcloselarge;
health = 100 * 4 * wallHealthMultiplier;
size = 2;
}};
mendProjector = new MendProjector("mend-projector"){{
consumes.power(0.2f, 1.0f);
size = 2;
consumes.item(Items.phasefabric).optional(true);
}};
overdriveProjector = new OverdriveProjector("overdrive-projector"){{
consumes.power(0.35f, 1.0f);
size = 2;
consumes.item(Items.phasefabric).optional(true);
}};
forceProjector = new ForceProjector("force-projector"){{
size = 3;
consumes.item(Items.phasefabric).optional(true);
}};
shockMine = new ShockMine("shock-mine"){{
health = 40;
damage = 11;
tileDamage = 7f;
length = 10;
tendrils = 5;
}};
}
}

View File

@ -1,57 +0,0 @@
package io.anuke.mindustry.content.blocks;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.distribution.*;
public class DistributionBlocks extends BlockList implements ContentList{
public static Block conveyor, titaniumconveyor, distributor, junction,
itemBridge, phaseConveyor, sorter, router, overflowGate, massDriver;
@Override
public void load(){
conveyor = new Conveyor("conveyor"){{
health = 45;
speed = 0.03f;
}};
titaniumconveyor = new Conveyor("titanium-conveyor"){{
health = 65;
speed = 0.07f;
}};
junction = new Junction("junction"){{
speed = 26;
capacity = 32;
}};
itemBridge = new BufferedItemBridge("bridge-conveyor"){{
range = 4;
speed = 60f;
bufferCapacity = 15;
}};
phaseConveyor = new ItemBridge("phase-conveyor"){{
range = 12;
hasPower = true;
consumes.power(0.03f, 1.0f);
}};
sorter = new Sorter("sorter");
router = new Router("router");
distributor = new Router("distributor"){{
size = 2;
}};
overflowGate = new OverflowGate("overflow-gate");
massDriver = new MassDriver("mass-driver"){{
size = 3;
itemCapacity = 60;
range = 440f;
}};
}
}

View File

@ -1,70 +0,0 @@
package io.anuke.mindustry.content.blocks;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.distribution.*;
import io.anuke.mindustry.world.blocks.production.Pump;
public class LiquidBlocks extends BlockList implements ContentList{
public static Block mechanicalPump, rotaryPump, thermalPump, conduit, pulseConduit, liquidRouter, liquidtank, liquidJunction, bridgeConduit, phaseConduit;
@Override
public void load(){
mechanicalPump = new Pump("mechanical-pump"){{
pumpAmount = 0.1f;
tier = 0;
}};
rotaryPump = new Pump("rotary-pump"){{
pumpAmount = 0.2f;
consumes.power(0.015f);
liquidCapacity = 30f;
hasPower = true;
size = 2;
tier = 1;
}};
thermalPump = new Pump("thermal-pump"){{
pumpAmount = 0.275f;
consumes.power(0.03f);
liquidCapacity = 40f;
hasPower = true;
size = 2;
tier = 2;
}};
conduit = new Conduit("conduit"){{
health = 45;
}};
pulseConduit = new Conduit("pulse-conduit"){{
liquidCapacity = 16f;
liquidFlowFactor = 4.9f;
health = 90;
}};
liquidRouter = new LiquidRouter("liquid-router"){{
liquidCapacity = 20f;
}};
liquidtank = new LiquidTank("liquid-tank"){{
size = 3;
liquidCapacity = 1500f;
health = 500;
}};
liquidJunction = new LiquidJunction("liquid-junction");
bridgeConduit = new LiquidExtendingBridge("bridge-conduit"){{
range = 4;
hasPower = false;
}};
phaseConduit = new LiquidBridge("phase-conduit"){{
range = 12;
hasPower = true;
consumes.power(0.03f, 1.0f);
}};
}
}

View File

@ -1,36 +0,0 @@
package io.anuke.mindustry.content.blocks;
import io.anuke.arc.collection.ObjectMap;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.Floor;
import io.anuke.mindustry.world.blocks.OreBlock;
import static io.anuke.mindustry.Vars.content;
public class OreBlocks extends BlockList{
private static final ObjectMap<Item, ObjectMap<Block, Block>> oreBlockMap = new ObjectMap<>();
public static Block get(Block floor, Item item){
if(!oreBlockMap.containsKey(item)) throw new IllegalArgumentException("Item '" + item + "' is not an ore!");
if(!oreBlockMap.get(item).containsKey(floor))
throw new IllegalArgumentException("Block '" + floor.name + "' does not support ores!");
return oreBlockMap.get(item).get(floor);
}
@Override
public void load(){
for(Item item : content.items()){
if(!item.genOre) continue;
ObjectMap<Block, Block> map = new ObjectMap<>();
oreBlockMap.put(item, map);
for(Block block : content.blocks()){
if(block instanceof Floor && ((Floor) block).hasOres){
map.put(block, new OreBlock(item, (Floor) block));
}
}
}
}
}

View File

@ -1,81 +0,0 @@
package io.anuke.mindustry.content.blocks;
import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.power.*;
public class PowerBlocks extends BlockList implements ContentList{
public static Block combustionGenerator, thermalGenerator, turbineGenerator, rtgGenerator, solarPanel, largeSolarPanel,
thoriumReactor, fusionReactor, battery, batteryLarge, powerNode, powerNodeLarge;
@Override
public void load(){
combustionGenerator = new BurnerGenerator("combustion-generator"){{
powerProduction = 0.09f;
itemDuration = 40f;
}};
thermalGenerator = new LiquidHeatGenerator("thermal-generator"){{
maxLiquidGenerate = 2f;
powerProduction = 2f;
generateEffect = Fx.redgeneratespark;
size = 2;
}};
turbineGenerator = new TurbineGenerator("turbine-generator"){{
powerProduction = 0.28f;
itemDuration = 30f;
consumes.liquid(Liquids.water, 0.05f);
size = 2;
}};
rtgGenerator = new DecayGenerator("rtg-generator"){{
size = 2;
powerProduction = 0.3f;
itemDuration = 220f;
}};
solarPanel = new SolarGenerator("solar-panel"){{
powerProduction = 0.0045f;
}};
largeSolarPanel = new SolarGenerator("solar-panel-large"){{
size = 3;
powerProduction = 0.055f;
}};
thoriumReactor = new NuclearReactor("thorium-reactor"){{
size = 3;
health = 700;
powerProduction = 1.1f;
}};
fusionReactor = new FusionReactor("fusion-reactor"){{
size = 4;
health = 600;
}};
battery = new Battery("battery"){{
consumes.powerBuffered(320f, 1f);
}};
batteryLarge = new Battery("battery-large"){{
size = 3;
consumes.powerBuffered(2000f, 1f);
}};
powerNode = new PowerNode("power-node"){{
maxNodes = 4;
laserRange = 6;
}};
powerNodeLarge = new PowerNode("power-node-large"){{
size = 2;
maxNodes = 6;
laserRange = 9.5f;
}};
}
}

View File

@ -1,112 +0,0 @@
package io.anuke.mindustry.content.blocks;
import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.production.Cultivator;
import io.anuke.mindustry.world.blocks.production.Drill;
import io.anuke.mindustry.world.blocks.production.Fracker;
import io.anuke.mindustry.world.blocks.production.SolidPump;
public class ProductionBlocks extends BlockList implements ContentList{
public static Block mechanicalDrill, pneumaticDrill, laserDrill, blastDrill, plasmaDrill, waterExtractor, oilExtractor, cultivator;
@Override
public void load(){
mechanicalDrill = new Drill("mechanical-drill"){{
tier = 2;
drillTime = 300;
size = 2;
drawMineItem = true;
}};
pneumaticDrill = new Drill("pneumatic-drill"){{
tier = 3;
drillTime = 240;
size = 2;
drawMineItem = true;
}};
laserDrill = new Drill("laser-drill"){{
drillTime = 140;
size = 2;
hasPower = true;
tier = 4;
updateEffect = Fx.pulverizeMedium;
drillEffect = Fx.mineBig;
consumes.power(0.11f);
}};
blastDrill = new Drill("blast-drill"){{
drillTime = 60;
size = 3;
drawRim = true;
hasPower = true;
tier = 5;
updateEffect = Fx.pulverizeRed;
updateEffectChance = 0.03f;
drillEffect = Fx.mineHuge;
rotateSpeed = 6f;
warmupSpeed = 0.01f;
consumes.power(0.3f);
}};
plasmaDrill = new Drill("plasma-drill"){{
heatColor = Color.valueOf("ff461b");
drillTime = 50;
size = 4;
hasLiquids = true;
hasPower = true;
tier = 5;
rotateSpeed = 9f;
drawRim = true;
updateEffect = Fx.pulverizeRedder;
updateEffectChance = 0.04f;
drillEffect = Fx.mineHuge;
warmupSpeed = 0.005f;
consumes.power(0.7f);
}};
waterExtractor = new SolidPump("water-extractor"){{
result = Liquids.water;
pumpAmount = 0.065f;
size = 2;
liquidCapacity = 30f;
rotateSpeed = 1.4f;
consumes.power(0.09f);
}};
oilExtractor = new Fracker("oil-extractor"){{
result = Liquids.oil;
updateEffect = Fx.pulverize;
liquidCapacity = 50f;
updateEffectChance = 0.05f;
pumpAmount = 0.09f;
size = 3;
liquidCapacity = 30f;
consumes.item(Items.sand);
consumes.power(0.3f);
consumes.liquid(Liquids.water, 0.15f);
}};
cultivator = new Cultivator("cultivator"){{
result = Items.biomatter;
drillTime = 200;
size = 2;
hasLiquids = true;
hasPower = true;
consumes.power(0.08f);
consumes.liquid(Liquids.water, 0.15f);
}};
}
}

View File

@ -1,33 +0,0 @@
package io.anuke.mindustry.content.blocks;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.storage.CoreBlock;
import io.anuke.mindustry.world.blocks.storage.SortedUnloader;
import io.anuke.mindustry.world.blocks.storage.Vault;
public class StorageBlocks extends BlockList implements ContentList{
public static Block core, vault, container, unloader;
@Override
public void load(){
core = new CoreBlock("core"){{
health = 1100;
itemCapacity = 3000;
}};
vault = new Vault("vault"){{
size = 3;
itemCapacity = 1000;
}};
container = new Vault("container"){{
size = 2;
itemCapacity = 300;
}};
unloader = new SortedUnloader("unloader"){{
speed = 7f;
}};
}
}

View File

@ -1,256 +0,0 @@
package io.anuke.mindustry.content.blocks;
import io.anuke.arc.graphics.Color;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.mindustry.content.Bullets;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.defense.turrets.*;
public class TurretBlocks extends BlockList implements ContentList{
public static Block duo, scorch, hail, wave, lancer, arc, swarmer, salvo,
fuse, ripple, cyclone, spectre, meltdown;
@Override
public void load(){
duo = new DoubleTurret("duo"){{
ammo(
Items.copper, Bullets.standardCopper,
Items.densealloy, Bullets.standardDense,
Items.pyratite, Bullets.standardIncendiary,
Items.silicon, Bullets.standardHoming
);
reload = 25f;
restitution = 0.03f;
range = 90f;
shootCone = 15f;
ammoUseEffect = Fx.shellEjectSmall;
health = 80;
inaccuracy = 2f;
rotatespeed = 10f;
}};
hail = new ArtilleryTurret("hail"){{
ammo(
Items.densealloy, Bullets.artilleryDense,
Items.silicon, Bullets.artilleryHoming,
Items.pyratite, Bullets.artlleryIncendiary
);
reload = 60f;
recoil = 2f;
range = 230f;
inaccuracy = 1f;
shootCone = 10f;
health = 120;
}};
scorch = new LiquidTurret("scorch"){{
ammo(Liquids.oil, Bullets.basicFlame);
recoil = 0f;
reload = 4f;
shootCone = 50f;
ammoUseEffect = Fx.shellEjectSmall;
health = 160;
}};
wave = new LiquidTurret("wave"){{
ammo(
Liquids.water, Bullets.waterShot,
Liquids.lava, Bullets.lavaShot,
Liquids.cryofluid, Bullets.cryoShot,
Liquids.oil, Bullets.oilShot
);
size = 2;
recoil = 0f;
reload = 4f;
inaccuracy = 5f;
shootCone = 50f;
shootEffect = Fx.shootLiquid;
range = 90f;
health = 360;
drawer = (tile, entity) -> {
Draw.rect(region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
Draw.color(entity.liquids.current().color);
Draw.alpha(entity.liquids.total() / liquidCapacity);
Draw.rect(name + "-liquid", tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
Draw.color();
};
}};
lancer = new ChargeTurret("lancer"){{
range = 90f;
chargeTime = 60f;
chargeMaxDelay = 30f;
chargeEffects = 7;
shootType = Bullets.lancerLaser;
recoil = 2f;
reload = 100f;
cooldown = 0.03f;
powerUsed = 1 / 3f;
consumes.powerBuffered(60f);
shootShake = 2f;
shootEffect = Fx.lancerLaserShoot;
smokeEffect = Fx.lancerLaserShootSmoke;
chargeEffect = Fx.lancerLaserCharge;
chargeBeginEffect = Fx.lancerLaserChargeBegin;
heatColor = Color.RED;
size = 2;
health = 320;
targetAir = false;
}};
arc = new PowerTurret("arc"){{
shootType = Bullets.arc;
reload = 85f;
shootShake = 1f;
shootCone = 40f;
rotatespeed = 8f;
powerUsed = 1f / 3f;
consumes.powerBuffered(30f);
range = 150f;
shootEffect = Fx.lightningShoot;
heatColor = Color.RED;
recoil = 1f;
size = 1;
}};
swarmer = new BurstTurret("swarmer"){{
ammo(
Items.blastCompound, Bullets.missileExplosive,
Items.pyratite, Bullets.missileIncendiary,
Items.surgealloy, Bullets.missileSurge
);
reload = 50f;
shots = 4;
burstSpacing = 5;
inaccuracy = 10f;
range = 140f;
xRand = 6f;
size = 2;
health = 380;
}};
salvo = new BurstTurret("salvo"){{
ammo(
Items.copper, Bullets.standardCopper,
Items.densealloy, Bullets.standardDense,
Items.pyratite, Bullets.standardIncendiary,
Items.silicon, Bullets.standardHoming,
Items.thorium, Bullets.standardThorium
);
size = 2;
range = 120f;
reload = 35f;
restitution = 0.03f;
ammoEjectBack = 3f;
cooldown = 0.03f;
recoil = 3f;
shootShake = 2f;
burstSpacing = 4;
shots = 3;
ammoUseEffect = Fx.shellEjectBig;
health = 360;
}};
ripple = new ArtilleryTurret("ripple"){{
ammo(
Items.densealloy, Bullets.artilleryDense,
Items.silicon, Bullets.artilleryHoming,
Items.pyratite, Bullets.artlleryIncendiary,
Items.blastCompound, Bullets.artilleryExplosive,
Items.plastanium, Bullets.arilleryPlastic
);
size = 3;
shots = 4;
inaccuracy = 12f;
reload = 60f;
ammoEjectBack = 5f;
ammoUseEffect = Fx.shellEjectBig;
cooldown = 0.03f;
velocityInaccuracy = 0.2f;
restitution = 0.02f;
recoil = 6f;
shootShake = 2f;
range = 320f;
health = 550;
}};
cyclone = new ItemTurret("cyclone"){{
ammo(
Items.blastCompound, Bullets.flakExplosive,
Items.plastanium, Bullets.flakPlastic,
Items.surgealloy, Bullets.flakSurge
);
xRand = 4f;
reload = 8f;
range = 145f;
size = 3;
recoil = 3f;
rotatespeed = 10f;
inaccuracy = 13f;
shootCone = 30f;
health = 145 * size * size;
}};
fuse = new ItemTurret("fuse"){{
ammo(Items.densealloy, Bullets.fuseShot);
reload = 50f;
shootShake = 4f;
range = 80f;
recoil = 5f;
restitution = 0.1f;
size = 3;
health = 155 * size * size;
}};
spectre = new DoubleTurret("spectre"){{
ammo(
Items.densealloy, Bullets.standardDenseBig,
Items.pyratite, Bullets.standardIncendiaryBig,
Items.thorium, Bullets.standardThoriumBig
);
reload = 6f;
coolantMultiplier = 0.5f;
maxCoolantUsed = 1.5f;
restitution = 0.1f;
ammoUseEffect = Fx.shellEjectBig;
range = 200f;
inaccuracy = 3f;
recoil = 3f;
xRand = 3f;
shotWidth = 4f;
shootShake = 2f;
shots = 2;
size = 4;
shootCone = 24f;
health = 155 * size * size;
}};
meltdown = new LaserTurret("meltdown"){{
shootType = Bullets.meltdownLaser;
shootEffect = Fx.shootBigSmoke2;
shootCone = 40f;
recoil = 4f;
size = 4;
shootShake = 2f;
powerUsed = 0.5f;
consumes.powerBuffered(120f);
range = 160f;
reload = 200f;
firingMoveFract = 0.1f;
shootDuration = 220f;
health = 165 * size * size;
}};
}
}

View File

@ -1,95 +0,0 @@
package io.anuke.mindustry.content.blocks;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.UnitTypes;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.type.ItemStack;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.units.*;
public class UnitBlocks extends BlockList implements ContentList{
public static Block
spiritFactory, phantomFactory,
wraithFactory, ghoulFactory, revenantFactory,
daggerFactory, titanFactory, fortressFactory,
reconstructor, repairPoint, commandCenter;
@Override
public void load(){
spiritFactory = new UnitFactory("spirit-factory"){{
type = UnitTypes.spirit;
produceTime = 5700;
size = 2;
consumes.power(0.08f);
consumes.items(new ItemStack(Items.silicon, 30), new ItemStack(Items.lead, 30));
}};
phantomFactory = new UnitFactory("phantom-factory"){{
type = UnitTypes.phantom;
produceTime = 7300;
size = 2;
consumes.power(0.2f);
consumes.items(new ItemStack(Items.silicon, 70), new ItemStack(Items.lead, 80), new ItemStack(Items.titanium, 80));
}};
wraithFactory = new UnitFactory("wraith-factory"){{
type = UnitTypes.wraith;
produceTime = 1800;
size = 2;
consumes.power(0.1f);
consumes.items(new ItemStack(Items.silicon, 10), new ItemStack(Items.titanium, 10));
}};
ghoulFactory = new UnitFactory("ghoul-factory"){{
type = UnitTypes.ghoul;
produceTime = 3600;
size = 3;
consumes.power(0.2f);
consumes.items(new ItemStack(Items.silicon, 30), new ItemStack(Items.titanium, 30), new ItemStack(Items.plastanium, 20));
}};
revenantFactory = new UnitFactory("revenant-factory"){{
type = UnitTypes.revenant;
produceTime = 8000;
size = 4;
consumes.power(0.3f);
consumes.items(new ItemStack(Items.silicon, 80), new ItemStack(Items.titanium, 80), new ItemStack(Items.plastanium, 50));
}};
daggerFactory = new UnitFactory("dagger-factory"){{
type = UnitTypes.dagger;
produceTime = 1700;
size = 2;
consumes.power(0.05f);
consumes.items(new ItemStack(Items.silicon, 10));
}};
titanFactory = new UnitFactory("titan-factory"){{
type = UnitTypes.titan;
produceTime = 3400;
size = 3;
consumes.power(0.15f);
consumes.items(new ItemStack(Items.silicon, 20), new ItemStack(Items.thorium, 30));
}};
fortressFactory = new UnitFactory("fortress-factory"){{
type = UnitTypes.fortress;
produceTime = 5000;
size = 3;
consumes.power(0.2f);
consumes.items(new ItemStack(Items.silicon, 40), new ItemStack(Items.thorium, 50));
}};
repairPoint = new RepairPoint("repair-point"){{
repairSpeed = 0.1f;
}};
reconstructor = new Reconstructor("reconstructor"){{
size = 2;
}};
commandCenter = new CommandCenter("command-center"){{
size = 2;
}};
}
}

View File

@ -1,61 +0,0 @@
package io.anuke.mindustry.content.blocks;
import io.anuke.mindustry.content.Mechs;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.units.MechPad;
public class UpgradeBlocks extends BlockList{
public static Block alphaPad, deltaPad, tauPad, omegaPad, dartPad, javelinPad, tridentPad, glaivePad;
@Override
public void load(){
alphaPad = new MechPad("alpha-mech-pad"){{
mech = Mechs.alpha;
size = 2;
consumes.powerBuffered(50f);
}};
deltaPad = new MechPad("delta-mech-pad"){{
mech = Mechs.delta;
size = 2;
consumes.powerBuffered(70f);
}};
tauPad = new MechPad("tau-mech-pad"){{
mech = Mechs.tau;
size = 2;
consumes.powerBuffered(100f);
}};
omegaPad = new MechPad("omega-mech-pad"){{
mech = Mechs.omega;
size = 3;
consumes.powerBuffered(120f);
}};
dartPad = new MechPad("dart-ship-pad"){{
mech = Mechs.dart;
size = 2;
consumes.powerBuffered(50f);
}};
javelinPad = new MechPad("javelin-ship-pad"){{
mech = Mechs.javelin;
size = 2;
consumes.powerBuffered(80f);
}};
tridentPad = new MechPad("trident-ship-pad"){{
mech = Mechs.trident;
size = 2;
consumes.powerBuffered(100f);
}};
glaivePad = new MechPad("glaive-ship-pad"){{
mech = Mechs.glaive;
size = 3;
consumes.powerBuffered(120f);
}};
}
}

View File

@ -6,7 +6,6 @@ import io.anuke.arc.collection.ObjectSet;
import io.anuke.arc.function.Consumer;
import io.anuke.arc.util.Log;
import io.anuke.mindustry.content.*;
import io.anuke.mindustry.content.blocks.*;
import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.bullet.Bullet;
import io.anuke.mindustry.entities.bullet.BulletType;
@ -65,18 +64,6 @@ public class ContentLoader{
//blocks
new Blocks(),
new DefenseBlocks(),
new DistributionBlocks(),
new ProductionBlocks(),
new TurretBlocks(),
new DebugBlocks(),
new LiquidBlocks(),
new StorageBlocks(),
new UnitBlocks(),
new PowerBlocks(),
new CraftingBlocks(),
new UpgradeBlocks(),
new OreBlocks(),
//not really a content class, but this makes initialization easier
new ColorMapper(),

View File

@ -22,7 +22,7 @@ import io.anuke.arc.util.Time;
import io.anuke.arc.util.io.ByteBufferOutput;
import io.anuke.arc.util.io.CountableByteArrayOutputStream;
import io.anuke.mindustry.content.Mechs;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.traits.BuilderTrait.BuildRequest;

View File

@ -15,7 +15,7 @@ import io.anuke.arc.util.Tmp;
import io.anuke.mindustry.ai.BlockIndexer;
import io.anuke.mindustry.ai.Pathfinder;
import io.anuke.mindustry.ai.WaveSpawner;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.game.EventType.TileChangeEvent;
import io.anuke.mindustry.game.EventType.WorldLoadEvent;

View File

@ -4,7 +4,7 @@ import io.anuke.arc.collection.IntArray;
import io.anuke.arc.function.IntPositionConsumer;
import io.anuke.arc.util.Pack;
import io.anuke.arc.util.Structs;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.maps.MapTileData;
import io.anuke.mindustry.maps.MapTileData.DataPosition;
import io.anuke.mindustry.maps.MapTileData.TileDataMarker;

View File

@ -5,7 +5,7 @@ import io.anuke.arc.math.Mathf;
import io.anuke.arc.util.Pack;
import io.anuke.arc.util.Structs;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.editor.DrawOperation.TileOperation;
import io.anuke.mindustry.game.Team;
import io.anuke.mindustry.maps.MapTileData;

View File

@ -18,7 +18,7 @@ import io.anuke.arc.scene.ui.layout.Unit;
import io.anuke.arc.scene.utils.UIUtils;
import io.anuke.arc.util.*;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.content.blocks.StorageBlocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.core.Platform;
import io.anuke.mindustry.game.Team;
import io.anuke.mindustry.io.MapIO;
@ -521,7 +521,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
for(Block block : Vars.content.blocks()){
TextureRegion[] regions = block.getCompactIcon();
if((block.synthetic() && (Recipe.getByResult(block) == null || !control.unlocks.isUnlocked(Recipe.getByResult(block))))
&& block != StorageBlocks.core){
&& block != Blocks.core){
continue;
}

View File

@ -15,7 +15,7 @@ import io.anuke.arc.math.geom.Geometry;
import io.anuke.arc.math.geom.Rectangle;
import io.anuke.arc.math.geom.Vector2;
import io.anuke.arc.util.Time;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.entities.traits.*;
import io.anuke.mindustry.game.Team;
import io.anuke.mindustry.game.Teams.TeamData;

View File

@ -19,7 +19,7 @@ import io.anuke.arc.util.Time;
import io.anuke.arc.util.pooling.Pool.Poolable;
import io.anuke.arc.util.pooling.Pools;
import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.content.Bullets;
import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.Units;

View File

@ -15,7 +15,7 @@ import io.anuke.arc.math.Mathf;
import io.anuke.arc.math.geom.Vector2;
import io.anuke.arc.util.Time;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.TileEntity;

View File

@ -6,7 +6,7 @@ import io.anuke.arc.entities.EntityGroup;
import io.anuke.arc.math.Mathf;
import io.anuke.arc.math.geom.Geometry;
import io.anuke.arc.util.Structs;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.Units;

View File

@ -1,12 +1,7 @@
package io.anuke.mindustry.game;
import io.anuke.mindustry.type.ContentType;
/**Interface for a list of content to be loaded in {@link io.anuke.mindustry.core.ContentLoader}.*/
public interface ContentList{
/**This method should create all the content.*/
void load();
/**This method should return the type of content being loaded.*/
ContentType type();
}

View File

@ -8,7 +8,7 @@ import io.anuke.arc.graphics.Color;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.glutils.FrameBuffer;
import io.anuke.arc.util.Tmp;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.game.EventType.TileChangeEvent;
import io.anuke.mindustry.game.EventType.WorldLoadEvent;
import io.anuke.mindustry.game.Team;

View File

@ -9,7 +9,7 @@ import io.anuke.arc.math.geom.Rectangle;
import io.anuke.arc.math.geom.Vector2;
import io.anuke.arc.util.Time;
import io.anuke.arc.util.Tmp;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.game.Team;
import io.anuke.mindustry.input.InputHandler;

View File

@ -7,7 +7,7 @@ import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.Lines;
import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.arc.math.Mathf;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.graphics.Palette;

View File

@ -11,7 +11,7 @@ import io.anuke.arc.math.Mathf;
import io.anuke.arc.math.geom.Vector2;
import io.anuke.arc.scene.ui.layout.Table;
import io.anuke.arc.util.Time;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.effect.ItemTransfer;

View File

@ -18,7 +18,7 @@ import io.anuke.arc.math.geom.Vector2;
import io.anuke.arc.scene.ui.layout.Table;
import io.anuke.arc.util.Align;
import io.anuke.arc.util.Time;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.entities.Player;

View File

@ -8,8 +8,7 @@ import io.anuke.arc.graphics.Pixmap;
import io.anuke.arc.graphics.Pixmap.Format;
import io.anuke.arc.util.Pack;
import io.anuke.arc.util.Structs;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.blocks.StorageBlocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.game.Team;
import io.anuke.mindustry.maps.Map;
import io.anuke.mindustry.maps.MapMeta;
@ -96,7 +95,7 @@ public class MapIO{
}
}
data.write(x, y, DataPosition.wall, StorageBlocks.core.id);
data.write(x, y, DataPosition.wall, Blocks.core.id);
data.write(x, y, DataPosition.rotationTeam, Pack.byteByte((byte)0, (byte)Team.blue.ordinal()));
}
}

View File

@ -5,8 +5,7 @@ import io.anuke.arc.entities.Entities;
import io.anuke.arc.entities.EntityGroup;
import io.anuke.arc.entities.trait.Entity;
import io.anuke.arc.util.Pack;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.blocks.StorageBlocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.entities.traits.SaveTrait;
import io.anuke.mindustry.entities.traits.TypeTrait;
import io.anuke.mindustry.game.Content;
@ -134,7 +133,7 @@ public abstract class SaveFileVersion{
tile.entity.readConfig(stream);
tile.entity.read(stream);
if(tile.block() == StorageBlocks.core){
if(tile.block() == Blocks.core){
state.teams.get(t).cores.add(tile);
}
}else if(wallid == 0){

View File

@ -4,7 +4,7 @@ import io.anuke.arc.collection.IntIntMap;
import io.anuke.arc.util.Pack;
import io.anuke.arc.util.Structs;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.world.Block;
import java.nio.ByteBuffer;

View File

@ -2,14 +2,7 @@ package io.anuke.mindustry.maps;
import io.anuke.arc.collection.Array;
import io.anuke.arc.collection.GridMap;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.content.Mechs;
import io.anuke.mindustry.content.UnitTypes;
import io.anuke.mindustry.content.blocks.CraftingBlocks;
import io.anuke.mindustry.content.blocks.ProductionBlocks;
import io.anuke.mindustry.content.blocks.UnitBlocks;
import io.anuke.mindustry.content.blocks.UpgradeBlocks;
import io.anuke.mindustry.content.*;
import io.anuke.mindustry.entities.units.UnitCommand;
import io.anuke.mindustry.maps.missions.*;
import io.anuke.mindustry.type.Item;
@ -30,9 +23,9 @@ public class SectorPresets{
//command center mission
add(new SectorPreset(0, 1,
Array.ofRecursive(
Missions.blockRecipe(UnitBlocks.daggerFactory),
Missions.blockRecipe(Blocks.daggerFactory),
new UnitMission(UnitTypes.dagger),
Missions.blockRecipe(UnitBlocks.commandCenter),
Missions.blockRecipe(Blocks.commandCenter),
new CommandMission(UnitCommand.retreat),
new CommandMission(UnitCommand.attack),
new BattleMission()
@ -42,7 +35,7 @@ public class SectorPresets{
//pad mission
add(new SectorPreset(0, -2,
Array.ofRecursive(
Missions.blockRecipe(mobile ? UpgradeBlocks.alphaPad : UpgradeBlocks.dartPad),
Missions.blockRecipe(mobile ? Blocks.alphaPad : Blocks.dartPad),
new MechMission(mobile ? Mechs.alpha : Mechs.dart),
new WaveMission(15)
),
@ -51,10 +44,10 @@ public class SectorPresets{
//oil mission
add(new SectorPreset(-2, 0,
Array.ofRecursive(
Missions.blockRecipe(ProductionBlocks.cultivator),
Missions.blockRecipe(ProductionBlocks.waterExtractor),
Missions.blockRecipe(Blocks.cultivator),
Missions.blockRecipe(Blocks.waterExtractor),
new ContentMission(Items.biomatter),
Missions.blockRecipe(CraftingBlocks.biomatterCompressor),
Missions.blockRecipe(Blocks.biomatterCompressor),
new ContentMission(Liquids.oil),
new BattleMission()
),

View File

@ -1,11 +1,8 @@
package io.anuke.mindustry.maps;
import io.anuke.arc.collection.Array;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.blocks.CraftingBlocks;
import io.anuke.mindustry.content.blocks.ProductionBlocks;
import io.anuke.mindustry.content.blocks.StorageBlocks;
import io.anuke.mindustry.content.blocks.UnitBlocks;
import io.anuke.mindustry.maps.missions.BlockMission;
import io.anuke.mindustry.maps.missions.ItemMission;
import io.anuke.mindustry.maps.missions.Mission;
@ -92,12 +89,12 @@ public class TutorialSector{
//intentionally unlocalized
new ItemMission(Items.copper, 50).setMessage("An updated tutorial will return next build.\nFor now, you'll have to deal with... this."),
new BlockMission(ProductionBlocks.mechanicalDrill),
new BlockMission(Blocks.mechanicalDrill),
new ItemMission(Items.copper, 100),
new ItemMission(Items.lead, 50),
new BlockMission(CraftingBlocks.smelter),
new BlockMission(Blocks.smelter),
new ItemMission(Items.densealloy, 10),
new WaveMission(5)
);
@ -109,9 +106,9 @@ public class TutorialSector{
private static void generateBase(){
int x = sectorSize - 50, y = sectorSize - 50;
world.setBlock(world.tile(x, y), StorageBlocks.core, waveTeam);
world.setBlock(world.tile(x - 1, y + 2), UnitBlocks.daggerFactory, waveTeam);
world.setBlock(world.tile(x - 1, y - 3), UnitBlocks.daggerFactory, waveTeam);
world.setBlock(world.tile(x, y), Blocks.core, waveTeam);
world.setBlock(world.tile(x - 1, y + 2), Blocks.daggerFactory, waveTeam);
world.setBlock(world.tile(x - 1, y - 3), Blocks.daggerFactory, waveTeam);
//since placed() is not called here, add core manually
state.teams.get(waveTeam).cores.add(world.tile(x, y));

View File

@ -9,9 +9,9 @@ import io.anuke.arc.function.TriFunction;
import io.anuke.arc.math.Mathf;
import io.anuke.arc.math.geom.Geometry;
import io.anuke.arc.math.geom.Point2;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.content.blocks.*;
import io.anuke.mindustry.game.Team;
import io.anuke.mindustry.type.Recipe;
import io.anuke.mindustry.world.Block;
@ -54,7 +54,7 @@ public class FortressGenerator{
}
void gen(){
gen.setBlock(enemyX, enemyY, StorageBlocks.core, team);
gen.setBlock(enemyX, enemyY, Blocks.core, team);
gen.random.nextBoolean();
float difficultyScl = Mathf.clamp(gen.sector.difficulty / 20f + gen.random.range(0.25f), 0f, 0.9999f);
@ -109,25 +109,25 @@ public class FortressGenerator{
Array<IntPositionConsumer> passes = Array.with(
//initial seeding solar panels
placer.get(PowerBlocks.largeSolarPanel, 0.001f),
placer.get(Blocks.largeSolarPanel, 0.001f),
//extra seeding
seeder.get(PowerBlocks.solarPanel, tile -> tile.block() == PowerBlocks.largeSolarPanel && gen.random.chance(0.3)),
seeder.get(Blocks.solarPanel, tile -> tile.block() == Blocks.largeSolarPanel && gen.random.chance(0.3)),
//coal gens
seeder.get(PowerBlocks.combustionGenerator, tile -> tile.block() instanceof SolarGenerator && gen.random.chance(0.2)),
seeder.get(Blocks.combustionGenerator, tile -> tile.block() instanceof SolarGenerator && gen.random.chance(0.2)),
//water extractors
seeder.get(ProductionBlocks.waterExtractor, tile -> tile.block() instanceof NuclearReactor && gen.random.chance(0.5)),
seeder.get(Blocks.waterExtractor, tile -> tile.block() instanceof NuclearReactor && gen.random.chance(0.5)),
//mend projectors
seeder.get(DefenseBlocks.mendProjector, tile -> tile.block() instanceof PowerGenerator && gen.random.chance(0.04)),
seeder.get(Blocks.mendProjector, tile -> tile.block() instanceof PowerGenerator && gen.random.chance(0.04)),
//power turrets
seeder.get(powerTurret, tile -> tile.block() instanceof PowerGenerator && gen.random.chance(0.04)),
//repair point
seeder.get(UnitBlocks.repairPoint, tile -> tile.block() instanceof PowerGenerator && gen.random.chance(0.1)),
seeder.get(Blocks.repairPoint, tile -> tile.block() instanceof PowerGenerator && gen.random.chance(0.1)),
//turrets1
seeder.get(turret1, tile -> tile.block() instanceof PowerBlock && gen.random.chance(0.22 - turret1.size*0.02)),
@ -136,22 +136,22 @@ public class FortressGenerator{
seeder.get(turret2, tile -> tile.block() instanceof PowerBlock && gen.random.chance(0.12 - turret2.size*0.02)),
//shields
seeder.get(DefenseBlocks.forceProjector, tile -> (tile.block() instanceof CoreBlock || tile.block() instanceof UnitFactory) && gen.random.chance(0.2 * dscl2)),
seeder.get(Blocks.forceProjector, tile -> (tile.block() instanceof CoreBlock || tile.block() instanceof UnitFactory) && gen.random.chance(0.2 * dscl2)),
//unit pads (assorted)
seeder.get(UnitBlocks.daggerFactory, tile -> (tile.block() instanceof MendProjector || tile.block() instanceof ForceProjector) && gen.random.chance(0.3 * dscl2)),
seeder.get(Blocks.daggerFactory, tile -> (tile.block() instanceof MendProjector || tile.block() instanceof ForceProjector) && gen.random.chance(0.3 * dscl2)),
//unit pads (assorted)
seeder.get(UnitBlocks.wraithFactory, tile -> (tile.block() instanceof MendProjector || tile.block() instanceof ForceProjector) && gen.random.chance(0.3 * dscl2)),
seeder.get(Blocks.wraithFactory, tile -> (tile.block() instanceof MendProjector || tile.block() instanceof ForceProjector) && gen.random.chance(0.3 * dscl2)),
//unit pads (assorted)
seeder.get(UnitBlocks.titanFactory, tile -> (tile.block() instanceof MendProjector || tile.block() instanceof ForceProjector) && gen.random.chance(0.23 * dscl2)),
seeder.get(Blocks.titanFactory, tile -> (tile.block() instanceof MendProjector || tile.block() instanceof ForceProjector) && gen.random.chance(0.23 * dscl2)),
//unit pads (assorted)
seeder.get(UnitBlocks.ghoulFactory, tile -> (tile.block() instanceof MendProjector || tile.block() instanceof ForceProjector) && gen.random.chance(0.23 * dscl2)),
seeder.get(Blocks.ghoulFactory, tile -> (tile.block() instanceof MendProjector || tile.block() instanceof ForceProjector) && gen.random.chance(0.23 * dscl2)),
//vaults
seeder.get(StorageBlocks.vault, tile -> (tile.block() instanceof CoreBlock || tile.block() instanceof ForceProjector) && gen.random.chance(0.4)),
seeder.get(Blocks.vault, tile -> (tile.block() instanceof CoreBlock || tile.block() instanceof ForceProjector) && gen.random.chance(0.4)),
//big turrets
seeder.get(bigTurret, tile -> tile.block() instanceof StorageBlock && gen.random.chance(0.65)),
@ -173,7 +173,7 @@ public class FortressGenerator{
},
//mines
placer.get(DefenseBlocks.shockMine, 0.02f * difficultyScl),
placer.get(Blocks.shockMine, 0.02f * difficultyScl),
//fill up turrets w/ ammo
(x, y) -> {

View File

@ -11,9 +11,7 @@ import io.anuke.arc.util.Structs;
import io.anuke.arc.util.noise.RidgedPerlin;
import io.anuke.arc.util.noise.Simplex;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.blocks.OreBlocks;
import io.anuke.mindustry.content.blocks.StorageBlocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.game.Team;
import io.anuke.mindustry.maps.Map;
import io.anuke.mindustry.maps.MapTileData;
@ -191,10 +189,10 @@ public class WorldGenerator{
}
}
world.setBlock(tiles[spawns.get(0).x][spawns.get(0).y], StorageBlocks.core, Team.blue);
world.setBlock(tiles[spawns.get(0).x][spawns.get(0).y], Blocks.core, Team.blue);
if(state.mode.isPvp){
world.setBlock(tiles[spawns.get(1).x][spawns.get(1).y], StorageBlocks.core, Team.red);
world.setBlock(tiles[spawns.get(1).x][spawns.get(1).y], Blocks.core, Team.red);
}
world.endMapLoad();
@ -237,7 +235,7 @@ public class WorldGenerator{
if(entry.noise.octaveNoise2D(1, 0.7, 1f / (4 + i * 2), x, y) / 4f +
Math.abs(0.5f - entry.noise.octaveNoise2D(2, 0.7, 1f / (50 + i * 2), x, y)) > 0.48f &&
Math.abs(0.5f - entry.noise.octaveNoise2D(1, 1, 1f / (55 + i * 4), x, y)) > 0.22f){
tile.setFloor((Floor) OreBlocks.get(tile.floor(), entry.item));
tile.setFloor((Floor) OreBlock.get(tile.floor(), entry.item));
break;
}
}
@ -393,7 +391,7 @@ public class WorldGenerator{
Item entry = ores.get(i);
if(Math.abs(0.5f - sim.octaveNoise2D(2, 0.7, 1f / (50 + i * 2), offsetX, offsetY)) > 0.23f &&
Math.abs(0.5f - sim2.octaveNoise2D(1, 1, 1f / (40 + i * 4), offsetX, offsetY)) > 0.32f){
floor = OreBlocks.get(floor, entry);
floor = OreBlock.get(floor, entry);
break;
}
}

View File

@ -2,7 +2,7 @@ package io.anuke.mindustry.maps.missions;
import io.anuke.arc.math.geom.Point2;
import io.anuke.arc.collection.Array;
import io.anuke.mindustry.content.blocks.StorageBlocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.game.Team;
import io.anuke.mindustry.maps.generation.Generation;
import io.anuke.mindustry.world.Tile;
@ -39,7 +39,7 @@ public abstract class MissionWithStartingCore extends Mission{
}
Tile startingCoreTile = gen.tiles[spawnPoints.first().x][spawnPoints.first().y];
startingCoreTile.setBlock(StorageBlocks.core);
startingCoreTile.setBlock(Blocks.core);
startingCoreTile.setTeam(team);
state.teams.get(team).cores.add(startingCoreTile);

View File

@ -6,7 +6,7 @@ import io.anuke.arc.collection.ObjectMap.Entry;
import io.anuke.arc.entities.Entities;
import io.anuke.arc.util.Pack;
import io.anuke.arc.util.Time;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.game.GameMode;
import io.anuke.mindustry.game.Team;

View File

@ -8,7 +8,7 @@ import io.anuke.arc.scene.Group;
import io.anuke.arc.scene.actions.Actions;
import io.anuke.arc.scene.ui.layout.Table;
import io.anuke.arc.util.Align;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.input.InputHandler;
import io.anuke.mindustry.world.Block;

View File

@ -6,7 +6,7 @@ import io.anuke.arc.math.Mathf;
import io.anuke.arc.math.geom.Geometry;
import io.anuke.arc.math.geom.Point2;
import io.anuke.arc.math.geom.Rectangle;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.entities.Units;
import io.anuke.mindustry.game.EventType.BlockBuildBeginEvent;
import io.anuke.mindustry.game.Team;

View File

@ -5,7 +5,6 @@ import io.anuke.arc.collection.ObjectIntMap;
import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.game.Team;
import io.anuke.mindustry.type.ContentType;
import static io.anuke.mindustry.Vars.content;
@ -49,9 +48,4 @@ public class ColorMapper implements ContentList{
colorMap.put(block, color);
}
}
@Override
public ContentType type(){
return ContentType.block;
}
}

View File

@ -2,12 +2,11 @@ package io.anuke.mindustry.world;
import io.anuke.arc.collection.IntMap;
import io.anuke.arc.graphics.Color;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.blocks.OreBlocks;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.type.ContentType;
import io.anuke.mindustry.world.blocks.Floor;
import io.anuke.mindustry.world.blocks.OreBlock;
public class LegacyColorMapper implements ContentList{
private static IntMap<LegacyBlock> blockMap = new IntMap<>();
@ -39,15 +38,10 @@ public class LegacyColorMapper implements ContentList{
map("6e501e", Blocks.dirt, 0);
map("ed5334", Blocks.lava, 0);
map("292929", Blocks.tar, 0);
map("c3a490", OreBlocks.get(Blocks.stone, Items.copper), 0);
map("161616", OreBlocks.get(Blocks.stone, Items.coal), 0);
map("6277bc", OreBlocks.get(Blocks.stone, Items.titanium), 0);
map("83bc58", OreBlocks.get(Blocks.stone, Items.thorium), 0);
}
@Override
public ContentType type(){
return ContentType.block;
map("c3a490", OreBlock.get(Blocks.stone, Items.copper), 0);
map("161616", OreBlock.get(Blocks.stone, Items.coal), 0);
map("6277bc", OreBlock.get(Blocks.stone, Items.titanium), 0);
map("83bc58", OreBlock.get(Blocks.stone, Items.thorium), 0);
}
private void map(String color, Block block, int elevation){

View File

@ -7,7 +7,7 @@ import io.anuke.arc.math.geom.Point2;
import io.anuke.arc.math.geom.Position;
import io.anuke.arc.math.geom.Vector2;
import io.anuke.arc.util.Pack;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.traits.TargetTrait;
import io.anuke.mindustry.game.Team;

View File

@ -1,13 +1,17 @@
package io.anuke.mindustry.world.blocks;
import io.anuke.arc.collection.ObjectMap;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.arc.math.Mathf;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.type.ItemStack;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.math.Mathf;
public class OreBlock extends Floor{
private static final ObjectMap<Item, ObjectMap<Block, Block>> oreBlockMap = new ObjectMap<>();
public Floor base;
public OreBlock(Item ore, Floor base){
@ -18,6 +22,8 @@ public class OreBlock extends Floor{
this.variants = 3;
this.minimapColor = ore.color;
this.edge = base.name;
oreBlockMap.getOr(ore, ObjectMap::new).put(base, this);
}
@Override
@ -47,4 +53,10 @@ public class OreBlock extends Floor{
base.drawEdges(tile, true);
}
public static Block get(Block floor, Item item){
if(!oreBlockMap.containsKey(item)) throw new IllegalArgumentException("Item '" + item + "' is not an ore!");
if(!oreBlockMap.get(item).containsKey(floor))
throw new IllegalArgumentException("Block '" + floor.name + "' does not support ores!");
return oreBlockMap.get(item).get(floor);
}
}

View File

@ -9,7 +9,7 @@ import io.anuke.arc.math.Mathf;
import io.anuke.arc.math.RandomXS128;
import io.anuke.arc.util.Time;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.type.Item;

View File

@ -0,0 +1,34 @@
package io.anuke.mindustry.world.blocks.sandbox;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.distribution.Sorter.SorterEntity;
public class ItemSource extends Block{
public ItemSource(String name){
super(name);
hasItems = true;
}
@Override
public boolean outputsItems(){
return true;
}
@Override
public void update(Tile tile){
SorterEntity entity = tile.entity();
if(entity.sortItem == null) return;
entity.items.set(entity.sortItem, 1);
tryDump(tile, entity.sortItem);
entity.items.set(entity.sortItem, 0);
}
@Override
public boolean acceptItem(Item item, Tile tile, Tile source){
return false;
}
}

View File

@ -0,0 +1,21 @@
package io.anuke.mindustry.world.blocks.sandbox;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
public class ItemVoid extends Block{
public ItemVoid(String name){
super(name);
update = solid = true;
}
@Override
public void handleItem(Item item, Tile tile, Tile source){}
@Override
public boolean acceptItem(Item item, Tile tile, Tile source){
return true;
}
}

View File

@ -0,0 +1,105 @@
package io.anuke.mindustry.world.blocks.sandbox;
import io.anuke.annotations.Annotations.Loc;
import io.anuke.annotations.Annotations.Remote;
import io.anuke.arc.collection.Array;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.scene.ui.ButtonGroup;
import io.anuke.arc.scene.ui.ImageButton;
import io.anuke.arc.scene.ui.layout.Table;
import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.type.Liquid;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.gen.Call;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import static io.anuke.mindustry.Vars.content;
import static io.anuke.mindustry.Vars.control;
public class LiquidSource extends Block{
public LiquidSource(String name){
super(name);
update = true;
solid = true;
hasLiquids = true;
liquidCapacity = 100f;
configurable = true;
outputsLiquid = true;
}
@Override
public void update(Tile tile){
LiquidSourceEntity entity = tile.entity();
tile.entity.liquids.add(entity.source, liquidCapacity);
tryDumpLiquid(tile, entity.source);
}
@Override
public void draw(Tile tile){
super.draw(tile);
LiquidSourceEntity entity = tile.entity();
Draw.color(entity.source.color);
Draw.rect("blank", tile.worldx(), tile.worldy(), 4f, 4f);
Draw.color();
}
@Override
public void buildTable(Tile tile, Table table){
LiquidSourceEntity entity = tile.entity();
Array<Liquid> items = content.liquids();
ButtonGroup<ImageButton> group = new ButtonGroup<>();
Table cont = new Table();
for(int i = 0; i < items.size; i++){
if(!control.unlocks.isUnlocked(items.get(i))) continue;
final int f = i;
ImageButton button = cont.addImageButton("liquid-icon-" + items.get(i).name, "clear-toggle", 24,
() -> Call.setLiquidSourceLiquid(null, tile, items.get(f))).size(38).group(group).get();
button.setChecked(entity.source.id == f);
if(i % 4 == 3){
cont.row();
}
}
table.add(cont);
}
@Override
public TileEntity newEntity(){
return new LiquidSourceEntity();
}
@Remote(targets = Loc.both, called = Loc.both, forward = true)
public static void setLiquidSourceLiquid(Player player, Tile tile, Liquid liquid){
LiquidSourceEntity entity = tile.entity();
entity.source = liquid;
}
class LiquidSourceEntity extends TileEntity{
public Liquid source = Liquids.water;
@Override
public void writeConfig(DataOutput stream) throws IOException{
stream.writeByte(source.id);
}
@Override
public void readConfig(DataInput stream) throws IOException{
source = content.liquid(stream.readByte());
}
}
}

View File

@ -0,0 +1,20 @@
package io.anuke.mindustry.world.blocks.sandbox;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.power.PowerNode;
public class PowerSource extends PowerNode{
public PowerSource(String name){
super(name);
maxNodes = 100;
outputsPower = true;
consumesPower = false;
}
@Override
public float getPowerProduction(Tile tile){
return 10000f;
}
}

View File

@ -0,0 +1,18 @@
package io.anuke.mindustry.world.blocks.sandbox;
import io.anuke.mindustry.world.blocks.PowerBlock;
import io.anuke.mindustry.world.meta.BlockStat;
public class PowerVoid extends PowerBlock{
public PowerVoid(String name){
super(name);
consumes.power(Float.MAX_VALUE);
}
@Override
public void init(){
super.init();
stats.remove(BlockStat.powerUse);
}
}

View File

@ -5,9 +5,9 @@ import io.anuke.arc.math.geom.Point2;
import io.anuke.arc.util.Log;
import io.anuke.arc.util.Time;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.UnitTypes;
import io.anuke.mindustry.content.blocks.*;
import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.core.Logic;
import io.anuke.mindustry.core.NetServer;
@ -142,12 +142,12 @@ public class ApplicationTests{
createMap();
int bx = 4;
int by = 4;
world.setBlock(world.tile(bx, by), StorageBlocks.core, Team.blue);
world.setBlock(world.tile(bx, by), Blocks.core, Team.blue);
assertEquals(world.tile(bx, by).getTeam(), Team.blue);
for(int x = bx-1; x <= bx + 1; x++){
for(int y = by-1; y <= by + 1; y++){
if(x == bx && by == y){
assertEquals(world.tile(x, y).block(), StorageBlocks.core);
assertEquals(world.tile(x, y).block(), Blocks.core);
}else{
assertTrue(world.tile(x, y).block() == Blocks.blockpart && world.tile(x, y).getLinked() == world.tile(bx, by));
}
@ -204,9 +204,9 @@ public class ApplicationTests{
@Test
void inventoryDeposit(){
depositTest(CraftingBlocks.smelter, Items.copper);
depositTest(StorageBlocks.vault, Items.copper);
depositTest(PowerBlocks.thoriumReactor, Items.thorium);
depositTest(Blocks.smelter, Items.copper);
depositTest(Blocks.vault, Items.copper);
depositTest(Blocks.thoriumReactor, Items.thorium);
}
@Test
@ -231,14 +231,14 @@ public class ApplicationTests{
d1.set(10f, 20f);
d2.set(10f, 20f);
d1.addBuildRequest(new BuildRequest(0, 0, 0, Recipe.getByResult(DefenseBlocks.copperWallLarge)));
d2.addBuildRequest(new BuildRequest(1, 1, 0, Recipe.getByResult(DefenseBlocks.copperWallLarge)));
d1.addBuildRequest(new BuildRequest(0, 0, 0, Recipe.getByResult(Blocks.copperWallLarge)));
d2.addBuildRequest(new BuildRequest(1, 1, 0, Recipe.getByResult(Blocks.copperWallLarge)));
Time.setDeltaProvider(() -> 9999999f);
d1.updateBuilding(d1);
d2.updateBuilding(d2);
assertEquals(DefenseBlocks.copperWallLarge, world.tile(0, 0).block());
assertEquals(Blocks.copperWallLarge, world.tile(0, 0).block());
assertEquals(Blocks.air, world.tile(2, 2).block());
assertEquals(Blocks.blockpart, world.tile(1, 1).block());
}
@ -253,7 +253,7 @@ public class ApplicationTests{
d1.set(10f, 20f);
d2.set(10f, 20f);
d1.addBuildRequest(new BuildRequest(0, 0, 0, Recipe.getByResult(DefenseBlocks.copperWallLarge)));
d1.addBuildRequest(new BuildRequest(0, 0, 0, Recipe.getByResult(Blocks.copperWallLarge)));
d2.addBuildRequest(new BuildRequest(1, 1));
Time.setDeltaProvider(() -> 3f);
@ -277,7 +277,7 @@ public class ApplicationTests{
createMap();
Tile core = world.tile(5, 5);
world.setBlock(core, StorageBlocks.core, Team.blue);
world.setBlock(core, Blocks.core, Team.blue);
for(Item item : content.items()){
core.entity.items.set(item, 3000);
}

View File

@ -3,7 +3,7 @@ package power;
import io.anuke.arc.math.Mathf;
import io.anuke.arc.util.Time;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.core.ContentLoader;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;