Skip to content

Commit

Permalink
1.3 Update
Browse files Browse the repository at this point in the history
Adds 1.8.3 support.
  • Loading branch information
eyesniper2 committed Mar 19, 2015
1 parent 66ceb87 commit 73d477b
Show file tree
Hide file tree
Showing 11 changed files with 168 additions and 35 deletions.
14 changes: 7 additions & 7 deletions dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.rayfall.eyesniper2</groupId>
<artifactId>skRayFall</artifactId>
<version>1.2.1</version>
<version>1.3</version>
<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -70,7 +70,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.8-R0.1-SNAPSHOT</version>
<version>1.8.3-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<exclusions>
<exclusion>
Expand All @@ -82,19 +82,19 @@
<dependency>
<groupId>net.citizensnpcs</groupId>
<artifactId>citizensapi</artifactId>
<version>2.0.14-SNAPSHOT</version>
<version>2.0.15-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.slikey</groupId>
<artifactId>effectlib</artifactId>
<version>2.4</version>
<version>3.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.8-R0.1-SNAPSHOT</version>
<version>1.8.3-R0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand All @@ -115,7 +115,7 @@
<artifactId>citizensnpcs</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>D:\Java Workbench\skRayFall/libs/citizens-2.0.14-SNAPSHOT.jar</systemPath>
<systemPath>D:\Java Workbench\skRayFall/libs/citizens-2.0.15-SNAPSHOT.jar</systemPath>
</dependency>
<dependency>
<groupId>ch.njol</groupId>
Expand All @@ -136,7 +136,7 @@
<artifactId>spigot</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>D:\Java Workbench\skRayFall/libs/spigot-1.8-R0.1-SNAPSHOT.jar</systemPath>
<systemPath>D:\Java Workbench\skRayFall/libs/spigot-1.8.3.jar</systemPath>
</dependency>
<dependency>
<groupId>org.eclipse.jdt</groupId>
Expand Down
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.8-R0.1-SNAPSHOT</version>
<version>1.8.3-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.citizensnpcs</groupId>
<artifactId>citizensapi</artifactId>
<version>2.0.14-SNAPSHOT</version>
<version>2.0.15-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -91,13 +91,13 @@
<dependency>
<groupId>de.slikey</groupId>
<artifactId>effectlib</artifactId>
<version>2.4</version>
<version>3.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.8-R0.1-SNAPSHOT</version>
<version>1.8.3-R0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.comphenix.protocol</groupId>
Expand All @@ -116,7 +116,7 @@
<artifactId>citizensnpcs</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/citizens-2.0.14-SNAPSHOT.jar</systemPath>
<systemPath>${project.basedir}/libs/citizens-2.0.15-SNAPSHOT.jar</systemPath>
</dependency>
<dependency>
<groupId>ch.njol</groupId>
Expand All @@ -137,13 +137,13 @@
<artifactId>spigot</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/spigot-1.8-R0.1-SNAPSHOT.jar</systemPath>
<systemPath>${project.basedir}/libs/spigot-1.8.3.jar</systemPath>
</dependency>
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.annotation</artifactId>
<version>1.1.0</version>
</dependency>
</dependencies>
<version>1.2.1</version>
<version>1.3</version>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package net.rayfall.eyesniper2.skRayFall.CitizenExpressions;

import net.citizensnpcs.api.CitizensAPI;
import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.api.npc.NPCRegistry;
import net.jrbudda.builder.BuilderTrait;

import org.bukkit.Location;
import org.bukkit.event.Event;
import org.eclipse.jdt.annotation.Nullable;

import ch.njol.skript.Skript;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.skript.lang.util.SimpleExpression;
import ch.njol.util.Kleenean;

public class ExprBottomRightSchematic extends SimpleExpression<Location>{

//for builder %number% get the location of the bottom right of schematic centered at %location%

private Expression<Number> id;
private Expression<Location> loc;

@Override
public Class<? extends Location> getReturnType() {
return Location.class;
}

@Override
public boolean isSingle() {
return true;
}

@SuppressWarnings("unchecked")
@Override
public boolean init(Expression<?>[] e, int arg1, Kleenean arg2,
ParseResult arg3) {
id = (Expression<Number>) e[0];
loc = (Expression<Location>) e[1];
return true;
}

@Override
public String toString(@Nullable Event evt, boolean arg1) {
return null;
}

@Override
@Nullable
protected Location[] get(Event evt) {
NPCRegistry registry = CitizensAPI.getNPCRegistry();
NPC npc = registry.getById(id.getSingle(evt).intValue());
BuilderTrait bt = npc.getTrait(BuilderTrait.class);
if (bt.schematic != null){
Location bottomRight = loc.getSingle(evt).add((-1 * Math.floor(bt.schematic.width() / 2)), -1, (-1 * Math.floor(bt.schematic.length() / 2)));
return new Location[] {bottomRight};
}
else{
Skript.error("A schematic has yet to be loaded for this Builder");
return new Location[] {loc.getSingle(evt)};
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package net.rayfall.eyesniper2.skRayFall.CitizenExpressions;

import net.citizensnpcs.api.CitizensAPI;
import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.api.npc.NPCRegistry;
import net.jrbudda.builder.BuilderTrait;

import org.bukkit.Location;
import org.bukkit.event.Event;
import org.eclipse.jdt.annotation.Nullable;

import ch.njol.skript.Skript;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.skript.lang.util.SimpleExpression;
import ch.njol.util.Kleenean;

public class ExprTopLeftSchematic extends SimpleExpression<Location>{

private Expression<Number> id;
private Expression<Location> loc;

//for builder %number% get the location of the top left of schematic centered at %location%

@Override
public Class<? extends Location> getReturnType() {
return Location.class;
}

@Override
public boolean isSingle() {
return true;
}

@SuppressWarnings("unchecked")
@Override
public boolean init(Expression<?>[] e, int arg1, Kleenean arg2,
ParseResult arg3) {
id = (Expression<Number>) e[0];
loc = (Expression<Location>) e[1];
return true;
}

@Override
public String toString(@Nullable Event evt, boolean arg1) {
return null;
}

@Override
@Nullable
protected Location[] get(Event evt) {
NPCRegistry registry = CitizensAPI.getNPCRegistry();
NPC npc = registry.getById(id.getSingle(evt).intValue());
BuilderTrait bt = npc.getTrait(BuilderTrait.class);
if (bt.schematic != null){
Location topLeft = loc.getSingle(evt).add((Math.round(bt.schematic.width() / 2)), bt.schematic.height() - 1, (Math.round(bt.schematic.length() / 2)));
return new Location[] {topLeft};
}
else{
Skript.error("A schematic has yet to be loaded for this Builder");
return new Location[] {loc.getSingle(evt)};
}
}

}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package net.rayfall.eyesniper2.skRayFall.GeneralEffects;

import net.minecraft.server.v1_8_R1.PacketPlayOutWorldParticles;
import net.minecraft.server.v1_8_R2.PacketPlayOutWorldParticles;
import net.rayfall.eyesniper2.skRayFall.utli.PacketParticleGetter;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.eclipse.jdt.annotation.Nullable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package net.rayfall.eyesniper2.skRayFall.Titles;

import net.minecraft.server.v1_8_R1.ChatSerializer;
import net.minecraft.server.v1_8_R1.IChatBaseComponent;
import net.minecraft.server.v1_8_R1.PacketPlayOutChat;
import net.minecraft.server.v1_8_R2.IChatBaseComponent;
import net.minecraft.server.v1_8_R2.IChatBaseComponent.ChatSerializer;
import net.minecraft.server.v1_8_R2.PacketPlayOutChat;

import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.eclipse.jdt.annotation.Nullable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import java.lang.reflect.Field;

import net.minecraft.server.v1_8_R1.ChatSerializer;
import net.minecraft.server.v1_8_R1.IChatBaseComponent;
import net.minecraft.server.v1_8_R1.PacketPlayOutPlayerListHeaderFooter;
import net.minecraft.server.v1_8_R2.IChatBaseComponent;
import net.minecraft.server.v1_8_R2.IChatBaseComponent.ChatSerializer;
import net.minecraft.server.v1_8_R2.PacketPlayOutPlayerListHeaderFooter;

import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.eclipse.jdt.annotation.Nullable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package net.rayfall.eyesniper2.skRayFall.Titles;

import net.minecraft.server.v1_8_R1.ChatSerializer;
import net.minecraft.server.v1_8_R1.EnumTitleAction;
import net.minecraft.server.v1_8_R1.IChatBaseComponent;
import net.minecraft.server.v1_8_R1.PacketPlayOutTitle;
import net.minecraft.server.v1_8_R1.PlayerConnection;
import net.minecraft.server.v1_8_R2.IChatBaseComponent;
import net.minecraft.server.v1_8_R2.IChatBaseComponent.ChatSerializer;
import net.minecraft.server.v1_8_R2.PacketPlayOutTitle;
import net.minecraft.server.v1_8_R2.PacketPlayOutTitle.EnumTitleAction;
import net.minecraft.server.v1_8_R2.PlayerConnection;

import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.eclipse.jdt.annotation.Nullable;
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/net/rayfall/eyesniper2/skRayFall/skRayFall.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
import net.rayfall.eyesniper2.skRayFall.CitizenEffects.EffSetCitizenName;
import net.rayfall.eyesniper2.skRayFall.CitizenEffects.EffSpawnCitizen;
import net.rayfall.eyesniper2.skRayFall.CitizenEffects.EffStartBuilderBuild;
import net.rayfall.eyesniper2.skRayFall.CitizenExpressions.ExprBottomRightSchematic;
import net.rayfall.eyesniper2.skRayFall.CitizenExpressions.ExprGeneralCitizen;
import net.rayfall.eyesniper2.skRayFall.CitizenExpressions.ExprLastCitizen;
import net.rayfall.eyesniper2.skRayFall.CitizenExpressions.ExprNameOfCitizen;
import net.rayfall.eyesniper2.skRayFall.CitizenExpressions.ExprTopLeftSchematic;
import net.rayfall.eyesniper2.skRayFall.Commands.EffectLibCommands;
import net.rayfall.eyesniper2.skRayFall.EffectLib.EffBasicEffectLib;
import net.rayfall.eyesniper2.skRayFall.EffectLib.EffEffectLibAtom;
import net.rayfall.eyesniper2.skRayFall.EffectLib.EffEffectLibBleed;
import net.rayfall.eyesniper2.skRayFall.EffectLib.EffGeneralEffectLib;
import net.rayfall.eyesniper2.skRayFall.GeneralEffects.EffMaxHealth;
import net.rayfall.eyesniper2.skRayFall.GeneralEffects.EffParticles;
import net.rayfall.eyesniper2.skRayFall.GeneralEffects.EffPlaySoundPacket;
Expand All @@ -53,6 +54,7 @@
import net.rayfall.eyesniper2.skRayFall.utli.ProtocolLibUtli;

import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
Expand Down Expand Up @@ -162,6 +164,8 @@ public NPC get(NPCDeathEvent NPCDeathEvent) {
if(getServer().getPluginManager().isPluginEnabled("Builder")){
getLogger().info("Getting bacon sandwiches for builders!");
Skript.registerEffect(EffStartBuilderBuild.class, "make citizen %number% build %string% at %location% [speed %number%] for %player%");
Skript.registerExpression(ExprTopLeftSchematic.class, Location.class, ExpressionType.SIMPLE, "for builder %number% get the location of the top left of schematic centered at %location%");
Skript.registerExpression(ExprBottomRightSchematic.class, Location.class, ExpressionType.SIMPLE, "for builder %number% get the location of the bottom right of schematic centered at %location%");
}
}
else{
Expand All @@ -175,8 +179,7 @@ public NPC get(NPCDeathEvent NPCDeathEvent) {
getLogger().info("Got bacon for the EffectLib partical ninjas!");
EffectLib lib = EffectLib.instance();
effectManager = new EffectManager(lib);
//to be added in the next update
Skript.registerEffect(EffGeneralEffectLib.class, "(spawn|create|apply) effectlib effect %string% (at|on|to) [the] %entities/location% for %timespan%");
//more stuff to be added
Skript.registerEffect(EffEffectLibAtom.class, "(spawn|create|apply) the atom (formation|effect) (at|on|to) [the] %entities/location% for %timespan%");
Skript.registerEffect(EffEffectLibBleed.class, "(spawn|create|apply) the bleed (formation|effect) (at|on|to) [the] %entities/location% for %timespan%");
Skript.registerEffect(EffBasicEffectLib.class,"spawn formation %string% at %location% for %timespan%");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package net.rayfall.eyesniper2.skRayFall.utli;

import ch.njol.skript.Skript;
import net.minecraft.server.v1_8_R1.EnumParticle;
import net.minecraft.server.v1_8_R2.EnumParticle;

public class PacketParticleGetter {
public static EnumParticle get(String p) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: An addon for skript that adds Citizens support, EffectLib support a
author: eyesniper2
website: http://rayfall.net/
main: net.rayfall.eyesniper2.skRayFall.skRayFall
version: 1.2.1
version: 1.3
depend: [Skript]
softdepend: [Citizens, EffectLib, Votifier, ProtocolLib, Builder]
commands:
Expand Down

0 comments on commit 73d477b

Please sign in to comment.