Skip to content

Commit bbcbd7c

Browse files
author
Circulate233
committed
删除计算机的计算组件的耐久设定
1 parent 02c1a8c commit bbcbd7c

15 files changed

+160
-24
lines changed

build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ plugins {
1313

1414
// Project properties
1515
group = "github.kasuminova.novaeng"
16-
version = "1.22.4"
16+
version = "1.22.5"
1717

1818
// Set the toolchain version to decouple the Java we run Gradle with from the Java used to compile and run the mod
1919
java {
@@ -259,7 +259,9 @@ dependencies {
259259
implementation(rfg.deobf("curse.maven:cofh-world-271384:2920434"))
260260
implementation(rfg.deobf("curse.maven:thermal-foundation-222880:2926428"))
261261
compileOnly(rfg.deobf("curse.maven:thermal-innovation-291737:2920441"))
262-
compileOnly(rfg.deobf("curse.maven:rftools-224641:2861573"))
262+
compileOnly(rfg.deobf("curse.maven:tesla-244651:2487959"))
263+
implementation(rfg.deobf("curse.maven:mcjtylib-233105:2745846"))
264+
implementation(rfg.deobf("curse.maven:rftools-224641:2861573"))
263265
implementation(rfg.deobf("curse.maven:thermal-expansion-69163:2926431"))
264266
compileOnly(rfg.deobf("curse.maven:athenaeum-284350:4633750"))
265267
compileOnly(rfg.deobf("curse.maven:artisan-worktables-284351:3205284"))

src/main/java/github/kasuminova/novaeng/NovaEngineeringCore.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import github.kasuminova.novaeng.client.hitokoto.HitokotoAPI;
44
import github.kasuminova.novaeng.common.CommonProxy;
5+
import github.kasuminova.novaeng.common.command.CommandBuilder;
56
import github.kasuminova.novaeng.common.command.CommandSPacketProfiler;
67
import github.kasuminova.novaeng.common.config.NovaEngCoreConfig;
78
import github.kasuminova.novaeng.common.handler.WorldLoadedHandler;
@@ -124,6 +125,7 @@ public void loadComplete(FMLLoadCompleteEvent event) {
124125
@Mod.EventHandler
125126
public void onServerStart(FMLServerStartingEvent event) {
126127
event.registerServerCommand(CommandSPacketProfiler.INSTANCE);
128+
event.registerServerCommand(CommandBuilder.INSTANCE);
127129
WorldLoadedHandler.REGISTERED_DIMENSIONS.clear();
128130
WorldLoadedHandler.ERRORWROLD.clear();
129131
WorldLoadedHandler.init = true;
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
package github.kasuminova.novaeng.common.command;
2+
3+
import net.minecraft.command.CommandBase;
4+
import net.minecraft.command.ICommandSender;
5+
import net.minecraft.server.MinecraftServer;
6+
import net.minecraft.util.math.BlockPos;
7+
import org.jetbrains.annotations.NotNull;
8+
9+
import javax.annotation.Nullable;
10+
import java.util.List;
11+
12+
public class CommandBuilder extends CommandBase {
13+
public static final CommandBuilder INSTANCE = new CommandBuilder();
14+
public boolean isTickWork = false;
15+
public boolean isQuarryWork = false;
16+
17+
private CommandBuilder(){
18+
19+
}
20+
21+
@Override
22+
public @NotNull String getName() {
23+
return "builder_log";
24+
}
25+
26+
@Override
27+
public @NotNull String getUsage(@NotNull ICommandSender sender) {
28+
return "Usage: /builder_log [tick|quarry] [true|false]";
29+
}
30+
31+
@Override
32+
public void execute(@NotNull MinecraftServer server, @NotNull ICommandSender sender, String @NotNull [] args) {
33+
if (args.length >= 2){
34+
switch (args[0]){
35+
case "tick" -> isTickWork = args[1].equals("true");
36+
case "quarry" -> isQuarryWork = args[1].equals("true");
37+
}
38+
}
39+
}
40+
41+
public @NotNull List<String> getTabCompletions(@NotNull MinecraftServer server, @NotNull ICommandSender sender, String[] args, @Nullable BlockPos targetPos) {
42+
if (args.length == 1) {
43+
return getListOfStringsMatchingLastWord(args,
44+
"tick","quarry"
45+
);
46+
}
47+
if (args.length == 2) {
48+
return getListOfStringsMatchingLastWord(args,
49+
"true","false"
50+
);
51+
}
52+
return super.getTabCompletions(server, sender, args, targetPos);
53+
}
54+
55+
}

src/main/java/github/kasuminova/novaeng/common/handler/WorldLoadedHandler.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,15 @@ public static void loadWorld(int id){
6969

7070
@SubscribeEvent
7171
public void onServerTick(TickEvent.ServerTickEvent event) {
72-
if (!SERVER.ForceChunkHandler)return;
73-
if (event.phase == TickEvent.Phase.START) {
74-
if (time % 100 == 0) {
75-
request(Universe.get().server);
72+
switch (event.phase){
73+
case START -> {
74+
if (SERVER.ForceChunkHandler) {
75+
if (time % 100 == 0) {
76+
request(Universe.get().server);
77+
}
78+
++time;
79+
}
7680
}
77-
++time;
7881
}
7982
}
80-
8183
}

src/main/java/github/kasuminova/novaeng/common/hypernet/old/upgrade/DataProcessorModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public DataProcessorModule(final UpgradeType type) {
2222
}
2323

2424
@ZenGetter("energyConsumption")
25-
public abstract int getEnergyConsumption();
25+
public abstract long getEnergyConsumption();
2626

2727
protected void getEnergyDurabilityTip(final List<String> desc, ProcessorModuleType moduleType) {
2828
desc.add(I18n.format("upgrade.data_processor.module.energy.tip",

src/main/java/github/kasuminova/novaeng/common/hypernet/old/upgrade/ProcessorModuleCPU.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public float getEfficiency() {
5353
}
5454

5555
@Override
56-
public int getEnergyConsumption() {
56+
public long getEnergyConsumption() {
5757
return moduleType.getEnergyConsumption();
5858
}
5959

src/main/java/github/kasuminova/novaeng/common/hypernet/old/upgrade/ProcessorModuleRAM.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public float getEfficiency() {
5252
}
5353

5454
@Override
55-
public int getEnergyConsumption() {
55+
public long getEnergyConsumption() {
5656
return moduleType.getEnergyConsumption();
5757
}
5858

src/main/java/github/kasuminova/novaeng/common/hypernet/old/upgrade/type/ProcessorModuleCPUType.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
public class ProcessorModuleCPUType extends ProcessorModuleType {
1515
protected final double computationPointGeneration;
1616

17-
public ProcessorModuleCPUType(final int energyConsumption,
17+
public ProcessorModuleCPUType(final long energyConsumption,
1818
final double computationPointGeneration)
1919
{
2020
super(energyConsumption);
@@ -28,14 +28,14 @@ public ProcessorModuleCPUType(final int energyConsumption,
2828
@ZenMethod
2929
public static ProcessorModuleCPUType create(final int minDurability,
3030
final int maxDurability,
31-
final int energyConsumption,
31+
final long energyConsumption,
3232
final double computationPointGeneration)
3333
{
3434
return new ProcessorModuleCPUType(energyConsumption, computationPointGeneration);
3535
}
3636

3737
@ZenMethod
38-
public static ProcessorModuleCPUType create(final int energyConsumption,
38+
public static ProcessorModuleCPUType create(final long energyConsumption,
3939
final double computationPointGeneration)
4040
{
4141
return new ProcessorModuleCPUType(energyConsumption, computationPointGeneration);

src/main/java/github/kasuminova/novaeng/common/hypernet/old/upgrade/type/ProcessorModuleGPUType.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
@ZenRegister
1212
@ZenClass("novaeng.hypernet.upgrade.type.ProcessorModuleGPUType")
1313
public class ProcessorModuleGPUType extends ProcessorModuleCPUType {
14-
public ProcessorModuleGPUType(final int energyConsumption,
14+
public ProcessorModuleGPUType(final long energyConsumption,
1515
final double computationPointGeneration)
1616
{
1717
super(energyConsumption, computationPointGeneration);
@@ -24,14 +24,14 @@ public ProcessorModuleGPUType(final int energyConsumption,
2424
@ZenMethod
2525
public static ProcessorModuleGPUType createGPUType(final int minDurability,
2626
final int maxDurability,
27-
final int energyConsumption,
27+
final long energyConsumption,
2828
final double computationPointGeneration)
2929
{
3030
return new ProcessorModuleGPUType(energyConsumption, computationPointGeneration);
3131
}
3232

3333
@ZenMethod
34-
public static ProcessorModuleGPUType createGPUType(final int energyConsumption,
34+
public static ProcessorModuleGPUType createGPUType(final long energyConsumption,
3535
final double computationPointGeneration)
3636
{
3737
return new ProcessorModuleGPUType(energyConsumption, computationPointGeneration);

src/main/java/github/kasuminova/novaeng/common/hypernet/old/upgrade/type/ProcessorModuleRAMType.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
public class ProcessorModuleRAMType extends ProcessorModuleType {
1515
private final double computationPointGenerationLimit;
1616

17-
public ProcessorModuleRAMType(final int energyConsumption,
17+
public ProcessorModuleRAMType(final long energyConsumption,
1818
final double computationPointGenerationLimit)
1919
{
2020
super(energyConsumption);
@@ -28,14 +28,14 @@ public ProcessorModuleRAMType(final int energyConsumption,
2828
@ZenMethod
2929
public static ProcessorModuleRAMType create(final int minDurability,
3030
final int maxDurability,
31-
final int energyConsumption,
31+
final long energyConsumption,
3232
final double computationPointGenerationLimit)
3333
{
3434
return new ProcessorModuleRAMType(energyConsumption, computationPointGenerationLimit);
3535
}
3636

3737
@ZenMethod
38-
public static ProcessorModuleRAMType create(final int energyConsumption,
38+
public static ProcessorModuleRAMType create(final long energyConsumption,
3939
final double computationPointGenerationLimit)
4040
{
4141
return new ProcessorModuleRAMType(energyConsumption, computationPointGenerationLimit);

0 commit comments

Comments
 (0)