Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Optional Fluid Task #126

Open
wants to merge 1 commit into
base: 1.12
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions src/main/java/betterquesting/core/proxies/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public void registerExpansion() {
taskReg.register(FactoryTaskInteractEntity.INSTANCE);
taskReg.register(FactoryTaskTrigger.INSTANCE);
taskReg.register(FactoryTaskOptionalRetrieval.INSTANCE);
taskReg.register(FactoryTaskOptionalFluid.INSTANCE);

IRegistry<IFactoryData<IReward, NBTTagCompound>, IReward> rewardReg = QuestingAPI.getAPI(ApiReference.REWARD_REG);
rewardReg.register(FactoryRewardChoice.INSTANCE);
Expand Down
25 changes: 25 additions & 0 deletions src/main/java/betterquesting/questing/tasks/TaskOptionalFluid.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package betterquesting.questing.tasks;

import betterquesting.core.BetterQuesting;
import betterquesting.questing.tasks.factory.FactoryTaskOptionalFluid;
import net.minecraft.util.ResourceLocation;

import java.util.UUID;

public class TaskOptionalFluid extends TaskFluid {

@Override
public String getUnlocalisedName() {
return BetterQuesting.MODID_STD + ".task.optional_fluid";
}

@Override
public ResourceLocation getFactoryID() {
return FactoryTaskOptionalFluid.INSTANCE.getRegistryName();
}

@Override
public boolean ignored(UUID uuid) {
return true;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package betterquesting.questing.tasks.factory;

import betterquesting.api.questing.tasks.ITask;
import betterquesting.api2.registry.IFactoryData;
import betterquesting.core.BetterQuesting;
import betterquesting.questing.tasks.TaskOptionalFluid;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;

public class FactoryTaskOptionalFluid implements IFactoryData<ITask, NBTTagCompound> {

public static final FactoryTaskOptionalFluid INSTANCE = new FactoryTaskOptionalFluid();

@Override
public ResourceLocation getRegistryName() {
return new ResourceLocation(BetterQuesting.MODID_STD + ":optional_fluid");
}

@Override
public TaskOptionalFluid createNew() {
return new TaskOptionalFluid();
}

@Override
public TaskOptionalFluid loadFromData(NBTTagCompound json) {
TaskOptionalFluid task = new TaskOptionalFluid();
task.readFromNBT(json);
return task;
}
}
1 change: 1 addition & 0 deletions src/main/resources/assets/betterquesting/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ bq_standard.task.hunt=Mob Hunt Task
bq_standard.task.scoreboard=Scoreboard Task
bq_standard.task.location=Location Task
bq_standard.task.fluid=Fluid Task
bq_standard.task.optional_fluid=Optional Fluid Task
bq_standard.task.meeting=Meeting Task
bq_standard.task.xp=Experience Task
bq_standard.task.block_break=Break Block Task
Expand Down
Loading