Skip to content

Commit

Permalink
chore: remove useless fields
Browse files Browse the repository at this point in the history
  • Loading branch information
JWJUN233233 committed Jun 12, 2024
1 parent 1fc0e03 commit 3f5be78
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,7 @@ public void preRegister() {
protected void tick(Block b, SlimefunItem item, SlimefunBlockData data) {
if (eval != null) {
BlockMenu blockMenu = StorageCacheUtils.getMenu(b.getLocation());
MachineInfo info = new MachineInfo(
blockMenu,
data,
item,
b,
theRecord.totalTicks(),
theRecord.getProgress(),
processor,
theRecord,
this);
MachineInfo info = new MachineInfo(blockMenu, data, item, b, processor, null, this);
eval.evalFunction("tick", info);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public record MachineInfo(
SlimefunBlockData data,
SlimefunItem machineItem,
Block block,
int totalTicks,
int progress,
MachineProcessor<?> processor,
MachineOperation operation,
CustomMachine machine) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
package org.lins.mmmjjkx.rykenslimefuncustomizer.objects.machine;

import io.github.thebusybiscuit.slimefun4.core.machines.MachineOperation;

public record MachineRecord(int capacity, int totalTicks) implements MachineOperation {
private static int progress = 0;

@Override
public void addProgress(int i) {
if (progress >= totalTicks) {
progress = i;
return;
}
progress += i;
}

@Override
public int getProgress() {
return progress;
}

@Override
public int getTotalTicks() {
return totalTicks;
}
}
public record MachineRecord(int capacity) {}
Original file line number Diff line number Diff line change
Expand Up @@ -103,23 +103,7 @@ public AbstractEmptyMachine<?> readEach(String s) {
-1);
return machine;
}
int totalTicks = energySettings.getInt("totalTicks");
if (totalTicks < 1) {
ExceptionHandler.handleError(
"无法读取在附属" + addon.getAddonId() + "中的机器" + s + "的能源设置,已转为无电机器,原因: 总粘液刻不能小于1");
machine = new CustomNoEnergyMachine(
group.getSecondValue(),
slimefunItemStack,
rt.getSecondValue(),
recipe,
menu,
input,
output,
eval,
-1);
return machine;
}
MachineRecord record = new MachineRecord(capacity, totalTicks);
MachineRecord record = new MachineRecord(capacity);
String encType = energySettings.getString("type");
Pair<ExceptionHandler.HandleResult, EnergyNetComponentType> enc = ExceptionHandler.handleEnumValueOf(
"无法读取在附属" + addon.getAddonId() + "中的机器" + s + "的能源设置,已转为无电机器,原因: 错误的能源网络组件类型" + encType,
Expand Down

0 comments on commit 3f5be78

Please sign in to comment.