Fixed add_farm and some help messages
parent
e50fe0d4e4
commit
2f2fd0f200
|
@ -234,7 +234,7 @@ def add_farm(x_pos, z_pos, dimension="O", name=None, discord_uuid=None, mc_uuid=
|
|||
:help: Adds your public farm to the database.
|
||||
"""
|
||||
|
||||
return add_location(x_pos, z_pos, name=name, discord_uuid=discord_uuid, mc_uuid=mc_uuid, loc_type=PublicFarm)
|
||||
return add_location(x_pos, z_pos, dimension, name=name, discord_uuid=discord_uuid, mc_uuid=mc_uuid, loc_type=PublicFarm)
|
||||
|
||||
|
||||
@command(RequestTypes.POST)
|
||||
|
@ -354,7 +354,7 @@ def find_around(x_pos, z_pos, radius=200):
|
|||
:param radius: Radius to each around (default 200)
|
||||
:return: List of all locations in the radius
|
||||
:raises: LocationLookupError
|
||||
:help: Finds all the locations around a certain point
|
||||
:help: Finds all the locations around a certain point.
|
||||
"""
|
||||
|
||||
x_pos = int(x_pos)
|
||||
|
@ -424,7 +424,7 @@ def find_farm(resource_name):
|
|||
:param resource_name: Resource to search for
|
||||
:return: List of top matching farms
|
||||
:raises: ResourceNotFoundError
|
||||
:help: Lists farms that produce an object
|
||||
:help: Lists farms that produce a resource.
|
||||
"""
|
||||
if len(resource_name) == 0:
|
||||
raise EmptryString
|
||||
|
@ -500,10 +500,10 @@ def get_selling(item_name, sort):
|
|||
def info(location_name):
|
||||
"""
|
||||
:request: GET
|
||||
:param location_name: Name of the location to get info on
|
||||
:param location_name: Name of the location to get info on.
|
||||
:return: JSON representation of location
|
||||
:raises: LocationLookupError
|
||||
:help: Finds all the locations matching the search term
|
||||
:help: Gives additional info about a location.
|
||||
"""
|
||||
|
||||
location = Location.objects.filter(name__iexact=location_name).first()
|
||||
|
@ -537,7 +537,7 @@ def tunnel(player_name):
|
|||
:return: List of all the tunnels a user owns
|
||||
:raises: LocationLookUpError
|
||||
:raises: LocationLookupError
|
||||
:help: Finds all the tunnels a player owns
|
||||
:help: Finds all the tunnels a player owns.
|
||||
"""
|
||||
|
||||
tunnels = Tunnel.objects.filter(location__owner__name__icontains=player_name).all()
|
||||
|
@ -561,7 +561,7 @@ def edit_pos(x, z, loc_name, dimension="O", discord_uuid=None, mc_uuid=None):
|
|||
:return: Edited Location
|
||||
:raises:
|
||||
:raises: PlayerNotFound, LocationLookupError, EntryNameNotUniqueError, NoLocationsInDatabase
|
||||
:help: Edits the position of a location
|
||||
:help: Edits the position of a location.
|
||||
"""
|
||||
|
||||
player = get_player(discord_uuid=discord_uuid, mc_uuid=mc_uuid)
|
||||
|
@ -586,7 +586,7 @@ def edit_tunnel(tunnel_direction, tunnel_number, loc_name, discord_uuid=None, mc
|
|||
:param mc_uuid: Minecraft UUID
|
||||
:return: Edited Location
|
||||
:raises: PlayerNotFound, LocationLookupError, EntryNameNotUniqueError, NoLocationsInDatabase
|
||||
:help: Edits the tunnel of a location
|
||||
:help: Edits the tunnel of a location.
|
||||
"""
|
||||
|
||||
player = get_player(discord_uuid=discord_uuid, mc_uuid=mc_uuid)
|
||||
|
@ -614,7 +614,7 @@ def edit_name(new_name, loc_name, discord_uuid=None, mc_uuid=None):
|
|||
:param mc_uuid: MC UUID
|
||||
:return: Edited Location
|
||||
:raises: PlayerNotFound, LocationLookupError, EntryNameNotUniqueError, NoLocationsInDatabase
|
||||
:help: Edits the name of a location
|
||||
:help: Edits the name of a location.
|
||||
"""
|
||||
|
||||
player = get_player(discord_uuid=discord_uuid, mc_uuid=mc_uuid)
|
||||
|
@ -639,7 +639,7 @@ def delete_item(item, shop_name=None, discord_uuid=None, mc_uuid=None):
|
|||
:param mc_uuid: Minecraft UUID
|
||||
:return: Shop where the item was deleted from
|
||||
:raises: PlayerNotFound, LocationLookupError, EntryNameNotUniqueError, NoLocationsInDatabase, ItemNotFound
|
||||
:help: Deletes an item from a shop
|
||||
:help: Deletes an item from a shop.
|
||||
"""
|
||||
|
||||
player = get_player(discord_uuid=discord_uuid, mc_uuid=mc_uuid)
|
||||
|
@ -666,7 +666,7 @@ def delete_resource(resource, farm_name=None, discord_uuid=None, mc_uuid=None):
|
|||
:param mc_uuid: Minecraft UUID
|
||||
:return: PublicFarm where the resource was deleted from
|
||||
:raises: PlayerNotFound, LocationLookupError, EntryNameNotUniqueError, NoLocationsInDatabase, ItemNotFound
|
||||
:help: Deletes a resource from a farm
|
||||
:help: Deletes a resource from a farm.
|
||||
"""
|
||||
|
||||
player = get_player(discord_uuid=discord_uuid, mc_uuid=mc_uuid)
|
||||
|
@ -691,7 +691,7 @@ def me(discord_uuid=None, mc_uuid=None):
|
|||
:param mc_uuid: MC UUID
|
||||
:return: Returns a list of all the locations owned by a user
|
||||
:raises: NoLocationsInDatabase, PlayerNotFound
|
||||
:help: Find all the locations in the database
|
||||
:help: Find all the locations owned by a player in the database.
|
||||
"""
|
||||
|
||||
try:
|
||||
|
@ -717,7 +717,7 @@ def restock(item_name, shop_name=None, discord_uuid=None, mc_uuid=None):
|
|||
:param mc_uuid: Minecraft UUID
|
||||
:return: List of items updated
|
||||
:raises: PlayerNotFound, LocationLookupError, EntryNameNotUniqueError, NoLocationsInDatabase, ItemNotFound
|
||||
:help: Restocks items matching the item name in your shop
|
||||
:help: Restocks items matching the item name in your shop.
|
||||
"""
|
||||
owner = get_player(discord_uuid, mc_uuid)
|
||||
shop = get_location(owner, shop_name, Shop)
|
||||
|
@ -744,7 +744,7 @@ def add_owner(new_owner_name, location_name, discord_uuid=None, mc_uuid=None):
|
|||
:param mc_uuid: MC UUID of the current owner
|
||||
:return: Update Location
|
||||
:raises: PlayerNotFound, LocationLookupError, IsOwnerError, OwnerNotFound
|
||||
:help: Adds a co-owner to a location
|
||||
:help: Adds a co-owner to a location.
|
||||
"""
|
||||
owner = get_player(discord_uuid, mc_uuid)
|
||||
|
||||
|
@ -775,7 +775,7 @@ def add_resident(new_resident_name, town_name, discord_uuid=None, mc_uuid=None):
|
|||
:param mc_uuid: MC UUID of the town owner
|
||||
:return: Updated Location
|
||||
:raises: PlayerNotFound, LocationLookupError, IsResidentError, ResidentNotFoundError
|
||||
:help: Adds a resident to a town
|
||||
:help: Adds a resident to a town.
|
||||
"""
|
||||
owner = get_player(discord_uuid, mc_uuid)
|
||||
|
||||
|
@ -806,7 +806,7 @@ def remove_resident(resident_name, town_name, discord_uuid=None, mc_uuid=None):
|
|||
:param mc_uuid: Owner mc uuid
|
||||
:raises: PlayerNotFound, LocationLookupError, ResidentNotFoundError
|
||||
:return: Updated town
|
||||
:help: Removes a resident from a town
|
||||
:help: Removes a resident from a town.
|
||||
"""
|
||||
|
||||
owner = get_player(discord_uuid, mc_uuid)
|
||||
|
|
Loading…
Reference in New Issue