mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-28 03:19:15 +00:00
Added insight mode
This commit is contained in:
@@ -21,6 +21,7 @@ import com.flowpowered.nbt.CompoundMap;
|
||||
import com.flowpowered.nbt.IntTag;
|
||||
import com.flowpowered.nbt.StringTag;
|
||||
import com.flowpowered.nbt.Tag;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.momirealms.customcrops.api.core.world.CustomCropsBlockState;
|
||||
import net.momirealms.customcrops.api.core.world.CustomCropsWorld;
|
||||
import net.momirealms.customcrops.api.core.world.Pos3;
|
||||
@@ -96,4 +97,9 @@ public abstract class AbstractCustomCropsBlock implements CustomCropsBlock {
|
||||
@Override
|
||||
public void onPlace(WrappedPlaceEvent event) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public NamedTextColor insightColor() {
|
||||
return NamedTextColor.WHITE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
package net.momirealms.customcrops.api.core.block;
|
||||
|
||||
import com.flowpowered.nbt.IntTag;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.momirealms.customcrops.api.BukkitCustomCropsPlugin;
|
||||
import net.momirealms.customcrops.api.action.ActionManager;
|
||||
import net.momirealms.customcrops.api.context.Context;
|
||||
@@ -386,4 +387,9 @@ public class CropBlock extends AbstractCustomCropsBlock {
|
||||
public CropConfig config(CustomCropsBlockState state) {
|
||||
return Registries.CROP.get(id(state));
|
||||
}
|
||||
|
||||
@Override
|
||||
public NamedTextColor insightColor() {
|
||||
return NamedTextColor.GREEN;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
package net.momirealms.customcrops.api.core.block;
|
||||
|
||||
import com.flowpowered.nbt.CompoundMap;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.momirealms.customcrops.api.core.world.CustomCropsBlockState;
|
||||
import net.momirealms.customcrops.api.core.world.CustomCropsWorld;
|
||||
import net.momirealms.customcrops.api.core.world.Pos3;
|
||||
@@ -45,4 +46,6 @@ public interface CustomCropsBlock {
|
||||
void onPlace(WrappedPlaceEvent event);
|
||||
|
||||
boolean isBlockInstance(String id);
|
||||
|
||||
NamedTextColor insightColor();
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
package net.momirealms.customcrops.api.core.block;
|
||||
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.momirealms.customcrops.api.BukkitCustomCropsPlugin;
|
||||
import net.momirealms.customcrops.api.core.BuiltInBlockMechanics;
|
||||
import net.momirealms.customcrops.api.core.ConfigManager;
|
||||
@@ -115,4 +116,9 @@ public class GreenhouseBlock extends AbstractCustomCropsBlock {
|
||||
});
|
||||
return state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NamedTextColor insightColor() {
|
||||
return NamedTextColor.GRAY;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
package net.momirealms.customcrops.api.core.block;
|
||||
|
||||
import com.flowpowered.nbt.*;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.momirealms.customcrops.api.BukkitCustomCropsPlugin;
|
||||
import net.momirealms.customcrops.api.action.ActionManager;
|
||||
import net.momirealms.customcrops.api.context.Context;
|
||||
@@ -638,4 +639,9 @@ public class PotBlock extends AbstractCustomCropsBlock {
|
||||
tag.put(new StringTag("id", fertilizer.id()));
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NamedTextColor insightColor() {
|
||||
return NamedTextColor.LIGHT_PURPLE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
package net.momirealms.customcrops.api.core.block;
|
||||
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.momirealms.customcrops.api.BukkitCustomCropsPlugin;
|
||||
import net.momirealms.customcrops.api.core.BuiltInBlockMechanics;
|
||||
import net.momirealms.customcrops.api.core.ConfigManager;
|
||||
@@ -115,4 +116,9 @@ public class ScarecrowBlock extends AbstractCustomCropsBlock {
|
||||
});
|
||||
return state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NamedTextColor insightColor() {
|
||||
return NamedTextColor.YELLOW;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ package net.momirealms.customcrops.api.core.block;
|
||||
|
||||
import com.flowpowered.nbt.IntTag;
|
||||
import com.flowpowered.nbt.Tag;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.momirealms.customcrops.api.BukkitCustomCropsPlugin;
|
||||
import net.momirealms.customcrops.api.action.ActionManager;
|
||||
import net.momirealms.customcrops.api.context.Context;
|
||||
@@ -359,4 +360,9 @@ public class SprinklerBlock extends AbstractCustomCropsBlock {
|
||||
FurnitureRotation rotation = BukkitCustomCropsPlugin.getInstance().getItemManager().remove(location, ExistenceForm.ANY);
|
||||
BukkitCustomCropsPlugin.getInstance().getItemManager().place(location, config.existenceForm(), hasWater ? config.threeDItemWithWater() : config.threeDItem(), rotation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NamedTextColor insightColor() {
|
||||
return NamedTextColor.AQUA;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,6 +149,13 @@ public interface CustomCropsWorld<W> {
|
||||
*/
|
||||
CustomCropsChunk[] loadedChunks();
|
||||
|
||||
/**
|
||||
* Gets all the lazy chunks in this world.
|
||||
*
|
||||
* @return An array of {@link CustomCropsChunk} representing the lazy chunks.
|
||||
*/
|
||||
CustomCropsChunk[] lazyChunks();
|
||||
|
||||
/**
|
||||
* Gets the block state at a specific location.
|
||||
*
|
||||
|
||||
@@ -137,6 +137,11 @@ public class CustomCropsWorldImpl<W> implements CustomCropsWorld<W> {
|
||||
return loadedChunks.values().toArray(new CustomCropsChunk[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CustomCropsChunk[] lazyChunks() {
|
||||
return lazyChunks.values().toArray(new CustomCropsChunk[0]);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Optional<CustomCropsBlockState> getBlockState(Pos3 location) {
|
||||
|
||||
Reference in New Issue
Block a user