, Function {
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/blue/lapis/pore/vault/PoreVaultInjector.java:
--------------------------------------------------------------------------------
1 | /*
2 | * PoreRT - A Bukkit to Sponge Bridge
3 | *
4 | * Copyright (c) 2016, Maxqia AGPLv3
5 | * Copyright (c) Contributors
6 | *
7 | * This program is free software: you can redistribute it and/or modify
8 | * it under the terms of the GNU Affero General Public License as published by
9 | * the Free Software Foundation, either version 3 of the License, or
10 | * (at your option) any later version.
11 | *
12 | * This program is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | * GNU Affero General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Affero General Public License
18 | * along with this program. If not, see .
19 | * An exception applies to this license, see the LICENSE file in the main directory for more information.
20 | */
21 |
22 | package blue.lapis.pore.vault;
23 |
24 | import blue.lapis.pore.Pore;
25 | import blue.lapis.pore.util.classloader.LocalClassLoader;
26 | import blue.lapis.pore.util.classloader.LocalReflectClassLoader;
27 |
28 | import org.apache.commons.io.IOUtils;
29 | import org.bukkit.plugin.Plugin;
30 |
31 | import java.net.URL;
32 |
33 | public class PoreVaultInjector {
34 |
35 | public static final String START = "blue.lapis.pore.vault.PoreVault";
36 | public static final String HOOK = START + "Hook";
37 |
38 | public static void inject() throws Exception {
39 | Plugin vault = Pore.getServer().getPluginManager().getPlugin("Vault");
40 | if (vault == null) return;
41 |
42 | ClassLoader loader = vault.getClass().getClassLoader();
43 | LocalClassLoader injector = new LocalReflectClassLoader(loader);
44 | for (String addition : new String[]{"Hook", "Chat", "Economy", "Permissions"}) {
45 | String name = START + addition;
46 | URL url = Pore.class.getClassLoader().getResource(name.replace('.', '/') + ".class");
47 | byte[] clazz = IOUtils.toByteArray(url);
48 | injector.defineClass(name, clazz);
49 | }
50 | Class.forName(HOOK, true, loader).getMethod("hook").invoke(null);
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src/main/java/org/spigotmc/LimitStream.java:
--------------------------------------------------------------------------------
1 | /*
2 | * PoreRT - A Bukkit to Sponge Bridge
3 | *
4 | * Copyright (c) 2016, Maxqia AGPLv3
5 | * Copyright (c) Spigot/Craftbukkit Project LGPLv3
6 | * Copyright (c) Contributors
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU Affero General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU Affero General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU Affero General Public License
19 | * along with this program. If not, see .
20 | * An exception applies to this license, see the LICENSE file in the main directory for more information.
21 | */
22 |
23 | package org.spigotmc;
24 |
25 | import net.minecraft.nbt.NBTSizeTracker;
26 |
27 | import java.io.FilterInputStream;
28 | import java.io.IOException;
29 | import java.io.InputStream;
30 |
31 | public class LimitStream extends FilterInputStream {
32 |
33 | private final NBTSizeTracker limit;
34 |
35 | public LimitStream(InputStream is, NBTSizeTracker limit) {
36 | super( is );
37 | this.limit = limit;
38 | }
39 |
40 | @Override
41 | public int read() throws IOException {
42 | limit.read( 8 );
43 | return super.read();
44 | }
45 |
46 | @Override
47 | public int read(byte[] b) throws IOException {
48 | limit.read( b.length * 8 );
49 | return super.read( b );
50 | }
51 |
52 | @Override
53 | public int read(byte[] b, int off, int len) throws IOException {
54 | limit.read( len * 8 );
55 | return super.read( b, off, len );
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/main/java/org/spigotmc/SneakyThrow.java:
--------------------------------------------------------------------------------
1 | /*
2 | * PoreRT - A Bukkit to Sponge Bridge
3 | *
4 | * Copyright (c) 2016, Maxqia AGPLv3
5 | * Copyright (c) Spigot/Craftbukkit Project LGPLv3
6 | * Copyright (c) Contributors
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU Affero General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU Affero General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU Affero General Public License
19 | * along with this program. If not, see .
20 | * An exception applies to this license, see the LICENSE file in the main directory for more information.
21 | */
22 |
23 | package org.spigotmc;
24 |
25 | public class SneakyThrow {
26 |
27 | public static void sneaky(Throwable t) {
28 | throw SneakyThrow.superSneaky( t );
29 | }
30 |
31 | @SuppressWarnings("unchecked")
32 | private static T superSneaky(Throwable t) throws T {
33 | throw (T) t;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/resources/configurations/bukkit.yml:
--------------------------------------------------------------------------------
1 | # This is the main configuration file for Bukkit.
2 | # As you can see, there's actually not that much to configure without any plugins.
3 | # For a reference for any variable inside this file, check out the Bukkit Wiki at
4 | # http://wiki.bukkit.org/Bukkit.yml
5 | #
6 | # If you need help on this file, feel free to join us on irc or leave a message
7 | # on the forums asking for advice.
8 | #
9 | # IRC: #spigot @ irc.spi.gt
10 | # (If this means nothing to you, just go to http://www.spigotmc.org/pages/irc/ )
11 | # Forums: http://www.spigotmc.org/
12 | # Bug tracker: http://www.spigotmc.org/go/bugs
13 |
14 |
15 | settings:
16 | allow-end: true
17 | warn-on-overload: true
18 | permissions-file: permissions.yml
19 | update-folder: update
20 | plugin-profiling: false
21 | connection-throttle: 4000
22 | query-plugins: true
23 | deprecated-verbose: default
24 | shutdown-message: Server closed
25 | spawn-limits:
26 | monsters: 70
27 | animals: 15
28 | water-animals: 5
29 | ambient: 15
30 | chunk-gc:
31 | period-in-ticks: 600
32 | load-threshold: 0
33 | ticks-per:
34 | animal-spawns: 400
35 | monster-spawns: 1
36 | autosave: 6000
37 | aliases: now-in-commands.yml
38 |
--------------------------------------------------------------------------------
/src/main/resources/configurations/commands.yml:
--------------------------------------------------------------------------------
1 | # This is the commands configuration file for Bukkit.
2 | # For documentation on how to make use of this file, check out the Bukkit Wiki at
3 | # http://wiki.bukkit.org/Commands.yml
4 | #
5 | # If you need help on this file, feel free to join us on irc or leave a message
6 | # on the forums asking for advice.
7 | #
8 | # IRC: #spigot @ irc.spi.gt
9 | # (If this means nothing to you, just go to http://www.spigotmc.org/pages/irc/ )
10 | # Forums: http://www.spigotmc.org/
11 | # Bug tracker: http://www.spigotmc.org/go/bugs
12 |
13 | command-block-overrides: []
14 | unrestricted-advancements: false
15 | aliases:
16 | icanhasbukkit:
17 | - "version $1-"
18 |
--------------------------------------------------------------------------------
/src/main/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/main/resources/mixins.pore.bukkit.json:
--------------------------------------------------------------------------------
1 | {
2 | "package": "blue.lapis.pore.mixin",
3 | "refmap": "mixins.pore.refmap.json",
4 | "target": "@env(DEFAULT)",
5 | "compatibilityLevel": "JAVA_8",
6 | "mixins": [
7 | ],
8 | "injectors": {
9 | "defaultRequire": 1
10 | },
11 | "minVersion" : "0.6.1"
12 | }
--------------------------------------------------------------------------------
/src/main/resources/mixins.pore.core.json:
--------------------------------------------------------------------------------
1 | {
2 | "package": "blue.lapis.pore.mixin",
3 | "refmap": "mixins.pore.refmap.json",
4 | "target": "@env(DEFAULT)",
5 | "compatibilityLevel": "JAVA_8",
6 | "mixins": [
7 | "net.minecraft.entity.player.MixinEntityPlayerMP",
8 | "net.minecraft.network.MixinNetworkManager",
9 | "net.minecraft.network.MixinNetHandlerPlayServer",
10 | "net.minecraft.item.MixinItemStack"
11 | ],
12 | "injectors": {
13 | "defaultRequire": 1
14 | },
15 | "minVersion" : "0.6.1"
16 | }
--------------------------------------------------------------------------------
/src/main/resources/mixins.pore.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "package": "blue.lapis.pore.mixin",
3 | "refmap": "mixins.pore.refmap.json",
4 | "target": "@env(DEFAULT)",
5 | "compatibilityLevel": "JAVA_8",
6 | "mixins": [
7 | "org.apache.commons.lang3.MixinNotImplementedException"
8 | ],
9 | "injectors": {
10 | "defaultRequire": 1
11 | },
12 | "minVersion" : "0.6.1"
13 | }
--------------------------------------------------------------------------------
/src/main/resources/remap.txt:
--------------------------------------------------------------------------------
1 | org/bukkit/entity/Damageable _INVALID_damage(I)V damage
2 | org/bukkit/entity/Damageable _INVALID_damage(ILorg/bukkit/entity/Entity;)V damage
3 | org/bukkit/entity/Damageable _INVALID_getHealth()I getHealth
4 | org/bukkit/entity/Damageable _INVALID_setHealth(I)V setHealth
5 | org/bukkit/entity/Damageable _INVALID_getMaxHealth()I getMaxHealth
6 | org/bukkit/entity/Damageable _INVALID_setMaxHealth(I)V setMaxHealth
7 | org/bukkit/entity/LivingEntity _INVALID_getLastDamage()I getLastDamage
8 | org/bukkit/entity/LivingEntity _INVALID_setLastDamage(I)V setLastDamage
9 | org/bukkit/event/entity/EntityDamageEvent _INVALID_getDamage()I getDamage
10 | org/bukkit/event/entity/EntityDamageEvent _INVALID_setDamage(I)V setDamage
11 | org/bukkit/event/vehicle/VehicleDamageEvent _INVALID_getDamage()I getDamage
12 | org/bukkit/event/vehicle/VehicleDamageEvent _INVALID_setDamage(I)V setDamage
13 | org/bukkit/event/entity/EntityRegainHealthEvent _INVALID_getAmount()I getAmount
14 | org/bukkit/event/entity/EntityRegainHealthEvent _INVALID_setAmount(I)V setAmount
15 | org/bukkit/entity/Minecart _INVALID_getDamage()I getDamage
16 | org/bukkit/entity/Minecart _INVALID_setDamage(I)V setDamage
17 | org/bukkit/entity/Projectile _INVALID_getShooter()Lorg/bukkit/entity/LivingEntity; getShooter
18 | org/bukkit/entity/Projectile _INVALID_setShooter(Lorg/bukkit/entity/LivingEntity;)V setShooter
19 | org/bukkit/Bukkit _INVALID_getOnlinePlayers()[Lorg/bukkit/entity/Player; getOnlinePlayers
20 | org/bukkit/Server _INVALID_getOnlinePlayers()[Lorg/bukkit/entity/Player; getOnlinePlayers
21 |
--------------------------------------------------------------------------------