Skip to content

Commit

Permalink
Init.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dalton Caron committed Aug 28, 2020
0 parents commit 0214783
Show file tree
Hide file tree
Showing 12 changed files with 1,441 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Emacs/vim

*~
*.swp

# VSCode

.vscode
.classpath
.project
.settings/


# MacOS

.DS_Store

# Maven (from: https://github.com/github/gitignore/blob/master/Maven.gitignore)

target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar

# Java (from: https://github.com/github/gitignore/blob/master/Java.gitignore)

# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Porte Coulissante by Captain_Chaos

This is a fork of Porte Coulissante by Captain_Chaos that is updated to work for paper-spigot 1.16.2.
55 changes: 55 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.reliqcraft</groupId>
<artifactId>PorteCullisante</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>PorteCullisante</name>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>*.yml</include>
</includes>
</resource>
</resources>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>

<repositories>
<repository>
<id>papermc</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.destroystokyo.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.16.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
79 changes: 79 additions & 0 deletions src/main/java/org/reliqcraft/Directions.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
* PorteCoulissante - a Bukkit plugin for creating working portcullises
* Copyright 2010, 2012, 2014 Pepijn Schmitz
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.reliqcraft;

import org.bukkit.block.BlockFace;

/**
* Special directional constants class which provides compatibility with older
* versions of Bukkit in which the BlockFace directions were incorrect due to
* historical reasons.
*
* @author pepijn
*/
public final class Directions {
private Directions() {
// Prevent instantiation
}

/**
* This method is necessary to support Bukkit versions prior to 1.4.5, which
* had a different mapping from cardinal direction to axes.
*
* <strong>Does not work for diagonal directions!</strong>
*/
public static BlockFace actual(BlockFace direction) {
if (legacy) {
switch (direction) {
case WEST:
return BlockFace.NORTH;
case NORTH:
return BlockFace.EAST;
case EAST:
return BlockFace.SOUTH;
case SOUTH:
return BlockFace.WEST;
default:
return direction;
}
} else {
return direction;
}
}

public static final BlockFace ACTUAL_NORTH;
public static final BlockFace ACTUAL_EAST;
public static final BlockFace ACTUAL_SOUTH;
public static final BlockFace ACTUAL_WEST;

private static final boolean legacy = BlockFace.NORTH.getModX() == -1;

static {
if (legacy) {
ACTUAL_NORTH = BlockFace.EAST;
ACTUAL_EAST = BlockFace.SOUTH;
ACTUAL_SOUTH = BlockFace.WEST;
ACTUAL_WEST = BlockFace.NORTH;
} else {
ACTUAL_NORTH = BlockFace.NORTH;
ACTUAL_EAST = BlockFace.EAST;
ACTUAL_SOUTH = BlockFace.SOUTH;
ACTUAL_WEST = BlockFace.WEST;
}
}
}
126 changes: 126 additions & 0 deletions src/main/java/org/reliqcraft/Portcullis.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
/*
* PorteCoulissante - a Bukkit plugin for creating working portcullises
* Copyright 2010, 2012, 2014 Pepijn Schmitz
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.reliqcraft;

import org.bukkit.Material;
import org.bukkit.block.BlockFace;

/**
*
* @author pepijn
*/
public class Portcullis {
public Portcullis(String worldName, int x, int z, int y, int width, int height, BlockFace direction, Material type) {
this.worldName = worldName;
this.x = x;
this.z = z;
this.width = width;
this.height = height;
this.y = y;
this.direction = direction;
this.type = type;
}

public String getWorldName() {
return worldName;
}

public BlockFace getDirection() {
return direction;
}

public int getHeight() {
return height;
}

public int getWidth() {
return width;
}

public int getX() {
return x;
}

public int getY() {
return y;
}

public void setY(int y) {
this.y = y;
}

public int getZ() {
return z;
}

public Material getType() {
return type;
}

@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Portcullis other = (Portcullis) obj;
if ((this.worldName == null) ? (other.worldName != null) : !this.worldName.equals(other.worldName)) {
return false;
}
if (this.x != other.x) {
return false;
}
if (this.z != other.z) {
return false;
}
if (this.y != other.y) {
return false;
}
if (this.width != other.width) {
return false;
}
if (this.height != other.height) {
return false;
}
if (this.direction != other.direction) {
return false;
}
return true;
}

@Override
public int hashCode() {
int hash = 3;
hash = 29 * hash + (this.worldName != null ? this.worldName.hashCode() : 0);
hash = 29 * hash + this.x;
hash = 29 * hash + this.z;
hash = 29 * hash + this.y;
hash = 29 * hash + this.width;
hash = 29 * hash + this.height;
hash = 29 * hash + (this.direction != null ? this.direction.hashCode() : 0);
return hash;
}

private final String worldName;
private final int x, z, width, height;
private final Material type;
private int y;
private final BlockFace direction;
}
Loading

0 comments on commit 0214783

Please sign in to comment.