mark research dirty when un-researching, add onUnresearched
This commit is contained in:
parent
e20a81c02c
commit
b4c02e240d
@ -27,7 +27,12 @@ public abstract class AndroidResearch implements INBTSerializable<CompoundTag> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void unResearch() {
|
public void unResearch() {
|
||||||
|
if (!researched)
|
||||||
|
return;
|
||||||
|
|
||||||
researched = false;
|
researched = false;
|
||||||
|
onUnresearched();
|
||||||
|
markDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
public AndroidResearch(AndroidResearchType<?> type, AndroidCapabilityPlayer capability) {
|
public AndroidResearch(AndroidResearchType<?> type, AndroidCapabilityPlayer capability) {
|
||||||
@ -51,6 +56,8 @@ public abstract class AndroidResearch implements INBTSerializable<CompoundTag> {
|
|||||||
* Should *only* refund research cost to host, not reverse its effects
|
* Should *only* refund research cost to host, not reverse its effects
|
||||||
*/
|
*/
|
||||||
abstract public void refund();
|
abstract public void refund();
|
||||||
|
abstract public void onUnresearched();
|
||||||
|
|
||||||
abstract public void onResearched();
|
abstract public void onResearched();
|
||||||
abstract public void consumeCost();
|
abstract public void consumeCost();
|
||||||
abstract public boolean canAfford();
|
abstract public boolean canAfford();
|
||||||
|
@ -300,6 +300,11 @@ public class AndroidResearchBuilder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUnresearched() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canAfford() {
|
public boolean canAfford() {
|
||||||
if (capability.ply.experienceLevel < experience)
|
if (capability.ply.experienceLevel < experience)
|
||||||
|
Loading…
Reference in New Issue
Block a user