Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .aiignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
run/
build/
.gradle/
assets/
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## 0.0.9

* Created new GeckoLib texture for server rack
* Created new texture for the server (2U)
* Rewrote server rack logic
* Created server item
* Moved processor unit into server item
* Allowed server racks to accept servers
* Updated server rack UI texture
* Render servers inside the server racks
* Add server recipe
* Fix computer so it produces cycles again but accepting only processor units
* Added tooltip to server to show how many and which CPUs it has
* Fix shift click stack upgrade into compiler
* Added creative battery with infinite energy and INT max capacity
* Creative battery now automatically pushes energy to adjacent blocks

## 0.0.8

* Fixed a crash when GuideMe is not installed
Expand Down
11 changes: 4 additions & 7 deletions CREDITS.MD
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Datacenter and server ambience sounds

## Sound Effect

*
by [freesound_community](https://pixabay.com/users/freesound_community-46691455/?utm_source=link-attribution&utm_medium=referral&utm_campaign=music&utm_content=31360)
from [Pixabay](https://pixabay.com)
* Sound Effect
by [freesound_community](https://pixabay.com/users/freesound_community-46691455/?utm_source=link-attribution&utm_medium=referral&utm_campaign=music&utm_content=31360)
from [Pixabay](https://pixabay.com)
* Video trailer for the mod by [lammycz](https://www.fiverr.com/lammycz)
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ dependencies {
//localRuntime "curse.maven:powah-633483:6830067"

// Pipez
//localRuntime "curse.maven:pipez-443900:5609056"
localRuntime "curse.maven:pipez-443900:5609056"

// Mekanism, Mekanism generators
//localRuntime "curse.maven:mekanism-268560:7132168"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ mod_name=LogiCore
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=MIT
# The mod version. See https://semver.org/
mod_version=0.0.8
mod_version=0.0.9
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "logicore:block/creative_battery"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"parent": "logicore:block/server_rack"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"logicore:small_battery",
"logicore:medium_battery",
"logicore:large_battery",
"logicore:creative_battery",
"logicore:research_station",
"logicore:repair_station",
"logicore:recycler"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"logicore:small_battery",
"logicore:medium_battery",
"logicore:large_battery",
"logicore:creative_battery",
"logicore:research_station",
"logicore:repair_station",
"logicore:recycler"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"logicore:small_battery",
"logicore:medium_battery",
"logicore:large_battery",
"logicore:creative_battery",
"logicore:research_station",
"logicore:repair_station",
"logicore:recycler"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_processor": {
"conditions": {
"items": [
{
"items": "logicore:processor_unit_basic"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "logicore:server"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_processor"
]
],
"rewards": {
"recipes": [
"logicore:server"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "logicore:creative_battery"
}
],
"rolls": 1.0
}
],
"random_sequence": "logicore:blocks/creative_battery"
}
30 changes: 30 additions & 0 deletions src/generated/resources/data/logicore/recipe/server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"type": "minecraft:crafting_shaped",
"category": "redstone",
"key": {
"G": {
"item": "minecraft:gold_ingot"
},
"I": {
"item": "minecraft:iron_ingot"
},
"P": {
"item": "logicore:processor_unit_basic"
},
"Q": {
"tag": "c:gems/quartz"
},
"R": {
"tag": "c:dusts/redstone"
}
},
"pattern": [
"IRI",
"QPQ",
"GRG"
],
"result": {
"count": 1,
"id": "logicore:server"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"logicore:research_station",
"logicore:small_battery",
"logicore:medium_battery",
"logicore:large_battery"
"logicore:large_battery",
"logicore:creative_battery"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"logicore:small_battery",
"logicore:medium_battery",
"logicore:large_battery",
"logicore:creative_battery",
"logicore:server_rack",
"logicore:computer",
"logicore:data_cable",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"logicore:small_battery",
"logicore:medium_battery",
"logicore:large_battery",
"logicore:creative_battery",
"logicore:research_station",
"logicore:repair_station",
"logicore:recycler"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"logicore:small_battery",
"logicore:medium_battery",
"logicore:large_battery",
"logicore:creative_battery",
"logicore:research_station",
"logicore:repair_station",
"logicore:recycler"
Expand Down
19 changes: 16 additions & 3 deletions src/main/java/dev/gacbl/logicore/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ public class Config {
public static final ModConfigSpec.ConfigValue<Integer> MEDIUM_BATTERY_TRANSFER_RATE;
public static final ModConfigSpec.ConfigValue<Integer> LARGE_BATTERY_CAPACITY;
public static final ModConfigSpec.ConfigValue<Integer> LARGE_BATTERY_TRANSFER_RATE;
public static final ModConfigSpec.ConfigValue<Integer> CREATIVE_BATTERY_CAPACITY;
public static final ModConfigSpec.ConfigValue<Integer> CREATIVE_BATTERY_TRANSFER_RATE;

// Processor Units
public static final ModConfigSpec.ConfigValue<Long> BASIC_CPU_RATE;
Expand Down Expand Up @@ -110,11 +112,11 @@ public class Config {

SERVER_RACK_CYCLE_CAPACITY = BUILDER
.comment(" How many cycles can be stored in the server rack")
.defineInRange("cycle_capacity", 1_000_000, 1, 1_000_000_000);
.defineInRange("cycle_capacity", 10_000_000, 1, 1_000_000_000);

SERVER_RACK_FE_CAPACITY = BUILDER
.comment(" How much FE can be stored in the server rack")
.defineInRange("fe_capacity", 100_000, 1, 1_000_000);
.defineInRange("fe_capacity", 10_000_000, 1, 1_000_000_000);

SERVER_RACK_DATACENTER_BOOST = BUILDER
.comment(" How much of a boost in cycle production the server rack gets from being in datacenter")
Expand Down Expand Up @@ -177,7 +179,7 @@ public class Config {
BUILDER.push("Cloud interface");
CI_MAX_TRANSFER_RATE = BUILDER
.comment(" How many cycles per tick are transferred to and from the cloud.")
.defineInRange("cycles_processed_per_tick", 100_000L, 1L, 1_000_000_000L);
.defineInRange("cycles_processed_per_tick", 1_000_000L, 1L, 1_000_000_000L);
BUILDER.pop();
//</editor-fold>

Expand Down Expand Up @@ -279,6 +281,17 @@ public class Config {
.comment(" Maximum I/O rate of the battery")
.defineInRange("large_battery_transfer_rate", 100_000_000, 1, Integer.MAX_VALUE);

BUILDER.pop();

BUILDER.push("Creative");
CREATIVE_BATTERY_CAPACITY = BUILDER
.comment(" Maximum capacity of the battery")
.defineInRange("creative_battery_capacity", Integer.MAX_VALUE, 1, Integer.MAX_VALUE);

CREATIVE_BATTERY_TRANSFER_RATE = BUILDER
.comment(" Maximum I/O rate of the battery")
.defineInRange("creative_battery_transfer_rate", Integer.MAX_VALUE, 1, Integer.MAX_VALUE);

BUILDER.pop();
BUILDER.pop();
//</editor-fold>
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/dev/gacbl/logicore/LogiCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import dev.gacbl.logicore.blocks.research_station.ResearchStationBlockEntityRenderer;
import dev.gacbl.logicore.blocks.research_station.ResearchStationModule;
import dev.gacbl.logicore.blocks.research_station.ui.ResearchStationScreen;
import dev.gacbl.logicore.blocks.serverrack.ServerRackBlockEntityRenderer;
import dev.gacbl.logicore.blocks.serverrack.ServerRackModule;
import dev.gacbl.logicore.blocks.serverrack.ui.ServerRackScreen;
import dev.gacbl.logicore.core.IntegrationUtils;
Expand All @@ -32,6 +33,8 @@
import dev.gacbl.logicore.data.CreativeTabModule;
import dev.gacbl.logicore.items.pickaxe.CyclePickModule;
import dev.gacbl.logicore.items.processorunit.ProcessorUnitModule;
import dev.gacbl.logicore.items.server.ServerModule;
import dev.gacbl.logicore.items.server.ui.ServerScreen;
import dev.gacbl.logicore.items.stack_upgrade.StackUpgradeModule;
import dev.gacbl.logicore.items.wrench.WrenchModule;
import dev.gacbl.logicore.network.PacketHandler;
Expand Down Expand Up @@ -86,6 +89,7 @@ public LogiCore(IEventBus modEventBus, ModContainer modContainer) {
CyclePickModule.register(modEventBus);
RepairStationModule.register(modEventBus);
RecyclerModule.register(modEventBus);
ServerModule.register(modEventBus);

IntegrationUtils.registerEvents();
PacketHandler.register(modEventBus);
Expand Down Expand Up @@ -134,6 +138,7 @@ public static void registerScreens(RegisterMenuScreensEvent event) {
event.register(RepairStationModule.REPAIR_STATION_MENU.get(), RepairStationScreen::new);
event.register(RecyclerModule.RECYCLER_MENU.get(), RecyclerScreen::new);
event.register(DatacenterModule.DATACENTER_CONTROLLER_MENU.get(), DatacenterControllerScreen::new);
event.register(ServerModule.SERVER_MENU.get(), ServerScreen::new);
}

@SubscribeEvent
Expand All @@ -143,6 +148,7 @@ public static void registerRenderers(EntityRenderersEvent.RegisterRenderers even
event.registerBlockEntityRenderer(BatteryModule.BATTERY_BE.get(), BatteryFillRenderer::new);
event.registerBlockEntityRenderer(RepairStationModule.REPAIR_STATION_BE.get(), RepairStationBlockEntityRenderer::new);
event.registerBlockEntityRenderer(RecyclerModule.RECYCLER_BE.get(), context -> new RecyclerBlockRenderer());
event.registerBlockEntityRenderer(ServerRackModule.SERVER_RACK_BLOCK_ENTITY.get(), ServerRackBlockEntityRenderer::new);
}

@SubscribeEvent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
package dev.gacbl.logicore.api.compat.jade.providers;

import dev.gacbl.logicore.LogiCore;
import dev.gacbl.logicore.blocks.serverrack.ServerRackBlock;
import dev.gacbl.logicore.blocks.serverrack.ServerRackBlockEntity;
import dev.gacbl.logicore.core.CoreCycleProviderBlockEntity;
import dev.gacbl.logicore.core.Utils;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.DoubleBlockHalf;
import snownee.jade.api.BlockAccessor;
import snownee.jade.api.IBlockComponentProvider;
import snownee.jade.api.IServerDataProvider;
Expand All @@ -31,8 +35,12 @@ public void appendTooltip(ITooltip tooltip, BlockAccessor accessor, IPluginConfi
max = accessor.getServerData().getLong("MaxCycles");
}

tooltip.add(Component.translatable("tooltip.logicore.cycles", String.format("%,d", cycles), String.format("%,d", max)));
tooltip.add(Component.translatable("tooltip.logicore.processors", count, ServerRackBlockEntity.RACK_CAPACITY));
if (!accessor.getPlayer().isCrouching()) {
tooltip.add(Component.translatable("tooltip.logicore.cycles", Utils.formatValues(cycles), Utils.formatValues(max)));
} else {
tooltip.add(Component.translatable("tooltip.logicore.cycles", String.format("%,d", cycles), String.format("%,d", max)));
}
tooltip.add(Component.translatable("tooltip.logicore.processors", count, ServerRackBlockEntity.RACK_CAPACITY * 9));
}

@Override
Expand All @@ -44,17 +52,25 @@ public boolean shouldRequestData(BlockAccessor accessor) {

@Override
public void appendServerData(CompoundTag data, BlockAccessor accessor) {
CoreCycleProviderBlockEntity rackBlockEntity = (CoreCycleProviderBlockEntity) accessor.getBlockEntity();
CoreCycleProviderBlockEntity blockEntity = (CoreCycleProviderBlockEntity) accessor.getBlockEntity();
if (accessor.getBlock() instanceof ServerRackBlock) {
BlockState state = accessor.getBlockState();
if (state.getValue(ServerRackBlock.HALF) == DoubleBlockHalf.LOWER) {
blockEntity = (CoreCycleProviderBlockEntity) accessor.getBlockEntity();
} else {
blockEntity = (CoreCycleProviderBlockEntity) accessor.getLevel().getBlockEntity(accessor.getPosition().below());
}
}

if (rackBlockEntity == null) {
rackBlockEntity = (CoreCycleProviderBlockEntity) accessor.getLevel().getBlockEntity(accessor.getPosition().below());
if (blockEntity == null) {
blockEntity = (CoreCycleProviderBlockEntity) accessor.getLevel().getBlockEntity(accessor.getPosition().below());
}

if (rackBlockEntity == null) return;
if (blockEntity == null) return;

data.putInt("Count", rackBlockEntity.getProcessorCount());
data.putLong("Cycles", rackBlockEntity.getCycleStorage().getCyclesAvailable());
data.putLong("MaxCycles", rackBlockEntity.getCycleStorage().getCycleCapacity());
data.putInt("Count", blockEntity.getProcessorCount());
data.putLong("Cycles", blockEntity.getCycleStorage().getCyclesAvailable());
data.putLong("MaxCycles", blockEntity.getCycleStorage().getCycleCapacity());
}

@Override
Expand Down
Loading