Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TorchLight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bukkit Plugin Requests
TorchLight
Commits
f81cd1c1
Commit
f81cd1c1
authored
10 years ago
by
Zandor Smith
Browse files
Options
Downloads
Patches
Plain Diff
+ Added main files.
parent
2d6c66bf
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pom.xml
+58
-0
58 additions, 0 deletions
pom.xml
src/main/java/com/zandor300/torchlight/TorchLight.java
+87
-0
87 additions, 0 deletions
src/main/java/com/zandor300/torchlight/TorchLight.java
with
145 additions
and
0 deletions
pom.xml
0 → 100644
+
58
−
0
View file @
f81cd1c1
<?xml version="1.0" encoding="UTF-8"?>
<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>
com.zandor300
</groupId>
<artifactId>
TorchLight
</artifactId>
<version>
1.8-1.0.0
</version>
<name>
TorchLight
</name>
<repositories>
<repository>
<id>
MavenPi
</id>
<url>
http://play.zsinfo.nl/maven
</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>
org.bukkit
</groupId>
<artifactId>
bukkit
</artifactId>
<type>
jar
</type>
<version>
1.8-R0.1-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
org.bukkit
</groupId>
<artifactId>
craftbukkit
</artifactId>
<type>
jar
</type>
<version>
1.8-R0.1-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.zandor300
</groupId>
<artifactId>
ZSUtilities
</artifactId>
<type>
jar
</type>
<version>
1.8-1.0.4.1
</version>
</dependency>
</dependencies>
<build>
<extensions>
<extension>
<groupId>
org.apache.maven.wagon
</groupId>
<artifactId>
wagon-ftp
</artifactId>
<version>
1.0-alpha-6
</version>
</extension>
</extensions>
</build>
<distributionManagement>
<repository>
<id>
MavenPi-FTP
</id>
<url>
ftp://192.168.1.18/var/www/maven
</url>
</repository>
</distributionManagement>
</project>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/main/java/com/zandor300/torchlight/TorchLight.java
0 → 100644
+
87
−
0
View file @
f81cd1c1
/**
* Copyright 2015 Zandor Smith
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com.zandor300.torchlight
;
import
com.zandor300.zsutilities.utilities.Chat
;
import
org.bukkit.Bukkit
;
import
org.bukkit.Location
;
import
org.bukkit.Material
;
import
org.bukkit.block.BlockState
;
import
org.bukkit.entity.Player
;
import
org.bukkit.plugin.PluginManager
;
import
org.bukkit.plugin.java.JavaPlugin
;
import
java.util.HashMap
;
/**
* @author Zandor Smith
* @since 1.0.0
*/
public
class
TorchLight
extends
JavaPlugin
{
private
static
HashMap
<
String
,
BlockState
>
playerState
=
new
HashMap
<
String
,
BlockState
>();
private
static
Chat
chat
=
new
Chat
(
"TorchLight"
);
private
static
TorchLight
plugin
;
@Override
public
void
onEnable
()
{
chat
.
sendConsoleMessage
(
"Setting things up..."
);
plugin
=
this
;
chat
.
sendConsoleMessage
(
"Starting timers..."
);
Bukkit
.
getScheduler
().
runTaskTimer
(
this
,
new
Runnable
()
{
@Override
public
void
run
()
{
for
(
Player
player
:
Bukkit
.
getOnlinePlayers
())
{
if
(!
player
.
getItemInHand
().
getType
().
equals
(
Material
.
TORCH
))
{
if
(
playerState
.
get
(
player
.
getName
())
!=
null
)
{
BlockState
state
=
playerState
.
get
(
player
.
getName
());
state
.
getLocation
().
getBlock
().
setType
(
state
.
getType
());
state
.
getLocation
().
getBlock
().
setData
(
state
.
getData
().
getData
());
}
playerState
.
put
(
player
.
getName
(),
null
);
}
else
{
BlockState
state
=
playerState
.
get
(
player
.
getName
());
state
.
getLocation
().
getBlock
().
setType
(
state
.
getType
());
state
.
getLocation
().
getBlock
().
setData
(
state
.
getData
().
getData
());
Location
location
=
new
Location
(
player
.
getWorld
(),
player
.
getLocation
().
getX
(),
player
.
getLocation
().
getY
()
-
1
,
player
.
getLocation
().
getZ
());
playerState
.
put
(
player
.
getName
(),
location
.
getBlock
().
getState
());
location
.
getBlock
().
setType
(
Material
.
GLOWSTONE
);
}
}
}
},
20
l
,
1
l
);
chat
.
sendConsoleMessage
(
"Timers started."
);
chat
.
sendConsoleMessage
(
"Everything is setup!"
);
chat
.
sendConsoleMessage
(
"Enabled."
);
}
@Override
public
void
onDisable
()
{
}
public
static
Chat
getChat
()
{
return
chat
;
}
public
static
TorchLight
getPlugin
()
{
return
plugin
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment