Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 36 additions & 8 deletions .classpath
Original file line number Diff line number Diff line change
@@ -1,8 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="N:/bukkit spigot code/SPIGOT buildtools/5/craftbukkit-1.8.8.jar"/>
<classpathentry kind="lib" path="N:/bukkit spigot code/plugin libs/Clearlag v2.8.3.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.class
/bin/
/debug code.txt
/debug code.txt
/.vscode/
51 changes: 34 additions & 17 deletions .project
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>itemstay-master</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>PlotMe</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
<filteredResources>
<filter>
<id>1624448535208</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
3 changes: 3 additions & 0 deletions .settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
encoding/src=UTF-8
2 changes: 2 additions & 0 deletions .settings/org.eclipse.jdt.apt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=false
9 changes: 9 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
4 changes: 4 additions & 0 deletions .settings/org.eclipse.m2e.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "automatic"
}
Binary file added lib/Clearlag.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: ItemStay
main: me.nighteyes604.ItemStay.ItemStay
version: 1.5.6
version: 2.0.0
api-version: '1.16'
description: A plugin allowing users to create item displays.
softdepend: [Multiverse-Core, Multiworld]
load: POSTWORLD
Expand Down
88 changes: 88 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>me.nighteyes604.ItemStay</groupId>
<artifactId>itemstay</artifactId>
<version>2.0.0</version>
<name>ItemStay</name>
<url>http://dev.bukkit.org/bukkit-mods/plotme/</url>
<build>
<defaultGoal>clean package install</defaultGoal>
<finalName>ItemStay</finalName>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<configuration>
<artifactSet>
</artifactSet>
<relocations>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<targetPath>.</targetPath>
<filtering>true</filtering>
<directory>.</directory>
<includes>
<include>plugin.yml</include>
</includes>
</resource>
</resources>
</build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public</url>
<releases>
<updatePolicy>always</updatePolicy>
</releases>
<snapshots>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<!-- <type>jar</type> -->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.minebuilders</groupId>
<artifactId>clearlag-core</artifactId>
<version>2.9.7</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/Clearlag.jar</systemPath>
</dependency>
</dependencies>
</project>
7 changes: 4 additions & 3 deletions src/me/nighteyes604/ItemStay/FrozenItem.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package me.nighteyes604.ItemStay;

import java.util.Locale;

import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.Damageable;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.util.Vector;

Expand Down Expand Up @@ -77,7 +77,7 @@ void respawn()
}
}

void destroy()
public void destroy()
{
if (!hasWorldAndChunk())
return;
Expand All @@ -103,7 +103,8 @@ private void removeDuplicateItems()

private void place()
{
ItemStack stack = new ItemStack(material, 1, data);
ItemStack stack = new ItemStack(material, 1);
((Damageable)stack.getItemMeta()).setDamage(data);
item = location.getWorld().dropItem(new Location(location.getWorld(), location.getX() + dropOffset.getX(), location.getY() + dropOffset.getY(), location.getZ() + dropOffset.getZ()), stack);

ItemMeta m = item.getItemStack().getItemMeta();
Expand Down
22 changes: 6 additions & 16 deletions src/me/nighteyes604/ItemStay/ItemStay.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.Damageable;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.scheduler.BukkitTask;
Expand Down Expand Up @@ -305,8 +306,8 @@ public QInfo registerItem(String owner, Item item)
return new QInfo(fi.getId(), QResult.LOCATION_TAKEN);
}
}

frozenItems.add(new FrozenItem(owner, item.getItemStack().getType(), item.getItemStack().getDurability(), item.getLocation().getWorld().getName(), item.getLocation().getBlockX(), item.getLocation().getBlockY(), item.getLocation().getBlockZ()));
short damage = (short)((Damageable)item.getItemStack().getItemMeta()).getDamage();
frozenItems.add(new FrozenItem(owner, item.getItemStack().getType(), damage, item.getLocation().getWorld().getName(), item.getLocation().getBlockX(), item.getLocation().getBlockY(), item.getLocation().getBlockZ()));
save();
FrozenItem newfi = frozenItems.get(frozenItems.size() - 1);
newfi.respawn();
Expand Down Expand Up @@ -334,8 +335,8 @@ public QInfo registerItem(String owner, ItemStack itemStack, Location location)
return new QInfo(fi.getId(), QResult.LOCATION_TAKEN);
}
}

frozenItems.add(new FrozenItem(owner, itemStack.getType(), itemStack.getDurability(), location.getWorld().getName(), location.getBlockX(), location.getBlockY(), location.getBlockZ()));
short damage = (short)((Damageable)itemStack.getItemMeta()).getDamage();
frozenItems.add(new FrozenItem(owner, itemStack.getType(), damage, location.getWorld().getName(), location.getBlockX(), location.getBlockY(), location.getBlockZ()));
save();
FrozenItem newfi = frozenItems.get(frozenItems.size() - 1);
newfi.respawn();
Expand Down Expand Up @@ -507,7 +508,6 @@ void save()
}
}

@SuppressWarnings("deprecation")
private void loadDataFile()
{
File folder = getDataFolder();
Expand Down Expand Up @@ -564,17 +564,7 @@ private void loadDataFile()
offset = 1;

Material mat;
try
{
//old system, numeric id
mat = Material.getMaterial(Integer.parseInt(lineBits[5 + offset]));
}
catch (NumberFormatException e)
{
//new system, mat name
mat = Material.getMaterial(lineBits[5 + offset]);
}

mat = Material.getMaterial(lineBits[5 + offset]);
short data = Short.valueOf(lineBits[6 + offset]);

FrozenItem fi = new FrozenItem(player, mat, data, lineBits[1], x, y, z);
Expand Down
Loading