Fix Particle

This commit is contained in:
2024-12-01 17:12:48 +01:00
parent 37072b1f49
commit 47cca70d95
7 changed files with 89 additions and 12 deletions
@@ -23,6 +23,7 @@ import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.region.Point;
import de.steamwar.bausystem.region.Region;
import de.steamwar.bausystem.region.utils.RegionType;
import de.steamwar.core.TrickyParticleWrapper;
import de.steamwar.core.TrickyTrialsWrapper;
import de.steamwar.linkage.Linked;
import org.bukkit.Bukkit;
@@ -57,7 +58,7 @@ public class BoundaryViewer implements Listener {
}
private void showRegion(Region region, Player player) {
drawCuboid(player, TrickyTrialsWrapper.impl.getVillagerHappyParticle(), region.getMinPoint(), region.getMaxPoint());
drawCuboid(player, TrickyParticleWrapper.impl.getVillagerHappy(), region.getMinPoint(), region.getMaxPoint());
if (region.hasType(RegionType.TESTBLOCK)) {
drawCuboid(player, Particle.END_ROD, region.getMinPointTestblockExtension(), region.getMaxPointTestblockExtension());
}
@@ -0,0 +1,29 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2024 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.core;
import org.bukkit.Particle;
public class TrickyParticleWrapper21 implements TrickyParticleWrapper {
@Override
public Particle getVillagerHappy() {
return Particle.HAPPY_VILLAGER;
}
}
@@ -41,11 +41,6 @@ public class TrickyTrialsWrapper21 implements TrickyTrialsWrapper {
return Material.TURTLE_SCUTE;
}
@Override
public Particle getVillagerHappyParticle() {
return Particle.HAPPY_VILLAGER;
}
@Override
public String getInventoryTitle(InventoryView view) {
return view.getTitle();
@@ -0,0 +1,29 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2024 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.core;
import org.bukkit.Particle;
public class TrickyParticleWrapper9 implements TrickyParticleWrapper {
@Override
public Particle getVillagerHappy() {
return Particle.VILLAGER_HAPPY;
}
}
@@ -0,0 +1,28 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2024 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.core;
import org.bukkit.Particle;
public interface TrickyParticleWrapper {
public TrickyParticleWrapper impl = VersionDependent.getVersionImpl(Core.getInstance());
Particle getVillagerHappy();
}
@@ -20,7 +20,6 @@
package de.steamwar.core;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.EntityType;
import org.bukkit.inventory.InventoryView;
@@ -34,9 +33,5 @@ public interface TrickyTrialsWrapper {
Material getTurtleScute();
default Particle getVillagerHappyParticle() {
return Particle.VILLAGER_HAPPY;
}
String getInventoryTitle(InventoryView view);
}
@@ -68,7 +68,7 @@ public class WorldEditRenderer {
Transform transform = session.getClipboard().getTransform();
Vector a = WorldEditWrapper.impl.applyTransform(WorldEditWrapper.impl.getMinimum(region).subtract(WorldEditWrapper.impl.getOrigin(clipboard)), transform).add(pos);
Vector b = WorldEditWrapper.impl.applyTransform(WorldEditWrapper.impl.getMaximum(region).subtract(WorldEditWrapper.impl.getOrigin(clipboard)), transform).add(pos);
drawCuboid(Vector.getMinimum(a, b), Vector.getMaximum(a, b), TrickyTrialsWrapper.impl.getVillagerHappyParticle(), player);
drawCuboid(Vector.getMinimum(a, b), Vector.getMaximum(a, b), TrickyParticleWrapper.impl.getVillagerHappy(), player);
} catch (EmptyClipboardException e) {
//ignore
}