SteamWar/BauSystem
Archiviert
13
0

Tracer-entity #147

Manuell gemergt
YoyoNow hat 47 Commits von Tracer-entity nach master 2020-12-27 22:16:04 +01:00 zusammengeführt
8 geänderte Dateien mit 166 neuen und 8 gelöschten Zeilen
Nur Änderungen aus Commit 1dd0bd7418 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -0,0 +1,31 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bausystem.tracer;
import org.bukkit.World;
import org.bukkit.entity.Player;
public class TNTEntityFactory_12 {
public static AbstractTNTEntity create(World world, TNTPosition tntPosition, Player player) {
return new TNTEntity_12(world, tntPosition, player);
}
}

Datei anzeigen

@ -1,3 +1,22 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bausystem.tracer;
import net.minecraft.server.v1_12_R1.*;
@ -6,7 +25,7 @@ import org.bukkit.craftbukkit.v1_12_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
public class TNTEntity_12 extends EntityFallingBlock implements AbstractTNTEntity {
class TNTEntity_12 extends EntityFallingBlock implements AbstractTNTEntity {
private TNTPosition position;
@ -49,6 +68,9 @@ public class TNTEntity_12 extends EntityFallingBlock implements AbstractTNTEntit
@Override
public AbstractTNTEntity hide(Player player) {
PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(getId());
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packetPlayOutEntityDestroy);
return this;
}
@ -56,4 +78,5 @@ public class TNTEntity_12 extends EntityFallingBlock implements AbstractTNTEntit
public void remove() {
killEntity();
}
}

Datei anzeigen

@ -0,0 +1,31 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bausystem.tracer;
import org.bukkit.World;
import org.bukkit.entity.Player;
public class TNTEntityFactory_15 {
public static AbstractTNTEntity create(World world, TNTPosition tntPosition, Player player) {
return new TNTEntity_15(world, tntPosition, player);
}
}

Datei anzeigen

@ -1,3 +1,22 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bausystem.tracer;
import net.minecraft.server.v1_15_R1.*;
@ -6,7 +25,7 @@ import org.bukkit.craftbukkit.v1_15_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
public class TNTEntity_15 extends EntityFallingBlock implements AbstractTNTEntity {
class TNTEntity_15 extends EntityFallingBlock implements AbstractTNTEntity {
private static final Vec3D ZERO = new Vec3D(0, 0, 0);
private TNTPosition position;

Datei anzeigen

@ -1,3 +1,22 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bausystem.tracer;
import org.bukkit.entity.Player;

Datei anzeigen

@ -1,3 +1,22 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bausystem.tracer;
import java.lang.reflect.Field;

Datei anzeigen

@ -1,3 +1,22 @@
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bausystem.tracer;
import org.bukkit.entity.Entity;

Datei anzeigen

@ -1,9 +1,6 @@
package de.steamwar.bausystem.tracer.show.mode;
import de.steamwar.bausystem.tracer.AbstractTNTEntity;
import de.steamwar.bausystem.tracer.TNTEntity_12;
import de.steamwar.bausystem.tracer.TNTEntity_15;
import de.steamwar.bausystem.tracer.TNTPosition;
import de.steamwar.bausystem.tracer.*;
import de.steamwar.bausystem.tracer.show.ShowMode;
import de.steamwar.core.Core;
import org.bukkit.entity.Player;
@ -25,10 +22,10 @@ public class BasicShowMode implements ShowMode {
public void show(TNTPosition position) {
switch (Core.getVersion()) {
case 12:
// tntEntitySet.add(new TNTEntity_12(player.getWorld(), position, player));
tntEntitySet.add(TNTEntityFactory_12.create(player.getWorld(), position, player));
break;
default:
tntEntitySet.add(new TNTEntity_15(player.getWorld(), position, player));
tntEntitySet.add(TNTEntityFactory_15.create(player.getWorld(), position, player));
break;
}
}