Package de.z0rdak.yawp.core.region
Class ProtectedRegion
java.lang.Object
de.z0rdak.yawp.core.region.ProtectedRegion
- All Implemented Interfaces:
IProtectedRegion
- Direct Known Subclasses:
DimensionalRegion,GlobalRegion,MarkedRegion
An abstract region represents the basic implementation of a IProtectedRegion.
This abstraction can be used for markable regions as well as regions without
an area (dimensions).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> protected IProtectedRegionprotected String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProtectedRegion(String name, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, RegionType type) protectedProtectedRegion(String name, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, RegionType regionType, net.minecraft.world.entity.player.Player owner) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddChild(IProtectedRegion child) voidvoidvoidvoidvoidbooleancontainsFlag(RegionFlag flag) booleancontainsFlag(String flag) net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> getDim()getFlags()Gets the container for the provided group.getName()booleanhasChild(IProtectedRegion maybeChild) booleanbooleanbooleanisActive()booleanbooleanisMuted()booleanpermits(net.minecraft.world.entity.player.Player player) Checks if the player is defined in the regions player list OR whether the player is an operator.voidremoveChild(IProtectedRegion child) Will always be called by IMarkableRegion to remove child of type IMarkableRegionvoidremoveFlag(String flag) voidremovePlayer(UUID playerUuid, String group) voidremoveTeam(String teamName, String group) voidvoidsetChildrenNames(List<String> childrenNames) voidsetFlags(RegionFlags flags) voidsetGroups(Map<String, PlayerContainer> groups) voidsetIsActive(boolean isActive) voidsetIsMuted(boolean isMuted) protected voidprotected booleansetParent(IProtectedRegion parent)
-
Field Details
-
dimension
protected net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension -
parent
-
parentName
-
-
Constructor Details
-
ProtectedRegion
protected ProtectedRegion(String name, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, RegionType type) -
ProtectedRegion
protected ProtectedRegion(String name, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, RegionType regionType, net.minecraft.world.entity.player.Player owner)
-
-
Method Details
-
getParentName
- Specified by:
getParentNamein interfaceIProtectedRegion
-
getName
- Specified by:
getNamein interfaceIProtectedRegion
-
setName
-
setGroups
- Specified by:
setGroupsin interfaceIProtectedRegion
-
getGroups
- Specified by:
getGroupsin interfaceIProtectedRegion
-
getDim
public net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> getDim()- Specified by:
getDimin interfaceIProtectedRegion
-
getRegionType
- Specified by:
getRegionTypein interfaceIProtectedRegion
-
addFlag
- Specified by:
addFlagin interfaceIProtectedRegion
-
removeFlag
- Specified by:
removeFlagin interfaceIProtectedRegion
-
containsFlag
- Specified by:
containsFlagin interfaceIProtectedRegion
-
containsFlag
- Specified by:
containsFlagin interfaceIProtectedRegion
-
setFlags
- Specified by:
setFlagsin interfaceIProtectedRegion
-
getFlags
- Specified by:
getFlagsin interfaceIProtectedRegion
-
getFlag
- Specified by:
getFlagin interfaceIProtectedRegion
-
isActive
public boolean isActive()- Specified by:
isActivein interfaceIProtectedRegion
-
setIsActive
public void setIsActive(boolean isActive) - Specified by:
setIsActivein interfaceIProtectedRegion
-
isMuted
public boolean isMuted()- Specified by:
isMutedin interfaceIProtectedRegion
-
setIsMuted
public void setIsMuted(boolean isMuted) - Specified by:
setIsMutedin interfaceIProtectedRegion
-
addPlayer
- Specified by:
addPlayerin interfaceIProtectedRegion
-
addPlayer
- Specified by:
addPlayerin interfaceIProtectedRegion
-
addTeam
- Specified by:
addTeamin interfaceIProtectedRegion
-
removeTeam
- Specified by:
removeTeamin interfaceIProtectedRegion
-
resetGroups
public void resetGroups()- Specified by:
resetGroupsin interfaceIProtectedRegion
-
removePlayer
- Specified by:
removePlayerin interfaceIProtectedRegion
-
hasTeam
- Specified by:
hasTeamin interfaceIProtectedRegion
-
hasPlayer
- Specified by:
hasPlayerin interfaceIProtectedRegion
-
getGroup
Gets the container for the provided group. Creates a new one if none is existent.- Specified by:
getGroupin interfaceIProtectedRegion
-
permits
public boolean permits(net.minecraft.world.entity.player.Player player) Checks if the player is defined in the regions player list OR whether the player is an operator. Usually this check is needed when an event occurs, and it needs to be checked whether the player has a specific permission to perform an action in the region.- Specified by:
permitsin interfaceIProtectedRegion- Parameters:
player- to be checked- Returns:
- true if player is in region list or is an operator, false otherwise
-
isInGroup
- Specified by:
isInGroupin interfaceIProtectedRegion
-
removeChild
Will always be called by IMarkableRegion to remove child of type IMarkableRegion- Specified by:
removeChildin interfaceIProtectedRegion
-
clearChildren
public void clearChildren()- Specified by:
clearChildrenin interfaceIProtectedRegion
-
setChildrenNames
-
getChildren
- Specified by:
getChildrenin interfaceIProtectedRegion
-
getChildrenNames
- Specified by:
getChildrenNamesin interfaceIProtectedRegion
-
hasChild
- Specified by:
hasChildin interfaceIProtectedRegion
-
addChild
- Specified by:
addChildin interfaceIProtectedRegion
-
setParent
-
getParent
- Specified by:
getParentin interfaceIProtectedRegion
-