Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 04:20:08 +01:00
World#spawnArrow should return an AbstractArrow now
Dieser Commit ist enthalten in:
Ursprung
29b90d2410
Commit
dadc539211
@ -521,12 +521,12 @@ public class CraftWorld implements World {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Arrow spawnArrow(Location loc, Vector velocity, float speed, float spread) {
|
public AbstractArrow spawnArrow(Location loc, Vector velocity, float speed, float spread) {
|
||||||
return spawnArrow(loc, velocity, speed, spread, Arrow.class);
|
return spawnArrow(loc, velocity, speed, spread, Arrow.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T extends Arrow> T spawnArrow(Location loc, Vector velocity, float speed, float spread, Class<T> clazz) {
|
public <T extends AbstractArrow> T spawnArrow(Location loc, Vector velocity, float speed, float spread, Class<T> clazz) {
|
||||||
Validate.notNull(loc, "Can not spawn arrow with a null location");
|
Validate.notNull(loc, "Can not spawn arrow with a null location");
|
||||||
Validate.notNull(velocity, "Can not spawn arrow with a null velocity");
|
Validate.notNull(velocity, "Can not spawn arrow with a null velocity");
|
||||||
Validate.notNull(clazz, "Can not spawn an arrow with no class");
|
Validate.notNull(clazz, "Can not spawn an arrow with no class");
|
||||||
|
@ -235,6 +235,12 @@ public class Commodore
|
|||||||
super.visitMethodInsn( opcode, owner, name, "(I)Lorg/bukkit/map/MapView;", itf );
|
super.visitMethodInsn( opcode, owner, name, "(I)Lorg/bukkit/map/MapView;", itf );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if ( owner.equals( "org/bukkit/World" ) && name.equals( "spawnArrow" ) )
|
||||||
|
{
|
||||||
|
// Should be same size on stack so just call other method
|
||||||
|
super.visitMethodInsn( opcode, owner, name, desc.replace( "Lorg/bukkit/entity/Arrow;", "Lorg/bukkit/entity/AbstractArrow;" ), itf );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ( modern )
|
if ( modern )
|
||||||
{
|
{
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren