-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Merge branch 'refs/heads/master' into ridecounter-map-fixes
Showing
15 changed files
with
293 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/************************************************************************************************************ | ||
* GPLv3 License * | ||
* * | ||
* Copyright (c) 2024-2024 JVerbruggen * | ||
* https://github.com/JVerbruggen/jrides * | ||
* * | ||
* This software is protected under the GPLv3 license, * | ||
* that can be found in the project's LICENSE file. * | ||
* * | ||
* In short, permission is hereby granted that anyone can copy, modify and distribute this software. * | ||
* You have to include the license and copyright notice with each and every distribution. You can use * | ||
* this software privately or commercially. Modifications to the code have to be indicated, and * | ||
* distributions of this code must be distributed with the same license, GPLv3. The software is provided * | ||
* without warranty. The software author or license can not be held liable for any damages * | ||
* inflicted by the software. * | ||
************************************************************************************************************/ | ||
|
||
package com.jverbruggen.jrides.common; | ||
|
||
public class Tuple<A, B> { | ||
private A a; | ||
private B b; | ||
|
||
public Tuple(A var0, B var1) { | ||
this.a = var0; | ||
this.b = var1; | ||
} | ||
|
||
public A getA() { | ||
return this.a; | ||
} | ||
|
||
public void setA(A var0) { | ||
this.a = var0; | ||
} | ||
|
||
public B getB() { | ||
return this.b; | ||
} | ||
|
||
public void setB(B var0) { | ||
this.b = var0; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/com/jverbruggen/jrides/common/particle/Particle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/************************************************************************************************************ | ||
* GPLv3 License * | ||
* * | ||
* Copyright (c) 2024-2024 JVerbruggen * | ||
* https://github.com/JVerbruggen/jrides * | ||
* * | ||
* This software is protected under the GPLv3 license, * | ||
* that can be found in the project's LICENSE file. * | ||
* * | ||
* In short, permission is hereby granted that anyone can copy, modify and distribute this software. * | ||
* You have to include the license and copyright notice with each and every distribution. You can use * | ||
* this software privately or commercially. Modifications to the code have to be indicated, and * | ||
* distributions of this code must be distributed with the same license, GPLv3. The software is provided * | ||
* without warranty. The software author or license can not be held liable for any damages * | ||
* inflicted by the software. * | ||
************************************************************************************************************/ | ||
|
||
package com.jverbruggen.jrides.common.particle; | ||
|
||
public enum Particle { | ||
TRACK_PARTICLE, | ||
SECTION_DIVIDER_PARTICLE, | ||
TRAIN_HEAD_PARTICLE, | ||
TRAIN_TAIL_PARTICLE, | ||
CART_PARTICLE, | ||
CART_WHEEL_DISTANCE_PARTICLE | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/com/jverbruggen/jrides/common/particle/ParticleSpawner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/************************************************************************************************************ | ||
* GPLv3 License * | ||
* * | ||
* Copyright (c) 2024-2024 JVerbruggen * | ||
* https://github.com/JVerbruggen/jrides * | ||
* * | ||
* This software is protected under the GPLv3 license, * | ||
* that can be found in the project's LICENSE file. * | ||
* * | ||
* In short, permission is hereby granted that anyone can copy, modify and distribute this software. * | ||
* You have to include the license and copyright notice with each and every distribution. You can use * | ||
* this software privately or commercially. Modifications to the code have to be indicated, and * | ||
* distributions of this code must be distributed with the same license, GPLv3. The software is provided * | ||
* without warranty. The software author or license can not be held liable for any damages * | ||
* inflicted by the software. * | ||
************************************************************************************************************/ | ||
|
||
package com.jverbruggen.jrides.common.particle; | ||
|
||
import com.jverbruggen.jrides.models.entity.Player; | ||
import com.jverbruggen.jrides.models.math.Vector3; | ||
|
||
public interface ParticleSpawner { | ||
void spawnParticle(Player player, Particle particle, Vector3 location, int amount, double v0, double v1, double v2); | ||
} |
43 changes: 43 additions & 0 deletions
43
src/main/java/com/jverbruggen/jrides/common/particle/ParticleSpawnerFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/************************************************************************************************************ | ||
* GPLv3 License * | ||
* * | ||
* Copyright (c) 2024-2024 JVerbruggen * | ||
* https://github.com/JVerbruggen/jrides * | ||
* * | ||
* This software is protected under the GPLv3 license, * | ||
* that can be found in the project's LICENSE file. * | ||
* * | ||
* In short, permission is hereby granted that anyone can copy, modify and distribute this software. * | ||
* You have to include the license and copyright notice with each and every distribution. You can use * | ||
* this software privately or commercially. Modifications to the code have to be indicated, and * | ||
* distributions of this code must be distributed with the same license, GPLv3. The software is provided * | ||
* without warranty. The software author or license can not be held liable for any damages * | ||
* inflicted by the software. * | ||
************************************************************************************************************/ | ||
|
||
package com.jverbruggen.jrides.common.particle; | ||
|
||
import org.bukkit.Bukkit; | ||
|
||
public class ParticleSpawnerFactory { | ||
public static ParticleSpawner getParticleSpawner(){ | ||
String currentVersion = Bukkit.getVersion(); | ||
ParticleSpawner particleSpawner = null; | ||
|
||
if(currentVersion.contains("1.19.2") | ||
|| currentVersion.contains("1.20.1") | ||
|| currentVersion.contains("1.20.2") | ||
|| currentVersion.contains("1.20.3") | ||
|| currentVersion.contains("1.20.4")){ | ||
particleSpawner = new ParticleSpawner_Pre_1_20_5(); | ||
}else if(currentVersion.contains("1.20.5") | ||
|| currentVersion.contains("1.20.6")){ | ||
particleSpawner = new ParticleSpawner_1_20_5(); | ||
} | ||
|
||
if(particleSpawner == null) | ||
throw new RuntimeException("No particle spawner implemented for bukkit version '" + currentVersion + "'"); | ||
|
||
return particleSpawner; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/com/jverbruggen/jrides/common/particle/ParticleSpawner_1_20_5.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/************************************************************************************************************ | ||
* GPLv3 License * | ||
* * | ||
* Copyright (c) 2024-2024 JVerbruggen * | ||
* https://github.com/JVerbruggen/jrides * | ||
* * | ||
* This software is protected under the GPLv3 license, * | ||
* that can be found in the project's LICENSE file. * | ||
* * | ||
* In short, permission is hereby granted that anyone can copy, modify and distribute this software. * | ||
* You have to include the license and copyright notice with each and every distribution. You can use * | ||
* this software privately or commercially. Modifications to the code have to be indicated, and * | ||
* distributions of this code must be distributed with the same license, GPLv3. The software is provided * | ||
* without warranty. The software author or license can not be held liable for any damages * | ||
* inflicted by the software. * | ||
************************************************************************************************************/ | ||
|
||
package com.jverbruggen.jrides.common.particle; | ||
|
||
public class ParticleSpawner_1_20_5 extends ParticleSpawner_Pre_1_20_5 { | ||
|
||
@Override | ||
protected org.bukkit.Particle getBukkitParticle(Particle particle){ | ||
String particleName = switch (particle){ | ||
case TRACK_PARTICLE -> "HAPPY_VILLAGER"; | ||
case SECTION_DIVIDER_PARTICLE -> "CRIT"; | ||
case TRAIN_HEAD_PARTICLE -> "DRIPPING_WATER"; | ||
case TRAIN_TAIL_PARTICLE -> "DRIPPING_LAVA"; | ||
case CART_PARTICLE -> "HAPPY_VILLAGER"; | ||
case CART_WHEEL_DISTANCE_PARTICLE -> "HEART"; | ||
}; | ||
return org.bukkit.Particle.valueOf(particleName); | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
src/main/java/com/jverbruggen/jrides/common/particle/ParticleSpawner_Pre_1_20_5.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/************************************************************************************************************ | ||
* GPLv3 License * | ||
* * | ||
* Copyright (c) 2024-2024 JVerbruggen * | ||
* https://github.com/JVerbruggen/jrides * | ||
* * | ||
* This software is protected under the GPLv3 license, * | ||
* that can be found in the project's LICENSE file. * | ||
* * | ||
* In short, permission is hereby granted that anyone can copy, modify and distribute this software. * | ||
* You have to include the license and copyright notice with each and every distribution. You can use * | ||
* this software privately or commercially. Modifications to the code have to be indicated, and * | ||
* distributions of this code must be distributed with the same license, GPLv3. The software is provided * | ||
* without warranty. The software author or license can not be held liable for any damages * | ||
* inflicted by the software. * | ||
************************************************************************************************************/ | ||
|
||
package com.jverbruggen.jrides.common.particle; | ||
|
||
import com.jverbruggen.jrides.JRidesPlugin; | ||
import com.jverbruggen.jrides.models.entity.Player; | ||
import com.jverbruggen.jrides.models.math.Vector3; | ||
|
||
public class ParticleSpawner_Pre_1_20_5 implements ParticleSpawner{ | ||
|
||
protected org.bukkit.Particle getBukkitParticle(Particle particle){ | ||
String particleName = switch (particle){ | ||
case TRACK_PARTICLE -> "VILLAGER_HAPPY"; | ||
case SECTION_DIVIDER_PARTICLE -> "CRIT_MAGIC"; | ||
case TRAIN_HEAD_PARTICLE -> "DRIP_WATER"; | ||
case TRAIN_TAIL_PARTICLE -> "DRIP_LAVA"; | ||
case CART_PARTICLE -> "VILLAGER_HAPPY"; | ||
case CART_WHEEL_DISTANCE_PARTICLE -> "HEART"; | ||
}; | ||
return org.bukkit.Particle.valueOf(particleName); | ||
} | ||
|
||
@Override | ||
public void spawnParticle(Player player, Particle particle, Vector3 location, int amount, double v0, double v1, double v2) { | ||
player.getBukkitPlayer().spawnParticle( | ||
getBukkitParticle(particle), | ||
location.toBukkitLocation(JRidesPlugin.getWorld()), | ||
amount, v0, v1, v2, 0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters