Made fix for #127

This commit is contained in:
Sekwah 2018-08-30 01:53:17 +01:00
parent accfda8d90
commit 24d0f4719d
5 changed files with 8 additions and 5 deletions

View File

@ -4,7 +4,7 @@ apply plugin: 'idea'
apply plugin: 'eclipse'
group = 'com.sekwah.advancedportals'
version = '0.0.47-snapshot'
version = '0.0.48-snapshot'
description = ""

View File

@ -69,6 +69,8 @@ BlockSpectatorMode: false
PortalCooldown: 5 # How long after trying to enter a portal until the player can try to enter another. 0 or lower to deactivate.
ThrowbackAmount: 0.7 # How fast to throw them back, 0 or lower to disable throwback
DisableGatewayBeam: true
# Letters are flags. Include them to activate. n always disables everything, remove if you want it to work.
# Lettering may not make too much sense but meh its useful. Examples are "ocpk" or "cop" (doesnt matter order)
#

View File

@ -1,6 +1,6 @@
main: com.sekwah.advancedportals.AdvancedPortalsPlugin
name: AdvancedPortals
version: 0.0.46
version: 0.0.48
author: sekwah41
description: An advanced portals plugin for bukkit.
api-version: 1.13

View File

@ -86,6 +86,7 @@ public class CraftBukkit {
if(field.getType() == int.class && !field.isAccessible()) {
field.setAccessible(true);
getEntityTimeoutField = field;
this.plugin.getLogger().info("Got field " + field.getName() + " from TileEntityEndGateway");
return;
}
}
@ -143,11 +144,11 @@ public class CraftBukkit {
* @param block
*/
public void setGatewayAgeHigh(Block block) {
if(block.getState().getClass().isAssignableFrom(this.endGatewayClass)) {
if(this.endGatewayClass.isAssignableFrom(block.getState().getClass())) {
try {
Object tileEntity = this.getTileEntityMethod.invoke(this.getWorldHandleMethod.invoke(block.getWorld()),
this.blockPositionConstructor.newInstance(block.getX(), block.getY(), block.getZ()));
if(tileEntity.getClass().isAssignableFrom(this.tileEntityEndGatewayClass)) {
if(this.tileEntityEndGatewayClass.isAssignableFrom(tileEntity.getClass())) {
getEntityTimeoutField.set(tileEntity, Integer.MAX_VALUE);
}
} catch (IllegalAccessException| InvocationTargetException | InstantiationException e) {

View File

@ -1,6 +1,6 @@
main: com.sekwah.advancedportals.AdvancedPortalsPlugin
name: AdvancedPortals
version: 0.0.47
version: 0.0.48
author: sekwah41
description: An advanced portals plugin for bukkit.
api-version: 1.13