Merge pull request #3064 from SRLJustin/deprecated_shit_gone

This commit is contained in:
Owain van Brakel
2021-11-03 09:07:45 +01:00
committed by GitHub
4 changed files with 5 additions and 97 deletions

View File

@@ -50,12 +50,7 @@ public enum KitType
HAIR("Hair"),
HANDS("Hands"),
BOOTS("Boots"),
JAW("Jaw"),
// When removing these, make sure you also remove the type.ordinal() > 11 checks in RSPlayerCompositionMixin
@Deprecated(since = "4.6.2", forRemoval = true)
RING("Ring"),
@Deprecated(since = "4.6.2", forRemoval = true)
AMMUNITION("Ammo");
JAW("Jaw");
private final String name;

View File

@@ -1,72 +0,0 @@
/*
* Copyright (c) 2019, tha23rd <https://https://github.com/tha23rd>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.api.queries;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import net.runelite.api.Client;
import net.runelite.api.Constants;
import net.runelite.api.LocatableQueryResults;
import net.runelite.api.Scene;
import net.runelite.api.Tile;
@Deprecated(since = "4.2.1", forRemoval = true)
public class TileQuery extends LocatableQuery<Tile, TileQuery>
{
private List<Tile> getTiles(Client client)
{
List<Tile> tilesList = new ArrayList<>();
Scene scene = client.getScene();
Tile[][][] tiles = scene.getTiles();
int z = client.getPlane();
for (int x = 0; x < Constants.SCENE_SIZE; ++x)
{
for (int y = 0; y < Constants.SCENE_SIZE; ++y)
{
Tile tile = tiles[z][x][y];
if (tile == null)
{
continue;
}
tilesList.add(tile);
}
}
return tilesList;
}
@Deprecated(since = "4.2.1", forRemoval = true)
@Override
public LocatableQueryResults<Tile> result(Client client)
{
return new LocatableQueryResults<>(getTiles(client).stream()
.filter(Objects::nonNull)
.filter(predicate)
.distinct()
.collect(Collectors.toList()));
}
}

View File

@@ -289,11 +289,6 @@ public class PlayerManager
for (KitType kitType : KitType.values())
{
if (kitType.equals(KitType.RING) || kitType.equals(KitType.AMMUNITION))
{
continue;
}
final int id = player.getPlayer().getPlayerComposition().getEquipmentId(kitType);
if (id == -1)
@@ -319,7 +314,7 @@ public class PlayerManager
case ItemID.MAGIC_SHORTBOW:
case ItemID.MAGIC_SHORTBOW_20558:
case ItemID.MAGIC_SHORTBOW_I:
rangeStr += +55;
rangeStr += 55;
break;
case ItemID.DARK_BOW:
case ItemID.DARK_BOW_12765:
@@ -327,16 +322,16 @@ public class PlayerManager
case ItemID.DARK_BOW_12767:
case ItemID.DARK_BOW_12768:
case ItemID.DARK_BOW_20408:
rangeStr += +60;
rangeStr += 60;
break;
case ItemID.RUNE_CROSSBOW:
case ItemID.RUNE_CROSSBOW_23601:
rangeStr += +117;
rangeStr += 117;
break;
case ItemID.DRAGON_CROSSBOW:
case ItemID.ARMADYL_CROSSBOW:
case ItemID.ARMADYL_CROSSBOW_23611:
rangeStr += +122;
rangeStr += 122;
break;
}
}

View File

@@ -12,11 +12,6 @@ public abstract class RSPlayerCompositionMixin implements RSPlayerComposition
@Override
public int getEquipmentId(KitType type)
{
if (type.ordinal() > 11)
{
return -1;
}
int id = getEquipmentIds()[type.getIndex()];
if (id < 512)
{
@@ -29,11 +24,6 @@ public abstract class RSPlayerCompositionMixin implements RSPlayerComposition
@Override
public int getKitId(KitType type)
{
if (type.ordinal() > 11)
{
return -1;
}
int id = getEquipmentIds()[type.getIndex()];
if (id < 256 || id >= 512)
{