diff --git a/NCPCommons/src/main/java/fr/neatmonster/nocheatplus/logging/details/IGetStreamId.java b/NCPCommons/src/main/java/fr/neatmonster/nocheatplus/logging/details/IGetStreamId.java index 6631c060..23eeb885 100644 --- a/NCPCommons/src/main/java/fr/neatmonster/nocheatplus/logging/details/IGetStreamId.java +++ b/NCPCommons/src/main/java/fr/neatmonster/nocheatplus/logging/details/IGetStreamId.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.logging.details; import fr.neatmonster.nocheatplus.logging.StreamID; diff --git a/NCPCommons/src/main/java/fr/neatmonster/nocheatplus/logging/details/ILogString.java b/NCPCommons/src/main/java/fr/neatmonster/nocheatplus/logging/details/ILogString.java index cf749ee7..cd82400e 100644 --- a/NCPCommons/src/main/java/fr/neatmonster/nocheatplus/logging/details/ILogString.java +++ b/NCPCommons/src/main/java/fr/neatmonster/nocheatplus/logging/details/ILogString.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.logging.details; import java.util.logging.Level; diff --git a/NCPCommons/src/main/java/fr/neatmonster/nocheatplus/logging/details/ILogThrowable.java b/NCPCommons/src/main/java/fr/neatmonster/nocheatplus/logging/details/ILogThrowable.java index 1afc0ce3..1fb18a09 100644 --- a/NCPCommons/src/main/java/fr/neatmonster/nocheatplus/logging/details/ILogThrowable.java +++ b/NCPCommons/src/main/java/fr/neatmonster/nocheatplus/logging/details/ILogThrowable.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.logging.details; import java.util.logging.Level; diff --git a/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/IReflectBlock.java b/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/IReflectBlock.java index 8df767bc..0d22a8f4 100644 --- a/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/IReflectBlock.java +++ b/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/IReflectBlock.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.cbreflect.reflect; /** diff --git a/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/ReflectAttributeAccess.java b/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/ReflectAttributeAccess.java index 2f9aac4d..0caae353 100644 --- a/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/ReflectAttributeAccess.java +++ b/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/ReflectAttributeAccess.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.cbreflect.reflect; import java.lang.reflect.Field; diff --git a/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/ReflectAxisAlignedBB.java b/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/ReflectAxisAlignedBB.java index 25cb3d0f..169f2ff7 100644 --- a/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/ReflectAxisAlignedBB.java +++ b/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/ReflectAxisAlignedBB.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.cbreflect.reflect; import java.lang.reflect.Field; diff --git a/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/ReflectBlock.java b/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/ReflectBlock.java index ab9d936d..3c479661 100644 --- a/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/ReflectBlock.java +++ b/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/ReflectBlock.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.cbreflect.reflect; import java.lang.reflect.InvocationTargetException; diff --git a/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/ReflectIBlockAccess.java b/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/ReflectIBlockAccess.java index a609e7f7..9699152e 100644 --- a/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/ReflectIBlockAccess.java +++ b/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/ReflectIBlockAccess.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.cbreflect.reflect; public class ReflectIBlockAccess { diff --git a/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/ReflectIBlockData.java b/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/ReflectIBlockData.java index de3d24e1..335dd3fe 100644 --- a/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/ReflectIBlockData.java +++ b/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/cbreflect/reflect/ReflectIBlockData.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.cbreflect.reflect; import java.lang.reflect.InvocationTargetException; diff --git a/NCPCompatCB2794/src/main/java/fr/neatmonster/nocheatplus/compat/cb2794/AttributeAccess.java b/NCPCompatCB2794/src/main/java/fr/neatmonster/nocheatplus/compat/cb2794/AttributeAccess.java index bfc64b50..57bb5bf1 100644 --- a/NCPCompatCB2794/src/main/java/fr/neatmonster/nocheatplus/compat/cb2794/AttributeAccess.java +++ b/NCPCompatCB2794/src/main/java/fr/neatmonster/nocheatplus/compat/cb2794/AttributeAccess.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.cb2794; import org.bukkit.craftbukkit.v1_6_R1.entity.CraftLivingEntity; diff --git a/NCPCompatCB2808/src/main/java/fr/neatmonster/nocheatplus/compat/cb2808/AttributeAccess.java b/NCPCompatCB2808/src/main/java/fr/neatmonster/nocheatplus/compat/cb2808/AttributeAccess.java index a7c80e6b..047a00cd 100644 --- a/NCPCompatCB2808/src/main/java/fr/neatmonster/nocheatplus/compat/cb2808/AttributeAccess.java +++ b/NCPCompatCB2808/src/main/java/fr/neatmonster/nocheatplus/compat/cb2808/AttributeAccess.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.cb2808; import org.bukkit.craftbukkit.v1_6_R2.entity.CraftLivingEntity; diff --git a/NCPCompatCB2882/src/main/java/fr/neatmonster/nocheatplus/compat/cb2882/AttributeAccess.java b/NCPCompatCB2882/src/main/java/fr/neatmonster/nocheatplus/compat/cb2882/AttributeAccess.java index 7758d5ad..16b387a2 100644 --- a/NCPCompatCB2882/src/main/java/fr/neatmonster/nocheatplus/compat/cb2882/AttributeAccess.java +++ b/NCPCompatCB2882/src/main/java/fr/neatmonster/nocheatplus/compat/cb2882/AttributeAccess.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.cb2882; import org.bukkit.craftbukkit.v1_6_R3.entity.CraftLivingEntity; diff --git a/NCPCompatCB2922/src/main/java/fr/neatmonster/nocheatplus/compat/cb2922/AttributeAccess.java b/NCPCompatCB2922/src/main/java/fr/neatmonster/nocheatplus/compat/cb2922/AttributeAccess.java index 8fedb896..244f05dc 100644 --- a/NCPCompatCB2922/src/main/java/fr/neatmonster/nocheatplus/compat/cb2922/AttributeAccess.java +++ b/NCPCompatCB2922/src/main/java/fr/neatmonster/nocheatplus/compat/cb2922/AttributeAccess.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.cb2922; import org.bukkit.craftbukkit.v1_7_R1.entity.CraftLivingEntity; diff --git a/NCPCompatCB3026/src/main/java/fr/neatmonster/nocheatplus/compat/cb3026/AttributeAccess.java b/NCPCompatCB3026/src/main/java/fr/neatmonster/nocheatplus/compat/cb3026/AttributeAccess.java index 0f956214..93ec0869 100644 --- a/NCPCompatCB3026/src/main/java/fr/neatmonster/nocheatplus/compat/cb3026/AttributeAccess.java +++ b/NCPCompatCB3026/src/main/java/fr/neatmonster/nocheatplus/compat/cb3026/AttributeAccess.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.cb3026; import org.bukkit.craftbukkit.v1_7_R2.entity.CraftLivingEntity; diff --git a/NCPCompatCB3043/src/main/java/fr/neatmonster/nocheatplus/compat/cb3043/AttributeAccess.java b/NCPCompatCB3043/src/main/java/fr/neatmonster/nocheatplus/compat/cb3043/AttributeAccess.java index 556bee46..4d95899f 100644 --- a/NCPCompatCB3043/src/main/java/fr/neatmonster/nocheatplus/compat/cb3043/AttributeAccess.java +++ b/NCPCompatCB3043/src/main/java/fr/neatmonster/nocheatplus/compat/cb3043/AttributeAccess.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.cb3043; import org.bukkit.craftbukkit.v1_7_R3.entity.CraftLivingEntity; diff --git a/NCPCompatCB3100/src/main/java/fr/neatmonster/nocheatplus/compat/cb3100/AttributeAccess.java b/NCPCompatCB3100/src/main/java/fr/neatmonster/nocheatplus/compat/cb3100/AttributeAccess.java index d0030dcd..7517f9e1 100644 --- a/NCPCompatCB3100/src/main/java/fr/neatmonster/nocheatplus/compat/cb3100/AttributeAccess.java +++ b/NCPCompatCB3100/src/main/java/fr/neatmonster/nocheatplus/compat/cb3100/AttributeAccess.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.cb3100; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity; diff --git a/NCPCompatCBDev/src/main/java/fr/neatmonster/nocheatplus/compat/cbdev/AttributeAccess.java b/NCPCompatCBDev/src/main/java/fr/neatmonster/nocheatplus/compat/cbdev/AttributeAccess.java index c19c4d24..1c168b1c 100644 --- a/NCPCompatCBDev/src/main/java/fr/neatmonster/nocheatplus/compat/cbdev/AttributeAccess.java +++ b/NCPCompatCBDev/src/main/java/fr/neatmonster/nocheatplus/compat/cbdev/AttributeAccess.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.cbdev; import org.bukkit.craftbukkit.v1_10_R1.entity.CraftLivingEntity; diff --git a/NCPCompatSpigotCB1_8_R1/src/main/java/fr/neatmonster/nocheatplus/compat/spigotcb1_8_R1/AttributeAccess.java b/NCPCompatSpigotCB1_8_R1/src/main/java/fr/neatmonster/nocheatplus/compat/spigotcb1_8_R1/AttributeAccess.java index f0c92fd1..2a6ac305 100644 --- a/NCPCompatSpigotCB1_8_R1/src/main/java/fr/neatmonster/nocheatplus/compat/spigotcb1_8_R1/AttributeAccess.java +++ b/NCPCompatSpigotCB1_8_R1/src/main/java/fr/neatmonster/nocheatplus/compat/spigotcb1_8_R1/AttributeAccess.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.spigotcb1_8_R1; import org.bukkit.craftbukkit.v1_8_R1.entity.CraftLivingEntity; diff --git a/NCPCompatSpigotCB1_8_R2/src/main/java/fr/neatmonster/nocheatplus/compat/spigotcb1_8_R2/AttributeAccess.java b/NCPCompatSpigotCB1_8_R2/src/main/java/fr/neatmonster/nocheatplus/compat/spigotcb1_8_R2/AttributeAccess.java index e5af9c8c..0a4e9bcd 100644 --- a/NCPCompatSpigotCB1_8_R2/src/main/java/fr/neatmonster/nocheatplus/compat/spigotcb1_8_R2/AttributeAccess.java +++ b/NCPCompatSpigotCB1_8_R2/src/main/java/fr/neatmonster/nocheatplus/compat/spigotcb1_8_R2/AttributeAccess.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.spigotcb1_8_R2; import org.bukkit.craftbukkit.v1_8_R2.entity.CraftLivingEntity; diff --git a/NCPCompatSpigotCB1_8_R3/src/main/java/fr/neatmonster/nocheatplus/compat/spigotcb1_8_R3/AttributeAccess.java b/NCPCompatSpigotCB1_8_R3/src/main/java/fr/neatmonster/nocheatplus/compat/spigotcb1_8_R3/AttributeAccess.java index eef035a4..14753995 100644 --- a/NCPCompatSpigotCB1_8_R3/src/main/java/fr/neatmonster/nocheatplus/compat/spigotcb1_8_R3/AttributeAccess.java +++ b/NCPCompatSpigotCB1_8_R3/src/main/java/fr/neatmonster/nocheatplus/compat/spigotcb1_8_R3/AttributeAccess.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.spigotcb1_8_R3; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftLivingEntity; diff --git a/NCPCompatSpigotCB1_9_R1/src/main/java/fr/neatmonster/nocheatplus/compat/spigotcb1_9_R1/AttributeAccess.java b/NCPCompatSpigotCB1_9_R1/src/main/java/fr/neatmonster/nocheatplus/compat/spigotcb1_9_R1/AttributeAccess.java index be09bf08..259a5cdc 100644 --- a/NCPCompatSpigotCB1_9_R1/src/main/java/fr/neatmonster/nocheatplus/compat/spigotcb1_9_R1/AttributeAccess.java +++ b/NCPCompatSpigotCB1_9_R1/src/main/java/fr/neatmonster/nocheatplus/compat/spigotcb1_9_R1/AttributeAccess.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.spigotcb1_9_R1; import org.bukkit.craftbukkit.v1_9_R1.entity.CraftLivingEntity; diff --git a/NCPCompatSpigotCB1_9_R2/src/main/java/fr/neatmonster/nocheatplus/compat/spigotcb1_9_R2/AttributeAccess.java b/NCPCompatSpigotCB1_9_R2/src/main/java/fr/neatmonster/nocheatplus/compat/spigotcb1_9_R2/AttributeAccess.java index cc63c999..f2eb476c 100644 --- a/NCPCompatSpigotCB1_9_R2/src/main/java/fr/neatmonster/nocheatplus/compat/spigotcb1_9_R2/AttributeAccess.java +++ b/NCPCompatSpigotCB1_9_R2/src/main/java/fr/neatmonster/nocheatplus/compat/spigotcb1_9_R2/AttributeAccess.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.spigotcb1_9_R2; import org.bukkit.craftbukkit.v1_9_R2.entity.CraftLivingEntity; diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/IBridgeCrossPlugin.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/IBridgeCrossPlugin.java index f98a35b8..fcda0f69 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/IBridgeCrossPlugin.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/IBridgeCrossPlugin.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat; import org.bukkit.entity.Entity; diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_10.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_10.java index 58c82c93..d1a3b287 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_10.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_10.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.blocks.init.vanilla; import org.bukkit.Material; diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_5.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_5.java index 809d529a..c3fc281b 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_5.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_5.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.blocks.init.vanilla; import org.bukkit.Material; diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_6_1.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_6_1.java index 41dfd989..a2af4463 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_6_1.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_6_1.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.blocks.init.vanilla; import org.bukkit.Material; diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_7_2.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_7_2.java index d62729cf..0bbc469b 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_7_2.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_7_2.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.blocks.init.vanilla; import org.bukkit.Material; diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_8.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_8.java index db3102ee..3fca23ae 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_8.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_8.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.blocks.init.vanilla; import org.bukkit.Material; diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_9.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_9.java index e4c041c0..3523c89d 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_9.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/BlocksMC1_9.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.blocks.init.vanilla; import org.bukkit.Material; diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/VanillaBlocksFactory.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/VanillaBlocksFactory.java index 5af32414..82be432b 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/VanillaBlocksFactory.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/blocks/init/vanilla/VanillaBlocksFactory.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.blocks.init.vanilla; import java.util.Collection; diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/versions/Activation.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/versions/Activation.java index 7d9be705..dfe934f4 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/versions/Activation.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/compat/versions/Activation.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.versions; import java.util.LinkedList; diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/DisableListener.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/DisableListener.java index 2c282d8a..a20e1b93 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/DisableListener.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/DisableListener.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.components; /** diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/MCAccessHolder.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/MCAccessHolder.java index 7dc71345..ef2af3fd 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/MCAccessHolder.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/MCAccessHolder.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.components; /** diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/TickListener.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/TickListener.java index 3145ffae..a6e7e76b 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/TickListener.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/TickListener.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.components; /** diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/location/BlockPositionGet.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/location/BlockPositionGet.java index 18034574..909b044e 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/location/BlockPositionGet.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/location/BlockPositionGet.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.components.location; import fr.neatmonster.nocheatplus.utilities.ds.map.CoordHash; diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/location/IAddBlockPosition.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/location/IAddBlockPosition.java index 944107de..d297fd48 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/location/IAddBlockPosition.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/location/IAddBlockPosition.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.components.location; /** diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/location/IContainBlockPosition.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/location/IContainBlockPosition.java index eeab0358..aa06e64e 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/location/IContainBlockPosition.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/location/IContainBlockPosition.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.components.location; /** diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/modifier/DummyAttributeAccess.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/modifier/DummyAttributeAccess.java index 53c35621..1d4b1142 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/modifier/DummyAttributeAccess.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/modifier/DummyAttributeAccess.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.components.modifier; import org.bukkit.entity.Player; diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/modifier/IAttributeAccess.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/modifier/IAttributeAccess.java index 42cf91ff..2a1c4c91 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/modifier/IAttributeAccess.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/modifier/IAttributeAccess.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.components.modifier; import org.bukkit.entity.Player; diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/activation/IActivation.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/activation/IActivation.java index 9e9244f3..db5694d0 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/activation/IActivation.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/activation/IActivation.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.components.registry.activation; /** diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/activation/IDescriptiveActivation.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/activation/IDescriptiveActivation.java index 76e75cd7..ffd11fef 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/activation/IDescriptiveActivation.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/activation/IDescriptiveActivation.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.components.registry.activation; /** diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/event/IGenericInstanceHandle.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/event/IGenericInstanceHandle.java index 6abcc05e..e179cd10 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/event/IGenericInstanceHandle.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/event/IGenericInstanceHandle.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.components.registry.event; /** diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/event/IGenericInstanceRegistryListener.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/event/IGenericInstanceRegistryListener.java index c4005d52..04779aae 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/event/IGenericInstanceRegistryListener.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/event/IGenericInstanceRegistryListener.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.components.registry.event; /** diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/event/IUnregisterGenericInstanceListener.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/event/IUnregisterGenericInstanceListener.java index edace3ff..39a53ea3 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/event/IUnregisterGenericInstanceListener.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/event/IUnregisterGenericInstanceListener.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.components.registry.event; /** diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/feature/IPostRegisterRunnable.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/feature/IPostRegisterRunnable.java index d0fb74c0..1aee2aa0 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/feature/IPostRegisterRunnable.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/components/registry/feature/IPostRegisterRunnable.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.components.registry.feature; /** diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/AttribUtil.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/AttribUtil.java index c5c186ce..c1bea3c6 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/AttribUtil.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/AttribUtil.java @@ -16,15 +16,26 @@ package fr.neatmonster.nocheatplus.utilities; import java.util.UUID; +// TODO: Auto-generated Javadoc +/** + * The Class AttribUtil. + */ public class AttribUtil { + + /** The Constant ID_SPRINT_BOOST. */ public static final UUID ID_SPRINT_BOOST = IdUtil.UUIDFromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D"); /** * Get a multiplier for an AttributeModifier. - * @param operator Exclusively allows operator 2. Otherwise will throw an IllegalArgumentException. - * @param value The modifier value (AttributeModifier). - * @throws IllegalArgumentException if the modifier is not 2. + * + * @param operator + * Exclusively allows operator 2. Otherwise will throw an + * IllegalArgumentException. + * @param value + * The modifier value (AttributeModifier). * @return A multiplier for direct use. + * @throws IllegalArgumentException + * if the modifier is not 2. */ public static double getMultiplier(final int operator, final double value) { // TODO: Might allow 1 too, as it should "work", despite less accurate. diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/BlockCache.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/BlockCache.java index 5fe3fde7..769202b8 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/BlockCache.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/BlockCache.java @@ -24,6 +24,7 @@ import fr.neatmonster.nocheatplus.logging.Streams; import fr.neatmonster.nocheatplus.utilities.ds.map.CoordHashMap; import fr.neatmonster.nocheatplus.utilities.ds.map.CoordMap; +// TODO: Auto-generated Javadoc /** * Access to type-ids and data using caching techniques. * @author mc_dev @@ -33,12 +34,16 @@ public abstract class BlockCache { // TODO: New concepts (Might switch to material, inspect MC+CB code for reliability and performance of block-ids during runtime). + /** The Constant ID_AIR. */ private static final int ID_AIR = 0; /** - * Convenience method to check if the bounds as returned by getBounds cover a whole block. - * @param bounds Can be null, must have 6 fields. - * @return + * Convenience method to check if the bounds as returned by getBounds cover + * a whole block. + * + * @param bounds + * Can be null, must have 6 fields. + * @return true, if is full bounds */ public static final boolean isFullBounds(final double[] bounds) { if (bounds == null) return false; @@ -50,12 +55,18 @@ public abstract class BlockCache { } /** - * Check if chunks are loaded and load all not yet loaded chunks, using normal world coordinates.
+ * Check if chunks are loaded and load all not yet loaded chunks, using + * normal world coordinates.
* NOTE: Not sure where to put this. Method does not use any caching. + * * @param world + * the world * @param x + * the x * @param z + * the z * @param xzMargin + * the xz margin * @return Number of loaded chunks. */ public static int ensureChunksLoaded(final World world, final double x, final double z, final double xzMargin) { @@ -90,60 +101,93 @@ public abstract class BlockCache { /** Cached shape values. */ private final CoordMap boundsMap = new CoordHashMap(23); + /** The max block y. */ protected int maxBlockY = 255; // TODO: Switch to nodes with all details on? + /** + * Instantiates a new block cache. + */ public BlockCache() { } + /** + * Instantiates a new block cache. + * + * @param world + * the world + */ public BlockCache(final World world) { setAccess(world); } /** * Does not do cleanup. + * * @param world + * the new access */ public abstract void setAccess(final World world); /** * Fetch the type id from the underlying world. + * * @param x + * the x * @param y + * the y * @param z - * @return + * the z + * @return the int */ public abstract int fetchTypeId(int x, int y, int z); /** * Fetch the data from the underlying world. + * * @param x + * the x * @param y + * the y * @param z - * @return + * the z + * @return the int */ public abstract int fetchData(int x, int y, int z); /** - * Find out bounds for the block, this should not return null for performance reasons. + * Find out bounds for the block, this should not return null for + * performance reasons. + * * @param x + * the x * @param y + * the y * @param z - * @return + * the z + * @return the double[] */ public abstract double[] fetchBounds(int x, int y, int z); /** * This is a on-ground type check just for standing on minecarts / boats. + * * @param entity + * the entity * @param minX + * the min x * @param minY + * the min y * @param minZ + * the min z * @param maxX + * the max x * @param maxY + * the max y * @param maxZ - * @return + * the max z + * @return true, if successful */ public abstract boolean standsOnEntity(Entity entity, final double minX, final double minY, final double minZ, final double maxX, final double maxY, final double maxZ); @@ -160,10 +204,14 @@ public abstract class BlockCache { /** * (convenience method, uses cache). - * @param eX - * @param eY - * @param eZ - * @return + * + * @param x + * the x + * @param y + * the y + * @param z + * the z + * @return the type id */ public int getTypeId(double x, double y, double z) { return getTypeId(Location.locToBlock(x), Location.locToBlock(y), Location.locToBlock(z)); @@ -171,8 +219,10 @@ public abstract class BlockCache { /** * (convenience method, uses cache). + * * @param block - * @return + * the block + * @return the type id */ public int getTypeId(final Block block) { return getTypeId(block.getX(), block.getY(), block.getZ()); @@ -180,10 +230,14 @@ public abstract class BlockCache { /** * Get type id with cache access. + * * @param x + * the x * @param y + * the y * @param z - * @return + * the z + * @return the type id */ public int getTypeId(final int x, final int y, final int z) { final Integer pId = idMap.get(x, y, z); @@ -197,10 +251,14 @@ public abstract class BlockCache { /** * Get data value with cache access. + * * @param x + * the x * @param y + * the y * @param z - * @return + * the z + * @return the data */ public int getData(final int x, final int y, final int z) { final Integer pData = dataMap.get(x, y, z); @@ -213,11 +271,18 @@ public abstract class BlockCache { } /** - * Get block bounds - Do not change these in-place, because the returned array is cached internally. + * Get block bounds - Do not change these in-place, because the returned + * array is cached internally. + * * @param x + * the x * @param y + * the y * @param z - * @return Array of floats (minX, minY, minZ, maxX, maxY, maxZ), may be null theoretically. Do not change these in place, because they might get cached. + * the z + * @return Array of floats (minX, minY, minZ, maxX, maxY, maxZ), may be null + * theoretically. Do not change these in place, because they might + * get cached. */ public double[] getBounds(final int x, final int y, final int z) { final double[] pBounds = boundsMap.get(x, y, z); @@ -231,11 +296,16 @@ public abstract class BlockCache { } /** - * Convenience method to check if the bounds for a block cover the full block. + * Convenience method to check if the bounds for a block cover the full + * block. + * * @param x + * the x * @param y + * the y * @param z - * @return + * the z + * @return true, if is full bounds */ public boolean isFullBounds(final int x, final int y, final int z) { return isFullBounds(getBounds(x, y, z)); @@ -243,7 +313,8 @@ public abstract class BlockCache { /** * Get the maximal y coordinate a block can be at (non air). - * @return + * + * @return the max block y */ public int getMaxBlockY() { return maxBlockY; diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/BlockFlags.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/BlockFlags.java index 0cf741cb..23b42922 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/BlockFlags.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/BlockFlags.java @@ -16,6 +16,7 @@ package fr.neatmonster.nocheatplus.utilities; import org.bukkit.Material; +// TODO: Auto-generated Javadoc /** * Utilities for block-flags.
* Later the flag constant definitions and parsing might be moved here. @@ -25,37 +26,51 @@ import org.bukkit.Material; public class BlockFlags { /** - * Set flags of id same as already set with flags for the given material. (Uses BlockProperties.) - * @param id - * @param mat - */ + * Set flags of id same as already set with flags for the given material. + * (Uses BlockProperties.) + * + * @param id + * the id + * @param mat + * the mat + */ public static void setFlagsAs(int id, Material mat) { BlockProperties.setBlockFlags(id, BlockProperties.getBlockFlags(mat)); } /** - * Set flags of id same as already set with flags for the given material. (Uses BlockProperties.) - * @param id - * @param mat - */ + * Set flags of id same as already set with flags for the given material. + * (Uses BlockProperties.) + * + * @param id + * the id + * @param otherId + * the other id + */ public static void setFlagsAs(int id, int otherId) { BlockProperties.setBlockFlags(id, BlockProperties.getBlockFlags(otherId)); } /** - * Add flags to existent flags. (Uses BlockProperties.) - * @param id - * @param flags - */ + * Add flags to existent flags. (Uses BlockProperties.) + * + * @param id + * the id + * @param flags + * the flags + */ public static void addFlags(int id, long flags) { BlockProperties.setBlockFlags(id, BlockProperties.getBlockFlags(id) | flags); } /** - * Remove the given flags from existent flags. (Uses BlockProperties.) - * @param id - * @param flags - */ + * Remove the given flags from existent flags. (Uses BlockProperties.) + * + * @param id + * the id + * @param flags + * the flags + */ public static void removeFlags(int id, long flags) { BlockProperties.setBlockFlags(id, BlockProperties.getBlockFlags(id) & ~flags); } diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/BlockProperties.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/BlockProperties.java index 6c3f7dc2..107c10cd 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/BlockProperties.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/BlockProperties.java @@ -54,6 +54,7 @@ import fr.neatmonster.nocheatplus.utilities.collision.ICollidePassable; import fr.neatmonster.nocheatplus.utilities.collision.PassableAxisTracing; import fr.neatmonster.nocheatplus.utilities.collision.PassableRayTracing; +// TODO: Auto-generated Javadoc /** * Properties of blocks. * @@ -66,39 +67,84 @@ import fr.neatmonster.nocheatplus.utilities.collision.PassableRayTracing; public class BlockProperties { /** - * @deprecated Will be replaced by a generic way to define tools. - * @author mc_dev + * The Enum ToolType. * + * @author mc_dev + * @deprecated Will be replaced by a generic way to define tools. */ public static enum ToolType{ + + /** The none. */ NONE, + + /** The sword. */ SWORD, + + /** The shears. */ SHEARS, + + /** The spade. */ SPADE, + + /** The axe. */ AXE, + + /** The pickaxe. */ PICKAXE, // HOE, } /** - * @deprecated Will be replaced by a generic way to define tools. - * @author mc_dev + * The Enum MaterialBase. * + * @author mc_dev + * @deprecated Will be replaced by a generic way to define tools. */ public static enum MaterialBase{ + + /** The none. */ NONE(0, 1f), + + /** The wood. */ WOOD(1, 2f), + + /** The stone. */ STONE(2, 4f), + + /** The iron. */ IRON(3, 6f), + + /** The diamond. */ DIAMOND(4, 8f), + + /** The gold. */ GOLD(5, 12f); /** Index for array. */ public final int index; + + /** The break multiplier. */ public final float breakMultiplier; + + /** + * Instantiates a new material base. + * + * @param index + * the index + * @param breakMultiplier + * the break multiplier + */ private MaterialBase(int index, float breakMultiplier) { this.index = index; this.breakMultiplier = breakMultiplier; } + + /** + * Gets the by id. + * + * @param id + * the id + * @return the by id + */ public static final MaterialBase getById(final int id) { for (final MaterialBase base : MaterialBase.values()) { if (base.index == id) { @@ -115,15 +161,36 @@ public class BlockProperties { * @deprecated Will be replaced by a generic way to define tools. */ public static class ToolProps{ + + /** The tool type. */ public final ToolType toolType; + + /** The material base. */ public final MaterialBase materialBase; + + /** + * Instantiates a new tool props. + * + * @param toolType + * the tool type + * @param materialBase + * the material base + */ public ToolProps(ToolType toolType, MaterialBase materialBase) { this.toolType = toolType; this.materialBase = materialBase; } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ public String toString() { return "ToolProps("+toolType + "/"+materialBase+")"; } + + /** + * Validate. + */ public void validate() { if (toolType == null) { throw new IllegalArgumentException("ToolType must not be null."); @@ -140,14 +207,40 @@ public class BlockProperties { * @deprecated Will be replaced by a generic way to define tools. */ public static class BlockProps{ + + /** The tool. */ public final ToolProps tool; + + /** The breaking times. */ public final long[] breakingTimes; + + /** The hardness. */ public final float hardness; /** Factor 2 = 2 times faster. */ public final float efficiencyMod; + + /** + * Instantiates a new block props. + * + * @param tool + * the tool + * @param hardness + * the hardness + */ public BlockProps(ToolProps tool, float hardness) { this(tool, hardness, 1); } + + /** + * Instantiates a new block props. + * + * @param tool + * the tool + * @param hardness + * the hardness + * @param efficiencyMod + * the efficiency mod + */ public BlockProps(ToolProps tool, float hardness, float efficiencyMod) { this.tool = tool; this.hardness = hardness; @@ -167,18 +260,50 @@ public class BlockProperties { } this.efficiencyMod = efficiencyMod; } + + /** + * Instantiates a new block props. + * + * @param tool + * the tool + * @param hardness + * the hardness + * @param breakingTimes + * the breaking times + */ public BlockProps(ToolProps tool, float hardness, long[] breakingTimes) { this(tool, hardness, breakingTimes, 1f); } + + /** + * Instantiates a new block props. + * + * @param tool + * the tool + * @param hardness + * the hardness + * @param breakingTimes + * the breaking times + * @param efficiencyMod + * the efficiency mod + */ public BlockProps(ToolProps tool, float hardness, long[] breakingTimes, float efficiencyMod) { this.tool = tool; this.breakingTimes = breakingTimes; this.hardness = hardness; this.efficiencyMod = efficiencyMod; } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ public String toString() { return "BlockProps(" + hardness + " / " + tool.toString() + " / " + Arrays.toString(breakingTimes) + ")"; } + + /** + * Validate. + */ public void validate() { if (breakingTimes == null) { throw new IllegalArgumentException("Breaking times must not be null."); @@ -196,6 +321,7 @@ public class BlockProperties { /** Liquid height if no solid/full blocks are above. */ protected static final double LIQUID_HEIGHT_LOWERED = 80000002; + /** The Constant maxBlocks. */ protected static final int maxBlocks = 4096; /** Properties by block id, might be extended to 4096 later for custom blocks.*/ @@ -210,79 +336,111 @@ public class BlockProperties { /** Default tool properties (inappropriate tool). */ public static final ToolProps noTool = new ToolProps(ToolType.NONE, MaterialBase.NONE); + /** The Constant woodSword. */ public static final ToolProps woodSword = new ToolProps(ToolType.SWORD, MaterialBase.WOOD); + /** The Constant woodSpade. */ public static final ToolProps woodSpade = new ToolProps(ToolType.SPADE, MaterialBase.WOOD); + /** The Constant woodPickaxe. */ public static final ToolProps woodPickaxe = new ToolProps(ToolType.PICKAXE, MaterialBase.WOOD); + /** The Constant woodAxe. */ public static final ToolProps woodAxe = new ToolProps(ToolType.AXE, MaterialBase.WOOD); + /** The Constant stonePickaxe. */ public static final ToolProps stonePickaxe = new ToolProps(ToolType.PICKAXE, MaterialBase.STONE); + /** The Constant ironPickaxe. */ public static final ToolProps ironPickaxe = new ToolProps(ToolType.PICKAXE, MaterialBase.IRON); + /** The Constant diamondPickaxe. */ public static final ToolProps diamondPickaxe = new ToolProps(ToolType.PICKAXE, MaterialBase.DIAMOND); /** Times for instant breaking. */ public static final long[] instantTimes = secToMs(0); + /** The Constant leafTimes. */ public static final long[] leafTimes = secToMs(0.3); + /** The glass times. */ public static long[] glassTimes = secToMs(0.45); + /** The Constant gravelTimes. */ public static final long[] gravelTimes = secToMs(0.9, 0.45, 0.25, 0.15, 0.15, 0.1); + /** The rails times. */ public static long[] railsTimes = secToMs(1.05, 0.55, 0.3, 0.2, 0.15, 0.1); + /** The Constant woodTimes. */ public static final long[] woodTimes = secToMs(3, 1.5, 0.75, 0.5, 0.4, 0.25); + /** The Constant indestructibleTimes. */ private static final long[] indestructibleTimes = new long[] {indestructible, indestructible, indestructible, indestructible, indestructible, indestructible}; /** Instantly breakable. */ public static final BlockProps instantType = new BlockProps(noTool, 0, instantTimes); + /** The Constant glassType. */ public static final BlockProps glassType = new BlockProps(noTool, 0.3f, glassTimes, 2f); + /** The Constant gravelType. */ public static final BlockProps gravelType = new BlockProps(woodSpade, 0.6f, gravelTimes); /** Stone type blocks. */ public static final BlockProps stoneType = new BlockProps(woodPickaxe, 1.5f); + /** The Constant woodType. */ public static final BlockProps woodType = new BlockProps(woodAxe, 2, woodTimes); + /** The Constant brickType. */ public static final BlockProps brickType = new BlockProps(woodPickaxe, 2); + /** The Constant coalType. */ public static final BlockProps coalType = new BlockProps(woodPickaxe, 3); + /** The Constant goldBlockType. */ public static final BlockProps goldBlockType = new BlockProps(woodPickaxe, 3, secToMs(15, 7.5, 3.75, 0.7, 0.55, 1.2)); + /** The Constant ironBlockType. */ public static final BlockProps ironBlockType = new BlockProps(woodPickaxe, 5, secToMs(25, 12.5, 2.0, 1.25, 0.95, 2.0)); + /** The Constant diamondBlockType. */ public static final BlockProps diamondBlockType = new BlockProps(woodPickaxe, 5, secToMs(25, 12.5, 6.0, 1.25, 0.95, 2.0)); + /** The Constant hugeMushroomType. */ public static final BlockProps hugeMushroomType = new BlockProps(woodAxe, 0.2f, secToMs(0.3, 0.15, 0.1, 0.05, 0.05, 0.05)); + /** The Constant leafType. */ public static final BlockProps leafType = new BlockProps(noTool, 0.2f, leafTimes); + /** The Constant sandType. */ public static final BlockProps sandType = new BlockProps(woodSpade, 0.5f, secToMs(0.75, 0.4, 0.2, 0.15, 0.1, 0.1)); + /** The Constant leverType. */ public static final BlockProps leverType = new BlockProps(noTool, 0.5f, secToMs(0.75)); + /** The Constant sandStoneType. */ public static final BlockProps sandStoneType = new BlockProps(woodPickaxe, 0.8f); + /** The Constant chestType. */ public static final BlockProps chestType = new BlockProps(woodAxe, 2.5f, secToMs(3.75, 1.9, 0.95, 0.65, 0.5, 0.35)); + /** The Constant woodDoorType. */ public static final BlockProps woodDoorType = new BlockProps(woodAxe, 3.0f, secToMs(4.5, 2.25, 1.15, 0.75, 0.6, 0.4)); + /** The Constant dispenserType. */ public static final BlockProps dispenserType = new BlockProps(woodPickaxe, 3.5f); + /** The Constant ironDoorType. */ public static final BlockProps ironDoorType = new BlockProps(woodPickaxe, 5); + /** The Constant indestructibleType. */ public static final BlockProps indestructibleType = new BlockProps(noTool, -1f, indestructibleTimes); - /** Returned if unknown */ + /** Returned if unknown. */ private static BlockProps defaultBlockProps = instantType; + /** The Constant instantMat. */ protected static final Material[] instantMat = new Material[]{ // Named in wiki. Material.CROPS, @@ -313,22 +471,36 @@ public class BlockProperties { Material.POTATO, }; + /** The rt ray. */ private static ICollidePassable rtRay = null; + + /** The rt axis. */ private static ICollidePassable rtAxis = null; + + /** The block cache. */ private static BlockCache blockCache = null; + + /** The p loc. */ private static PlayerLocation pLoc = null; + /** The Constant blockFlags. */ protected static final long[] blockFlags = new long[maxBlocks]; /** Flag position for stairs. */ public static final long F_STAIRS = 0x1; + + /** The Constant F_LIQUID. */ public static final long F_LIQUID = 0x2; // TODO: maybe remove F_SOLID use (unless for setting F_GROUND on init). /** Minecraft isSolid result. Used for setting ground flag - Subject to change / rename.*/ public static final long F_SOLID = 0x4; /** Compatibility flag: regard this block as passable always. */ public static final long F_IGN_PASSABLE = 0x8; + + /** The Constant F_WATER. */ public static final long F_WATER = 0x10; + + /** The Constant F_LAVA. */ public static final long F_LAVA = 0x20; /** Override bounding box: 1.5 blocks high, like fences.
* NOTE: This might have relevance for passable later. @@ -376,13 +548,13 @@ public class BlockProperties { /** All rail types a minecart can move on. */ public static final long F_RAILS = 0x10000; - /** ICE */ + /** ICE. */ public static final long F_ICE = 0x20000; - /** LEAVES */ + /** LEAVES. */ public static final long F_LEAVES = 0x40000; - /** THIN FENCE (glass panes, iron fence) */ + /** THIN FENCE (glass panes, iron fence). */ public static final long F_THIN_FENCE = 0x80000; /** Meta-flag to indicate that the (max.-) edges should mean a collision, can be passed to collidesBlock. */ @@ -426,6 +598,7 @@ public class BlockProperties { */ private static final Map nameFlagMap = new LinkedHashMap(); + /** The Constant useLoc. */ private static final Location useLoc = new Location(null, 0, 0, 0); static{ @@ -451,9 +624,15 @@ public class BlockProperties { protected static float breakPenaltyOffGround = 4f; /** - * Initialize blocks and tools properties. This can be called at any time during runtime. - * @param mcAccess If mcAccess implements BlockPropertiesSetup, mcAccess.setupBlockProperties will be called directly after basic initialization but before the configuration is applied. + * Initialize blocks and tools properties. This can be called at any time + * during runtime. + * + * @param mcAccess + * If mcAccess implements BlockPropertiesSetup, + * mcAccess.setupBlockProperties will be called directly after + * basic initialization but before the configuration is applied. * @param worldConfigProvider + * the world config provider */ public static void init(final MCAccess mcAccess, final WorldConfigProvider worldConfigProvider) { blockCache = mcAccess.getBlockCache(null); @@ -493,6 +672,14 @@ public class BlockProperties { NCPAPIProvider.getNoCheatPlusAPI().setFeatureTags("blocks", blocksFeatures); } + /** + * Inits the tools. + * + * @param mcAccess + * the mc access + * @param worldConfigProvider + * the world config provider + */ private static void initTools(final MCAccess mcAccess, final WorldConfigProvider worldConfigProvider) { tools.clear(); tools.put(268, new ToolProps(ToolType.SWORD, MaterialBase.WOOD)); @@ -523,6 +710,14 @@ public class BlockProperties { tools.put(359, new ToolProps(ToolType.SHEARS, MaterialBase.NONE)); } + /** + * Inits the blocks. + * + * @param mcAccess + * the mc access + * @param worldConfigProvider + * the world config provider + */ private static void initBlocks(final MCAccess mcAccess, final WorldConfigProvider worldConfigProvider) { // Reset tool props. Arrays.fill(blocks, null); @@ -862,6 +1057,12 @@ public class BlockProperties { blocks[95] = indestructibleType; // Locked chest (prevent crash with 1.7). } + /** + * Dump blocks. + * + * @param all + * the all + */ public static void dumpBlocks(boolean all) { final LogManager logManager = NCPAPIProvider.getNoCheatPlusAPI().getLogManager(); List missing = new LinkedList(); @@ -910,8 +1111,12 @@ public class BlockProperties { /** * Add all flag names for existing default flags to the list. + * * @param flags - * @param tags Flag names will be added to this list (not with the "F_"-prefix). + * the flags + * @param tags + * Flag names will be added to this list (not with the + * "F_"-prefix). */ public static void addFlagNames(final long flags, final Collection tags) { String tag = flagNameMap.get(flags); @@ -928,8 +1133,10 @@ public class BlockProperties { /** * Return a collection containing all names of the flags. + * * @param flags - * @return + * the flags + * @return the flag names */ public static Collection getFlagNames(final Long flags) { final ArrayList tags = new ArrayList(flagNameMap.size()); @@ -942,9 +1149,12 @@ public class BlockProperties { /** * Convenience method to parse a flag. + * * @param input - * @return - * @throws InputMismatchException if failed to parse. + * the input + * @return the long + * @throws InputMismatchException + * if failed to parse. */ public static long parseFlag(final String input) { final String ucInput = input.trim().toUpperCase(); @@ -960,15 +1170,46 @@ public class BlockProperties { throw new InputMismatchException(); } + /** + * Sec to ms. + * + * @param s1 + * the s1 + * @param s2 + * the s2 + * @param s3 + * the s3 + * @param s4 + * the s4 + * @param s5 + * the s5 + * @param s6 + * the s6 + * @return the long[] + */ public static long[] secToMs(final double s1, final double s2, final double s3, final double s4, final double s5, final double s6) { return new long[] { (long) (s1 * 1000d), (long) (s2 * 1000d), (long) (s3 * 1000d), (long) (s4 * 1000d), (long) (s5 * 1000d), (long) (s6 * 1000d) }; } + /** + * Sec to ms. + * + * @param s1 + * the s1 + * @return the long[] + */ public static long[] secToMs(final double s1) { final long v = (long) (s1 * 1000d); return new long[]{v, v, v, v, v, v}; } + /** + * Gets the tool props. + * + * @param stack + * the stack + * @return the tool props + */ public static ToolProps getToolProps(final ItemStack stack) { if (stack == null) { return noTool; @@ -978,6 +1219,13 @@ public class BlockProperties { } } + /** + * Gets the tool props. + * + * @param mat + * the mat + * @return the tool props + */ public static ToolProps getToolProps(final Material mat) { if (mat == null) { return noTool; @@ -987,6 +1235,13 @@ public class BlockProperties { } } + /** + * Gets the tool props. + * + * @param id + * the id + * @return the tool props + */ public static ToolProps getToolProps(final Integer id) { final ToolProps props = tools.get(id); if (props == null) { @@ -997,6 +1252,13 @@ public class BlockProperties { } } + /** + * Gets the block props. + * + * @param stack + * the stack + * @return the block props + */ public static BlockProps getBlockProps(final ItemStack stack) { if (stack == null) { return defaultBlockProps; @@ -1006,6 +1268,13 @@ public class BlockProperties { } } + /** + * Gets the block props. + * + * @param mat + * the mat + * @return the block props + */ public static BlockProps getBlockProps(final Material mat) { if (mat == null) { return defaultBlockProps; @@ -1015,6 +1284,13 @@ public class BlockProperties { } } + /** + * Gets the block props. + * + * @param blockId + * the block id + * @return the block props + */ public static BlockProps getBlockProps(final int blockId) { if (blockId <0 || blockId >= blocks.length || blocks[blockId] == null) { return defaultBlockProps; @@ -1026,9 +1302,12 @@ public class BlockProperties { /** * Convenience method. - * @param blockType + * + * @param BlockType + * the block type * @param player - * @return + * the player + * @return the breaking duration */ public static long getBreakingDuration(final Material BlockType, final Player player) { return getBreakingDuration(BlockType.getId(), player); @@ -1036,9 +1315,12 @@ public class BlockProperties { /** * Convenience method. + * * @param blockId + * the block id * @param player - * @return + * the player + * @return the breaking duration */ public static long getBreakingDuration(final int blockId, final Player player) { final long res = getBreakingDuration(blockId, @@ -1050,11 +1332,18 @@ public class BlockProperties { /** * TODO: repair signature some day (rid of PlayerLocation). - * @param BlockId - * @param itemInHand May be null. - * @param helmet May be null. - * @param location The normal location of a player. - * @return + * + * @param blockId + * the block id + * @param itemInHand + * May be null. + * @param helmet + * May be null. + * @param player + * the player + * @param location + * The normal location of a player. + * @return the breaking duration */ public static long getBreakingDuration(final int blockId, final ItemStack itemInHand, final ItemStack helmet, final Player player, final Location location) { blockCache.setAccess(location.getWorld()); @@ -1095,10 +1384,22 @@ public class BlockProperties { } /** - * Get the normal breaking duration, including enchantments, and tool properties. + * Get the normal breaking duration, including enchantments, and tool + * properties. + * * @param blockId + * the block id * @param itemInHand - * @return + * the item in hand + * @param onGround + * the on ground + * @param inWater + * the in water + * @param aquaAffinity + * the aqua affinity + * @param haste + * the haste + * @return the breaking duration */ public static long getBreakingDuration(final int blockId, final ItemStack itemInHand, final boolean onGround, final boolean inWater, final boolean aquaAffinity, final int haste) { // TODO: more configurability / load from file for blocks (i.e. set for shears etc. @@ -1115,22 +1416,51 @@ public class BlockProperties { } /** - * + * Gets the breaking duration. + * * @param blockId + * the block id * @param blockProps + * the block props * @param toolProps + * the tool props * @param onGround + * the on ground * @param inWater + * the in water * @param aquaAffinity + * the aqua affinity * @param efficiency - * @param haste Amplifier of haste potion effect (assume > 0 for effect there at all, so 1 is haste I, 2 is haste II). - * @return + * the efficiency + * @param haste + * Amplifier of haste potion effect (assume > 0 for effect there + * at all, so 1 is haste I, 2 is haste II). + * @return the breaking duration */ public static long getBreakingDuration(final int blockId, final BlockProps blockProps, final ToolProps toolProps, final boolean onGround, final boolean inWater, boolean aquaAffinity, int efficiency, int haste) { final long dur = getBreakingDuration(blockId, blockProps, toolProps, onGround, inWater, aquaAffinity, efficiency); return haste > 0 ? (long) (Math.pow(0.8, haste) * dur) : dur; } + /** + * Gets the breaking duration. + * + * @param blockId + * the block id + * @param blockProps + * the block props + * @param toolProps + * the tool props + * @param onGround + * the on ground + * @param inWater + * the in water + * @param aquaAffinity + * the aqua affinity + * @param efficiency + * the efficiency + * @return the breaking duration + */ public static long getBreakingDuration(final int blockId, final BlockProps blockProps, final ToolProps toolProps, final boolean onGround, final boolean inWater, boolean aquaAffinity, int efficiency) { boolean isValidTool = isValidTool(blockId, blockProps, toolProps, efficiency); if (efficiency > 0) { @@ -1279,12 +1609,18 @@ public class BlockProperties { } /** - * Check if the tool is officially appropriate for the block id, counting in efficiency enchantments. + * Check if the tool is officially appropriate for the block id, counting in + * efficiency enchantments. + * * @param blockId + * the block id * @param blockProps + * the block props * @param toolProps + * the tool props * @param efficiency - * @return + * the efficiency + * @return true, if is valid tool */ public static boolean isValidTool(final int blockId, final BlockProps blockProps, final ToolProps toolProps, final int efficiency) { boolean isValidTool = blockProps.tool.toolType == toolProps.toolType; @@ -1314,9 +1650,13 @@ public class BlockProperties { /** * Access API for setting tool properties.
- * NOTE: No guarantee that this harmonizes with internals and workarounds, currently. + * NOTE: No guarantee that this harmonizes with internals and workarounds, + * currently. + * * @param itemId + * the item id * @param toolProps + * the tool props */ public static void setToolProps(int itemId, ToolProps toolProps) { if (toolProps == null) { @@ -1328,10 +1668,13 @@ public class BlockProperties { } /** - * Access API to set a blocks properties. - * NOTE: No guarantee that this harmonizes with internals and workarounds, currently. + * Access API to set a blocks properties. NOTE: No guarantee that this + * harmonizes with internals and workarounds, currently. + * * @param blockId + * the block id * @param blockProps + * the block props */ public static void setBlockProps(int blockId, BlockProps blockProps) { if (blockProps == null) { @@ -1344,10 +1687,28 @@ public class BlockProperties { blocks[blockId] = blockProps; } + /** + * Checks if is valid tool. + * + * @param blockType + * the block type + * @param itemInHand + * the item in hand + * @return true, if is valid tool + */ public static boolean isValidTool(final Material blockType, final ItemStack itemInHand) { return isValidTool(blockType.getId(), itemInHand); } + /** + * Checks if is valid tool. + * + * @param blockId + * the block id + * @param itemInHand + * the item in hand + * @return true, if is valid tool + */ public static boolean isValidTool(final int blockId, final ItemStack itemInHand) { final BlockProps blockProps = getBlockProps(blockId); final ToolProps toolProps = getToolProps(itemInHand); @@ -1356,13 +1717,20 @@ public class BlockProperties { } + /** + * Gets the default block props. + * + * @return the default block props + */ public static BlockProps getDefaultBlockProps() { return defaultBlockProps; } /** - * Feeding null will cause an npe - will validate. + * Feeding null will cause an npe - will validate. + * * @param blockProps + * the new default block props */ public static void setDefaultBlockProps(BlockProps blockProps) { blockProps.validate(); @@ -1371,10 +1739,14 @@ public class BlockProperties { /** * Simple checking method, heavy. No isIllegal check. + * * @param player + * the player * @param location + * the location * @param yOnGround - * @return + * the y on ground + * @return true, if is in liquid */ public static boolean isInLiquid(final Player player, final Location location, final double yOnGround) { // Bit fat workaround, maybe put the object through from check listener ? @@ -1389,10 +1761,14 @@ public class BlockProperties { /** * Simple checking method, heavy. No isIllegal check. + * * @param player + * the player * @param location + * the location * @param yOnGround - * @return + * the y on ground + * @return true, if is in web */ public static boolean isInWeb(final Player player, final Location location, final double yOnGround) { // Bit fat workaround, maybe put the object through from check listener ? @@ -1407,10 +1783,14 @@ public class BlockProperties { /** * Simple checking method, heavy. No isIllegal check. + * * @param player + * the player * @param location + * the location * @param yOnGround - * @return + * the y on ground + * @return true, if is on ground */ public static boolean isOnGround(final Player player, final Location location, final double yOnGround) { // Bit fat workaround, maybe put the object through from check listener ? @@ -1425,10 +1805,14 @@ public class BlockProperties { /** * Simple checking method, heavy. No isIllegal check. + * * @param player + * the player * @param location + * the location * @param yOnGround - * @return + * the y on ground + * @return true, if is on ground or reset cond */ public static boolean isOnGroundOrResetCond(final Player player, final Location location, final double yOnGround) { blockCache.setAccess(location.getWorld()); @@ -1442,10 +1826,14 @@ public class BlockProperties { /** * Simple checking method, heavy. No isIllegal check. + * * @param player + * the player * @param location + * the location * @param yOnGround - * @return + * the y on ground + * @return true, if is reset cond */ public static boolean isResetCond(final Player player, final Location location, final double yOnGround) { blockCache.setAccess(location.getWorld()); @@ -1460,9 +1848,10 @@ public class BlockProperties { /** * Straw-man-method to hide warnings. Rather intended for display in * debug/alert messages. - * + * * @param blockType - * @return + * the block type + * @return the id */ public static int getId(final Material blockType) { return blockType.getId(); @@ -1470,9 +1859,10 @@ public class BlockProperties { /** * Get the (legacy) data value for the block. - * + * * @param block - * @return + * the block + * @return the data */ public static int getData(final Block block) { return block.getData(); @@ -1480,45 +1870,86 @@ public class BlockProperties { /** * Straw-man method to hide warnings. + * * @param id - * @return + * the id + * @return the material */ public static Material getMaterial(final int id) { return Material.getMaterial(id); } /** - * @deprecated Typo in method name. + * Gets the b lock flags. + * * @param id - * @return + * the id + * @return the b lock flags + * @deprecated Typo in method name. */ public static final long getBLockFlags(final int id) { return blockFlags[id]; } + /** + * Gets the block flags. + * + * @param blockType + * the block type + * @return the block flags + */ public static final long getBlockFlags(final Material blockType) { return getBlockFlags(blockType.getId()); } + /** + * Gets the block flags. + * + * @param id + * the id + * @return the block flags + */ public static final long getBlockFlags(final int id) { return blockFlags[id]; } + /** + * Sets the block flags. + * + * @param blockType + * the block type + * @param flags + * the flags + */ public static final void setBlockFlags(final Material blockType, final long flags) { setBlockFlags(blockType.getId(), flags); } + /** + * Sets the block flags. + * + * @param id + * the id + * @param flags + * the flags + */ public static final void setBlockFlags(final int id, final long flags) { blockFlags[id] = flags; } /** - * Auxiliary check for if this block is climbable and allows climbing up. Does not account for jumping off ground etc. + * Auxiliary check for if this block is climbable and allows climbing up. + * Does not account for jumping off ground etc. + * * @param cache + * the cache * @param x + * the x * @param y + * the y * @param z - * @return + * the z + * @return true, if successful */ public static final boolean canClimbUp(final BlockCache cache, final int x, final int y, final int z) { final int id = cache.getTypeId(x, y, z); @@ -1544,44 +1975,91 @@ public class BlockProperties { return false; } + /** + * Checks if is climbable. + * + * @param id + * the id + * @return true, if is climbable + */ public static final boolean isClimbable(final int id) { return (blockFlags[id] & F_CLIMBABLE) != 0; } /** - * Climbable material that needs to be attached to a block, to allow players to climb up.
+ * Climbable material that needs to be attached to a block, to allow players + * to climb up.
* Currently only applies to vines. There is no flag for such, yet. + * * @param id - * @return + * the id + * @return true, if is attached climbable */ public static final boolean isAttachedClimbable(final int id) { return id == Material.VINE.getId(); } + /** + * Checks if is stairs. + * + * @param id + * the id + * @return true, if is stairs + */ public static final boolean isStairs(final int id) { return (blockFlags[id] & F_STAIRS) != 0; } + /** + * Checks if is liquid. + * + * @param blockType + * the block type + * @return true, if is liquid + */ public static final boolean isLiquid(final Material blockType) { return isLiquid(blockType.getId()); } + /** + * Checks if is liquid. + * + * @param id + * the id + * @return true, if is liquid + */ public static final boolean isLiquid(final int id) { return (blockFlags[id] & F_LIQUID) != 0; } + /** + * Checks if is ice. + * + * @param id + * the id + * @return true, if is ice + */ public static final boolean isIce(final int id) { return (blockFlags[id] & F_ICE) != 0; } + /** + * Checks if is leaves. + * + * @param id + * the id + * @return true, if is leaves + */ public static final boolean isLeaves(final int id) { return (blockFlags[id] & F_LEAVES) != 0; } /** * Might hold true for liquids too. + * * @param blockType - * @return + * the block type + * @return true, if is solid */ public static final boolean isSolid(final Material blockType) { return isSolid(blockType.getId()); @@ -1589,8 +2067,10 @@ public class BlockProperties { /** * Might hold true for liquids too. + * * @param id - * @return + * the id + * @return true, if is solid */ public static final boolean isSolid(final int id) { return (blockFlags[id] & F_SOLID) != 0; @@ -1598,8 +2078,10 @@ public class BlockProperties { /** * Might hold true for liquids too. + * * @param blockType - * @return + * the block type + * @return true, if is ground */ public static final boolean isGround(final Material blockType) { return isGround(blockType.getId()); @@ -1607,8 +2089,10 @@ public class BlockProperties { /** * Might hold true for liquids too. + * * @param id - * @return + * the id + * @return true, if is ground */ public static final boolean isGround(final int id) { return (blockFlags[id] & F_GROUND) != 0; @@ -1616,8 +2100,10 @@ public class BlockProperties { /** * Convenience method including null checks. + * * @param type - * @return + * the type + * @return true, if is air */ public static final boolean isAir(Material type) { return type == null || type == Material.AIR; @@ -1625,8 +2111,10 @@ public class BlockProperties { /** * Convenience method including null checks. + * * @param stack - * @return + * the stack + * @return true, if is air */ public static final boolean isAir(ItemStack stack) { return stack == null || isAir(stack.getType()); @@ -1636,9 +2124,11 @@ public class BlockProperties { * Get the facing direction as BlockFace, unified approach with attached to * = opposite of facing. Likely the necessary flags are just set where it's * been needed so far. - * + * * @param flags + * the flags * @param data + * the data * @return Return null, if facing can not be determined. */ public static final BlockFace getFacing(final long flags, final int data) { @@ -1679,12 +2169,16 @@ public class BlockProperties { *
  • F_PASSABLE_X4 (trap door at these coordinates).
  • *
  • F_CLIMBABLE (ladder below).
  • * - * + * * @param access + * the access * @param x + * the x * @param y + * the y * @param z - * @return + * the z + * @return true, if is trap door above ladder special case */ public static final boolean isTrapDoorAboveLadderSpecialCase(final BlockCache access, final int x, final int y, final int z) { // Special case activation. @@ -1729,10 +2223,13 @@ public class BlockProperties { } /** - * Just check if a position is not inside of a block that has a bounding box.
    + * Just check if a position is not inside of a block that has a bounding + * box.
    * This is an inaccurate check, it also returns false for doors etc. + * * @param blockType - * @return + * the block type + * @return true, if is passable */ public static final boolean isPassable(final Material blockType) { return isPassable(blockType.getId()); @@ -1741,8 +2238,10 @@ public class BlockProperties { /** * Just check if a block type is fully passable by default.
    * This is an inaccurate check, it also returns false for doors etc. + * * @param id - * @return + * the id + * @return true, if is passable */ public static final boolean isPassable(final int id) { final long flags = blockFlags[id]; @@ -1757,8 +2256,10 @@ public class BlockProperties { /** * All rail types a minecart can move on. + * * @param id - * @return + * the id + * @return true, if is rails */ public static final boolean isRails(final int id) { return (blockFlags[id] & F_RAILS) != 0; @@ -1766,10 +2267,12 @@ public class BlockProperties { /** * Test if the id is rails and if data means ascending. - * + * * @param id + * the id * @param data - * @return + * the data + * @return true, if is ascending rails */ public static final boolean isAscendingRails(final int id, final int data) { // TODO: Configurable magic. @@ -1777,14 +2280,21 @@ public class BlockProperties { } /** - * Test if a position can be passed through (collidesBlock + passable test, no fences yet).
    + * Test if a position can be passed through (collidesBlock + passable test, + * no fences yet).
    * NOTE: This is experimental. - * @param world + * + * @param access + * the access * @param x + * the x * @param y + * the y * @param z + * the z * @param id - * @return + * the id + * @return true, if is passable */ public static final boolean isPassable(final BlockCache access, final double x, final double y, final double z, final int id) { // Simple exclusion check first. @@ -1813,13 +2323,18 @@ public class BlockProperties { } /** - * Checking the block below to account for fences and such. This must be called extra to isPassable(...). + * Checking the block below to account for fences and such. This must be + * called extra to isPassable(...). + * * @param access + * the access * @param x + * the x * @param y + * the y * @param z - * @param id - * @return + * the z + * @return true, if is passable h150 */ public static final boolean isPassableH150(final BlockCache access, final double x, final double y, final double z) { // Check for fences. @@ -1849,11 +2364,18 @@ public class BlockProperties { /** * Check if passable, including blocks with height 1.5. + * * @param access + * the access * @param x + * the x * @param y + * the y * @param z - * @return + * the z + * @param id + * the id + * @return true, if is passable exact */ public static final boolean isPassableExact(final BlockCache access, final double x, final double y, final double z, final int id) { return isPassable(access, x, y, z, id) && isPassableH150(access, x, y, z); @@ -1861,9 +2383,12 @@ public class BlockProperties { /** * Check if passable, including blocks with height 1.5. + * * @param access + * the access * @param loc - * @return + * the loc + * @return true, if is passable exact */ public static final boolean isPassableExact(final BlockCache access, final Location loc) { return isPassableExact(access, loc.getX(), loc.getY(), loc.getZ(), access.getTypeId(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); @@ -1871,21 +2396,36 @@ public class BlockProperties { /** - * Requires the hit-box of the block is hit (...): this checks for special blocks properties such as glass panes and similar.
    + * Requires the hit-box of the block is hit (...): this checks for special + * blocks properties such as glass panes and similar.
    * Ray-tracing version for passable-workarounds. + * * @param access - * @param bx Block-coordinates. + * the access + * @param bx + * Block-coordinates. * @param by + * the by * @param bz - * @param fx Offset from block-coordinates in [0..1]. + * the bz + * @param fx + * Offset from block-coordinates in [0..1]. * @param fy + * the fy * @param fz - * @param id Type-id of the block. - * @param dX Total ray distance for coordinated (see dT). + * the fz + * @param id + * Type-id of the block. + * @param dX + * Total ray distance for coordinated (see dT). * @param dY + * the d y * @param dZ - * @param dT Time to cover from given position in [0..1], relating to dX, dY, dZ. - * @return + * the d z + * @param dT + * Time to cover from given position in [0..1], relating to dX, + * dY, dZ. + * @return true, if is passable workaround */ public static final boolean isPassableWorkaround(final BlockCache access, final int bx, final int by, final int bz, final double fx, final double fy, final double fz, final int id, final double dX, final double dY, final double dZ, final double dT) { // Note: Since this is only called if the bounding box collides, out-of-bounds checks should not be necessary. @@ -1955,14 +2495,23 @@ public class BlockProperties { } /** - * XZ-collision check for (bounds / pseudo-ray) with fence type blocks (fences, glass panes), margin configurable. + * XZ-collision check for (bounds / pseudo-ray) with fence type blocks + * (fences, glass panes), margin configurable. + * * @param fx + * the fx * @param fz + * the fz * @param dX + * the d x * @param dZ + * the d z * @param dT - * @param d Distance to the fence middle to keep (see code of isPassableworkaround for reference). - * @return + * the d t + * @param d + * Distance to the fence middle to keep (see code of + * isPassableworkaround for reference). + * @return true, if successful */ public static boolean collidesFence(final double fx, final double fz, final double dX, final double dZ, final double dT, final double d) { final double dFx = 0.5 - fx; @@ -1981,12 +2530,21 @@ public class BlockProperties { } /** - * Collision for x-z ray / bounds. Use this to check if a box is really outside. + * Collision for x-z ray / bounds. Use this to check if a box is really + * outside. + * * @param fx + * the fx * @param fz + * the fz * @param dX + * the d x * @param dZ + * the d z * @param dT + * the d t + * @param inset + * the inset * @return False if no collision with the center bounds. */ public static final boolean collidesCenter(final double fx, final double fz, final double dX, final double dZ, final double dT, final double inset) { @@ -2010,12 +2568,21 @@ public class BlockProperties { } /** - * Collision for x-z ray / bounds. Use this to check if a box is really inside. + * Collision for x-z ray / bounds. Use this to check if a box is really + * inside. + * * @param fx + * the fx * @param fz + * the fz * @param dX + * the d x * @param dZ + * the d z * @param dT + * the d t + * @param inset + * the inset * @return True if the box is really inside of the center bounds. */ public static final boolean isInsideCenter(final double fx, final double fz, final double dX, final double dZ, final double dT, final double inset) { @@ -2047,16 +2614,22 @@ public class BlockProperties { * This might return 0 or somewhat arbitrary values for some blocks that * don't have full bounds (!), might return 0 for blocks with the * F_GROUND_HEIGHT flag, unless they are treated individually here. - * + * * @param access + * the access * @param x + * the x * @param y + * the y * @param z + * the z * @param id + * the id * @param bounds + * the bounds * @param flags * Flags for this block. - * @return + * @return the ground min height */ public static double getGroundMinHeight(final BlockCache access, final int x, final int y, final int z, final int id, final double[] bounds, final long flags) { // TODO: Check which ones are really needed ! @@ -2125,9 +2698,11 @@ public class BlockProperties { } /** - * Convenience method for debugging purposes. + * Convenience method for debugging purposes. + * * @param loc - * @return + * the loc + * @return true, if is passable */ public static final boolean isPassable(final PlayerLocation loc) { return isPassable(loc.getBlockCache(), loc.getX(), loc.getY(), loc.getZ(), loc.getTypeId()); @@ -2135,8 +2710,10 @@ public class BlockProperties { /** * Convenience method. + * * @param loc - * @return + * the loc + * @return true, if is passable */ public static final boolean isPassable(final Location loc) { return isPassable(loc.getWorld(), loc.getX(), loc.getY(), loc.getZ()); @@ -2144,11 +2721,16 @@ public class BlockProperties { /** * Convenience method. + * * @param world + * the world * @param x + * the x * @param y + * the y * @param z - * @return + * the z + * @return true, if is passable */ public static final boolean isPassable(final World world, final double x, final double y, final double z) { blockCache.setAccess(world); @@ -2159,9 +2741,12 @@ public class BlockProperties { /** * Normal ray tracing. + * * @param from + * the from * @param to - * @return + * the to + * @return true, if is passable */ public static final boolean isPassable(final Location from, final Location to) { return isPassable(rtRay, from, to); @@ -2169,15 +2754,28 @@ public class BlockProperties { /** * Axis-wise checking, like the client does. - * + * * @param from + * the from * @param to - * @return + * the to + * @return true, if is passable axis wise */ public static final boolean isPassableAxisWise(final Location from, final Location to) { return isPassable(rtAxis, from, to); } + /** + * Checks if is passable. + * + * @param rt + * the rt + * @param from + * the from + * @param to + * the to + * @return true, if is passable + */ private static boolean isPassable(final ICollidePassable rt, final Location from, final Location to) { blockCache.setAccess(from.getWorld()); rt.setMaxSteps(60); // TODO: Configurable ? @@ -2191,10 +2789,14 @@ public class BlockProperties { } /** - * Convenience method to allow using an already fetched or prepared IBlockAccess. + * Convenience method to allow using an already fetched or prepared + * IBlockAccess. + * * @param access + * the access * @param loc - * @return + * the loc + * @return true, if is passable */ public static final boolean isPassable(final BlockCache access, final Location loc) { @@ -2203,7 +2805,11 @@ public class BlockProperties { /** * API access to read extra properties from files. + * * @param config + * the config + * @param pathPrefix + * the path prefix */ public static void applyConfig(final RawConfigFile config, final String pathPrefix) { @@ -2269,14 +2875,26 @@ public class BlockProperties { } /** - * Test if the bounding box overlaps with a block of given flags (does not check the blocks bounding box). + * Test if the bounding box overlaps with a block of given flags (does not + * check the blocks bounding box). + * + * @param access + * the access * @param minX + * the min x * @param minY + * the min y * @param minZ + * the min z * @param maxX + * the max x * @param maxY + * the max y * @param maxZ - * @param flags Block flags (@see fr.neatmonster.nocheatplus.utilities.BlockProperties). + * the max z + * @param flags + * Block flags (@see + * fr.neatmonster.nocheatplus.utilities.BlockProperties). * @return If any block has the flags. */ public static final boolean hasAnyFlags(final BlockCache access, final double minX, double minY, final double minZ, final double maxX, final double maxY, final double maxZ, final long flags) { @@ -2285,14 +2903,26 @@ public class BlockProperties { /** - * Test if the bounding box overlaps with a block of given flags (does not check the blocks bounding box). + * Test if the bounding box overlaps with a block of given flags (does not + * check the blocks bounding box). + * + * @param access + * the access * @param minX + * the min x * @param minY + * the min y * @param minZ + * the min z * @param maxX + * the max x * @param maxY + * the max y * @param maxZ - * @param flags Block flags (@see fr.neatmonster.nocheatplus.utilities.BlockProperties). + * the max z + * @param flags + * Block flags (@see + * fr.neatmonster.nocheatplus.utilities.BlockProperties). * @return If any block has the flags. */ public static final boolean hasAnyFlags(final BlockCache access,final int minX, int minY, final int minZ, final int maxX, final int maxY, final int maxZ, final long flags) { @@ -2311,13 +2941,15 @@ public class BlockProperties { /** * Test if the box collide with any block that matches the flags somehow. * Convenience method. - * + * + * @param access + * the access * @param bounds * 'Classic' bounds as returned for blocks (minX, minY, minZ, * maxX, maxY, maxZ). * @param flags * The flags to match. - * @return + * @return true, if successful */ public static final boolean collides(final BlockCache access, double[] bounds, final long flags) { return collides(access, bounds[0], bounds[1], bounds[2], bounds[3], bounds[4], bounds[5], flags); @@ -2325,14 +2957,24 @@ public class BlockProperties { /** * Test if the box collide with any block that matches the flags somehow. + * + * @param access + * the access * @param minX + * the min x * @param minY + * the min y * @param minZ + * the min z * @param maxX + * the max x * @param maxY + * the max y * @param maxZ - * @param flags The flags to match. - * @return + * the max z + * @param flags + * The flags to match. + * @return true, if successful */ public static final boolean collides(final BlockCache access, final double minX, double minY, final double minZ, final double maxX, final double maxY, final double maxZ, final long flags) { final int iMinX = Location.locToBlock(minX); @@ -2365,31 +3007,51 @@ public class BlockProperties { /** * Convenience method for Material instead of block id. + * * @param access + * the access * @param minX + * the min x * @param minY + * the min y * @param minZ + * the min z * @param maxX + * the max x * @param maxY + * the max y * @param maxZ + * the max z * @param mat - * @return + * the mat + * @return true, if successful */ public static final boolean collidesId(final BlockCache access, final double minX, double minY, final double minZ, final double maxX, final double maxY, final double maxZ, final Material mat) { return collidesId(access, minX, minY, minZ, maxX, maxY, maxZ, mat.getId()); } /** - * Check if a block with the given id is overlapping with the bounds, this does not check the blocks actual bounds (All bounds of the block are seen as 0...1, for exact box match use collidesBlock). + * Check if a block with the given id is overlapping with the bounds, this + * does not check the blocks actual bounds (All bounds of the block are seen + * as 0...1, for exact box match use collidesBlock). + * * @param access + * the access * @param minX + * the min x * @param minY + * the min y * @param minZ + * the min z * @param maxX + * the max x * @param maxY + * the max y * @param maxZ + * the max z * @param id - * @return + * the id + * @return true, if successful */ public static final boolean collidesId(final BlockCache access, final double minX, double minY, final double minZ, final double maxX, final double maxY, final double maxZ, final int id) { final int iMinX = Location.locToBlock(minX); @@ -2411,16 +3073,26 @@ public class BlockProperties { } /** - * Check if the given bounding box collides with a block of the given id, taking into account the actual bounds of the block. + * Check if the given bounding box collides with a block of the given id, + * taking into account the actual bounds of the block. + * * @param access + * the access * @param minX + * the min x * @param minY + * the min y * @param minZ + * the min z * @param maxX + * the max x * @param maxY + * the max y * @param maxZ + * the max z * @param id - * @return + * the id + * @return true, if successful */ public static final boolean collidesBlock(final BlockCache access, final double minX, double minY, final double minZ, final double maxX, final double maxY, final double maxZ, final int id) { final int iMinX = Location.locToBlock(minX); @@ -2447,16 +3119,33 @@ public class BlockProperties { } /** - * Check if the bounds collide with the block that has the given type id at the given position. - *
    Delegates: This method signature is not used internally anymore. + * Check if the bounds collide with the block that has the given type id at + * the given position.
    + * Delegates: This method signature is not used internally anymore. + * * @param access + * the access * @param minX + * the min x * @param minY + * the min y * @param minZ + * the min z * @param maxX + * the max x * @param maxY + * the max y * @param maxZ + * the max z + * @param x + * the x + * @param y + * the y + * @param z + * the z * @param id + * the id + * @return true, if successful */ public static final boolean collidesBlock(final BlockCache access, final double minX, double minY, final double minZ, final double maxX, final double maxY, final double maxZ, final int x, final int y, final int z, final int id) { // TODO: use internal block data unless delegation wanted? @@ -2472,24 +3161,35 @@ public class BlockProperties { * Check if the bounds collide with the block for the given type id at the * given position. This does not check workarounds for ground_height nor * passable. - * + * * @param access + * the access * @param minX + * the min x * @param minY + * the min y * @param minZ + * the min z * @param maxX + * the max x * @param maxY + * the max y * @param maxZ + * the max z * @param x + * the x * @param y + * the y * @param z + * the z * @param id + * the id * @param bounds * Not null: bounds of the block at x, y, z. * @param flags * Block flags for the block at x, y, z. Mix in F_COLLIDE_EDGES * to disallow the "high edges" of blocks. - * @return + * @return true, if successful */ public static final boolean collidesBlock(final BlockCache access, final double minX, double minY, final double minZ, final double maxX, final double maxY, final double maxZ, final int x, final int y, final int z, final int id, final double[] bounds, final long flags) { final double bminX, bminZ, bminY; @@ -2590,13 +3290,16 @@ public class BlockProperties { /** * Determine if the liquid block below has full height or not (provided it * is max. level). - * - * @param blockCache + * + * @param access + * the access * @param x * Coordinates of the block above the liquid block in question. * @param y + * the y * @param z - * @return + * the z + * @return true, if successful */ public static boolean shouldLiquidBelowBeFullHeight(final BlockCache access, final int x, final int y, final int z) { final int id = access.getTypeId(x, y, z); @@ -2614,12 +3317,18 @@ public class BlockProperties { /** * Attempt to return the exact outside bounds, corrected by flags and other. - * @deprecated Not yet for real (only used in certain checks/contexts). + * * @param access + * the access * @param x + * the x * @param y + * the y * @param z - * @return If changed, a copy is returned, otherwise the original bounds returned by the BlockCache instance. + * the z + * @return If changed, a copy is returned, otherwise the original bounds + * returned by the BlockCache instance. + * @deprecated Not yet for real (only used in certain checks/contexts). */ public static double[] getCorrectedBounds(final BlockCache access, final int x, final int y, final int z) { return getCorrectedBounds(x, y, z, access.getTypeId(x, y, z), access.getBounds(x, y, z)); @@ -2627,13 +3336,20 @@ public class BlockProperties { /** * Attempt to return the exact outside bounds, corrected by flags and other. - * @deprecated Not yet for real (only used in certain checks/contexts). + * * @param x + * the x * @param y + * the y * @param z - * @param typeId + * the z + * @param id + * the id * @param bounds - * @return If changed, a copy is returned, otherwise the original array as given. + * the bounds + * @return If changed, a copy is returned, otherwise the original array as + * given. + * @deprecated Not yet for real (only used in certain checks/contexts). */ public static double[] getCorrectedBounds(final int x, final int y, final int z, final int id, final double[] bounds) { if (bounds == null) { @@ -2646,70 +3362,116 @@ public class BlockProperties { } /** - * Like isOnGround, just with minimum and maximum coordinates in arbitrary order. + * Like isOnGround, just with minimum and maximum coordinates in arbitrary + * order. + * * @param access + * the access * @param x1 + * the x1 * @param y1 + * the y1 * @param z1 + * the z1 * @param x2 + * the x2 * @param y2 + * the y2 * @param z2 - * @param xzMargin Subtracted from minima and added to maxima. - * @param yBelow Subtracted from the minimum of y. - * @param yAbove Added to the maximum of y. - * @return + * the z2 + * @param xzMargin + * Subtracted from minima and added to maxima. + * @param yBelow + * Subtracted from the minimum of y. + * @param yAbove + * Added to the maximum of y. + * @return true, if is on ground shuffled */ public static final boolean isOnGroundShuffled(final BlockCache access, final double x1, double y1, final double z1, final double x2, final double y2, final double z2, final double xzMargin, final double yBelow, final double yAbove) { return isOnGroundShuffled(access, x1, y1, z1, x2, y2, z2, xzMargin, yBelow, yAbove, 0L); } /** - * Similar to collides(... , F_GROUND), but also checks the block above (against spider).
    - * NOTE: This does not return true if stuck, to check for that use collidesBlock for the players location. + * Similar to collides(... , F_GROUND), but also checks the block above + * (against spider).
    + * NOTE: This does not return true if stuck, to check for that use + * collidesBlock for the players location. + * * @param access + * the access * @param minX + * the min x * @param minY + * the min y * @param minZ + * the min z * @param maxX + * the max x * @param maxY + * the max y * @param maxZ - * @return + * the max z + * @return true, if is on ground */ public static final boolean isOnGround(final BlockCache access, final double minX, double minY, final double minZ, final double maxX, final double maxY, final double maxZ) { return isOnGround(access, minX, minY, minZ, maxX, maxY, maxZ, 0L); } /** - * Like isOnGround, just with minimum and maximum coordinates in arbitrary order. + * Like isOnGround, just with minimum and maximum coordinates in arbitrary + * order. + * * @param access + * the access * @param x1 + * the x1 * @param y1 + * the y1 * @param z1 + * the z1 * @param x2 + * the x2 * @param y2 + * the y2 * @param z2 - * @param xzMargin Subtracted from minima and added to maxima. - * @param yBelow Subtracted from the minimum of y. - * @param yAbove Added to the maximum of y. + * the z2 + * @param xzMargin + * Subtracted from minima and added to maxima. + * @param yBelow + * Subtracted from the minimum of y. + * @param yAbove + * Added to the maximum of y. * @param ignoreFlags - * @return + * the ignore flags + * @return true, if is on ground shuffled */ public static final boolean isOnGroundShuffled(final BlockCache access, final double x1, double y1, final double z1, final double x2, final double y2, final double z2, final double xzMargin, final double yBelow, final double yAbove, final long ignoreFlags) { return isOnGround(access, Math.min(x1, x2) - xzMargin, Math.min(y1, y2) - yBelow, Math.min(z1, z2) - xzMargin, Math.max(x1, x2) + xzMargin, Math.max(y1, y2) + yAbove, Math.max(z1, z2) + xzMargin, ignoreFlags); } /** - * Similar to collides(... , F_GROUND), but also checks the block above (against spider).
    - * NOTE: This does not return true if stuck, to check for that use collidesBlock for the players location. + * Similar to collides(... , F_GROUND), but also checks the block above + * (against spider).
    + * NOTE: This does not return true if stuck, to check for that use + * collidesBlock for the players location. + * * @param access - * @param minX Bounding box coordinates... + * the access + * @param minX + * Bounding box coordinates... * @param minY + * the min y * @param minZ + * the min z * @param maxX - * @param maxY Meant to be the foot-level. + * the max x + * @param maxY + * Meant to be the foot-level. * @param maxZ - * @param ignoreFlags Blocks with these flags are not counted as ground. - * @return + * the max z + * @param ignoreFlags + * Blocks with these flags are not counted as ground. + * @return true, if is on ground */ public static final boolean isOnGround(final BlockCache access, final double minX, double minY, final double minZ, final double maxX, final double maxY, final double maxZ, final long ignoreFlags) { final int maxBlockY = access.getMaxBlockY(); @@ -2876,8 +3638,10 @@ public class BlockProperties { /** * All dimensions 0 ... 1, no null checks. - * @param bounds Block bounds: minX, minY, minZ, maxX, maxY, maxZ - * @return + * + * @param bounds + * Block bounds: minX, minY, minZ, maxX, maxY, maxZ + * @return true, if is full bounds */ public static final boolean isFullBounds(final double[] bounds) { for (int i = 0; i < 3; i++) { @@ -2890,8 +3654,11 @@ public class BlockProperties { /** * Check if the bounds are the same. No null checks. + * * @param bounds1 + * the bounds1 * @param bounds2 + * the bounds2 * @return Block bounds: minX, minY, minZ, maxX, maxY, maxZ */ public static final boolean isSameShape(final double[] bounds1, final double[] bounds2) { @@ -2912,25 +3679,36 @@ public class BlockProperties { * only the x-z move is regarded, no envelope/consistency checks are * performed here, such as checking if the block is liquid at all, nor if * the move makes sense. performed here. - * + * * @param from + * the from * @param to - * @return + * the to + * @return true, if is down stream */ public static final boolean isDownStream(final PlayerLocation from, final PlayerLocation to) { return isDownStream(from.getBlockCache(), from.getBlockX(), from.getBlockY(), from.getBlockZ(), from.getData(), to.getX() - from.getX(), to.getZ() - from.getZ()); } /** - * Check if a move determined by xDistance and zDistance is leading down stream. + * Check if a move determined by xDistance and zDistance is leading down + * stream. + * * @param access + * the access * @param x + * the x * @param y + * the y * @param z + * the z * @param data + * the data * @param dX + * the d x * @param dZ - * @return + * the d z + * @return true, if is down stream */ public static final boolean isDownStream(final BlockCache access, final int x, final int y, final int z, final int data, final double dX, final double dZ) { @@ -2977,15 +3755,24 @@ public class BlockProperties { } /** - * Collect all flags of blocks touched by the bounds, this does not check versus the blocks bounding box. + * Collect all flags of blocks touched by the bounds, this does not check + * versus the blocks bounding box. + * * @param access + * the access * @param minX + * the min x * @param minY + * the min y * @param minZ + * the min z * @param maxX + * the max x * @param maxY + * the max y * @param maxZ - * @return + * the max z + * @return the long */ public static final long collectFlagsSimple(final BlockCache access, final double minX, double minY, final double minZ, final double maxX, final double maxY, final double maxZ) { final int iMinX = Location.locToBlock(minX); @@ -3008,7 +3795,8 @@ public class BlockProperties { /** * Penalty factor for block break duration if under water. - * @return + * + * @return the break penalty in water */ public static float getBreakPenaltyInWater() { return breakPenaltyInWater; @@ -3016,7 +3804,9 @@ public class BlockProperties { /** * Penalty factor for block break duration if under water. + * * @param breakPenaltyInWater + * the new break penalty in water */ public static void setBreakPenaltyInWater(float breakPenaltyInWater) { BlockProperties.breakPenaltyInWater = breakPenaltyInWater; @@ -3024,7 +3814,8 @@ public class BlockProperties { /** * Penalty factor for block break duration if not on ground. - * @return + * + * @return the break penalty off ground */ public static float getBreakPenaltyOffGround() { return breakPenaltyOffGround; @@ -3032,7 +3823,9 @@ public class BlockProperties { /** * Penalty factor for block break duration if not on ground. + * * @param breakPenaltyOffGround + * the new break penalty off ground */ public static void setBreakPenaltyOffGround(float breakPenaltyOffGround) { BlockProperties.breakPenaltyOffGround = breakPenaltyOffGround; @@ -3050,19 +3843,31 @@ public class BlockProperties { } /** - * + * Checks if is passable ray. + * * @param access - * @param blockX Block location. + * the access + * @param blockX + * Block location. * @param blockY + * the block y * @param blockZ - * @param oX Origin / offset from block location. + * the block z + * @param oX + * Origin / offset from block location. * @param oY + * the o y * @param oZ - * @param dX Direction (multiplied by dT to get end point of move). + * the o z + * @param dX + * Direction (multiplied by dT to get end point of move). * @param dY + * the d y * @param dZ - * @param dT - * @return + * the d z + * @param dT + * the d t + * @return true, if is passable ray */ public static final boolean isPassableRay(final BlockCache access, final int blockX, final int blockY, final int blockZ, final double oX, final double oY, final double oZ, final double dX, final double dY, final double dZ, final double dT) { final int id = access.getTypeId(blockX, blockY, blockZ); @@ -3121,18 +3926,28 @@ public class BlockProperties { /** * Check passability with an arbitrary bounding box vs. a block. - * + * * @param access + * the access * @param blockX + * the block x * @param blockY + * the block y * @param blockZ + * the block z * @param minX + * the min x * @param minY + * the min y * @param minZ + * the min z * @param maxX + * the max x * @param maxY + * the max y * @param maxZ - * @return + * the max z + * @return true, if is passable box */ public static final boolean isPassableBox(final BlockCache access, final int blockX, final int blockY, final int blockZ, @@ -3165,15 +3980,22 @@ public class BlockProperties { /** * Check if the bounding box collides with a block (passable + accounting * for workarounds). - * + * * @param access + * the access * @param minX + * the min x * @param minY + * the min y * @param minZ + * the min z * @param maxX + * the max x * @param maxY + * the max y * @param maxZ - * @return + * the max z + * @return true, if is passable box */ public static final boolean isPassableBox(final BlockCache access, final double minX, final double minY, final double minZ, @@ -3199,15 +4021,24 @@ public class BlockProperties { /** * Add the block coordinates that are colliding via a isPassableBox check * for the given bounds to the given container. - * + * * @param access + * the access * @param minX + * the min x * @param minY + * the min y * @param minZ + * the min z * @param maxX + * the max x * @param maxY + * the max y * @param maxZ + * the max z * @param results + * the results + * @return the int */ public static final int collectInitiallyCollidingBlocks(final BlockCache access, final double minX, final double minY, final double minZ, @@ -3236,8 +4067,8 @@ public class BlockProperties { /** * Test for special case activation: trap door is climbable above ladder * with distinct facing. - * - * @return + * + * @return true, if is special case trap door above ladder */ public static boolean isSpecialCaseTrapDoorAboveLadder() { return specialCaseTrapDoorAboveLadder; @@ -3246,8 +4077,9 @@ public class BlockProperties { /** * Set special case activation: trap door is climbable above ladder with * distinct facing. - * + * * @param specialCaseTrapDoorAboveLadder + * the new special case trap door above ladder */ public static void setSpecialCaseTrapDoorAboveLadder(boolean specialCaseTrapDoorAboveLadder) { BlockProperties.specialCaseTrapDoorAboveLadder = specialCaseTrapDoorAboveLadder; diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/CheckUtils.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/CheckUtils.java index 7ddc1ce5..dae5357e 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/CheckUtils.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/CheckUtils.java @@ -41,17 +41,23 @@ import fr.neatmonster.nocheatplus.hooks.NCPExemptionManager; import fr.neatmonster.nocheatplus.logging.StaticLog; import fr.neatmonster.nocheatplus.logging.Streams; +// TODO: Auto-generated Javadoc /** * Random auxiliary gear, some might have general quality. Contents are likely to get moved to other classes. */ public class CheckUtils { + /** The Constant logOnce. */ // TODO: Quick and dirty -> other methods elsewhere. private static final Set logOnce = Collections.synchronizedSet(new HashSet()); /** * Kick and log. + * * @param player + * the player + * @param cc + * the cc */ public static void kickIllegalMove(final Player player, final MovingConfig cc){ player.kickPlayer(cc.msgKickIllegalMove); @@ -59,11 +65,17 @@ public class CheckUtils { } /** - * Guess some last-action time, likely to be replaced with centralized PlayerData use. + * Guess some last-action time, likely to be replaced with centralized + * PlayerData use. + * * @param player - * @param Timestamp of the moment of calling this. - * @param maxAge Maximum age in milliseconds. - * @return Return timestamp or Long.MIN_VALUE if not possible or beyond maxAge. + * the player + * @param now + * the now + * @param maxAge + * Maximum age in milliseconds. + * @return Return timestamp or Long.MIN_VALUE if not possible or beyond + * maxAge. */ public static final long guessKeepAliveTime(final Player player, final long now, final long maxAge){ final int tick = TickTask.getTick(); @@ -92,9 +104,12 @@ public class CheckUtils { } /** - * Check getPassenger recursively until a player is found, return that one or null. + * Check getPassenger recursively until a player is found, return that one + * or null. + * * @param entity - * @return + * the entity + * @return the first player passenger */ public static Player getFirstPlayerPassenger(final Entity entity) { Entity passenger = entity.getPassenger(); @@ -110,10 +125,10 @@ public class CheckUtils { /** * Check recursively for vehicles, returns null if players are vehicles, * otherwise the lowest vehicle (that has no vehicle). - * + * * @param passenger * The passenger of vehicles. Typically the player. - * @return + * @return the last non player vehicle */ public static Entity getLastNonPlayerVehicle(final Entity passenger) { Entity vehicle = passenger.getVehicle(); @@ -133,8 +148,10 @@ public class CheckUtils { /** * Check for NaN, infinity. + * * @param floats - * @return + * the floats + * @return true, if is bad coordinate */ public static boolean isBadCoordinate(float ... floats) { for (int i = 0; i < floats.length; i++) { @@ -147,8 +164,10 @@ public class CheckUtils { /** * Check for NaN, infinity. + * * @param doubles - * @return + * the doubles + * @return true, if is bad coordinate */ public static boolean isBadCoordinate(double ... doubles) { for (int i = 0; i < doubles.length; i++) { @@ -162,16 +181,18 @@ public class CheckUtils { /** * Check for config flag and exemption (hasBypass). Meant thread-safe. - * + * * @param checkType + * the check type * @param player + * the player * @param data * If data is null, the data factory will be used for the given * check type. * @param cc * If config is null, the config factory will be used for the * given check type. - * @return + * @return true, if is enabled */ public static boolean isEnabled(final CheckType checkType, final Player player, final ICheckData data, final ICheckConfig cc) { if (cc == null) { @@ -188,13 +209,15 @@ public class CheckUtils { /** * Check for exemption by permissions, API access, possibly other. Meant * thread-safe. - * - * @param player + * * @param checkType + * the check type + * @param player + * the player * @param data * If data is null, the data factory will be used for the given * check type. - * @return + * @return true, if successful */ public static boolean hasBypass(final CheckType checkType, final Player player, final ICheckData data) { // TODO: Checking for the thread might be a temporary measure. @@ -222,6 +245,12 @@ public class CheckUtils { return NCPExemptionManager.isExempted(player, checkType); } + /** + * Improper api access. + * + * @param checkType + * the check type + */ private static void improperAPIAccess(final CheckType checkType) { // TODO: Log once + examine stack (which plugins/things are involved). final String trace = Arrays.toString(Thread.currentThread().getStackTrace()); @@ -247,11 +276,13 @@ public class CheckUtils { /** * Static relay for the check-specific convenience methods, logging with * standard format ([check_type] [player_name] ...). - * + * * @param player * May be null. * @param checkType + * the check type * @param message + * the message */ public static void debug(final Player player, final CheckType checkType, final String message) { NCPAPIProvider.getNoCheatPlusAPI().getLogManager().debug(Streams.TRACE_FILE, getLogMessagePrefix(player, checkType) + message); @@ -259,11 +290,12 @@ public class CheckUtils { /** * Get the standard log message prefix with a trailing space. - * + * * @param player * May be null. * @param checkType - * @return + * the check type + * @return the log message prefix */ public static String getLogMessagePrefix(final Player player, final CheckType checkType) { String base = "[" + checkType + "] "; @@ -276,8 +308,8 @@ public class CheckUtils { /** * Convenience method to get a Random instance from the generic registry * (NoCheatPlusAPI). - * - * @return + * + * @return the random */ public static Random getRandom() { return NCPAPIProvider.getNoCheatPlusAPI().getGenericInstance(Random.class); @@ -285,10 +317,10 @@ public class CheckUtils { /** * Test if the item is consumable, like food, potions, milk bucket. - * + * * @param stack * May be null. - * @return + * @return true, if is consumable */ public static boolean isConsumable(final ItemStack stack) { return stack == null ? false : isConsumable(stack.getType()); @@ -296,10 +328,10 @@ public class CheckUtils { /** * Test if the item is consumable, like food, potions, milk bucket. - * + * * @param type * May be null. - * @return + * @return true, if is consumable */ public static boolean isConsumable(final Material type) { return type != null && @@ -309,8 +341,9 @@ public class CheckUtils { /** * Return the first consumable item found, checking main hand first and then * off hand, if available. Concerns food/edible, potions, milk bucket. - * + * * @param player + * the player * @return null in case no item is consumable. */ public static ItemStack getFirstConsumableItemInHand(final Player player) { diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/ColorUtil.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/ColorUtil.java index b9730c4d..6dfd6395 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/ColorUtil.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/ColorUtil.java @@ -16,6 +16,7 @@ package fr.neatmonster.nocheatplus.utilities; import org.bukkit.ChatColor; +// TODO: Auto-generated Javadoc /** * More and less color. Methods couls also in StringUtil, but that is in NCPCommons without Bukkit dependency. * @author mc_dev @@ -23,7 +24,7 @@ import org.bukkit.ChatColor; */ public class ColorUtil { - /** Needs updating from Bukkit implementation (ChatColor) */ + /** Needs updating from Bukkit implementation (ChatColor). */ private static final String allColorChars = "0123456789AaBbCcDdEeFfKkLlMmNnOoRr"; /** diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/FakeBlockCache.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/FakeBlockCache.java index 66f9c155..0f0ec152 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/FakeBlockCache.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/FakeBlockCache.java @@ -26,6 +26,7 @@ import fr.neatmonster.nocheatplus.utilities.ds.map.CoordHashMap; import fr.neatmonster.nocheatplus.utilities.ds.map.CoordMap; import fr.neatmonster.nocheatplus.utilities.ds.map.CoordMap.Entry; +// TODO: Auto-generated Javadoc /** * Stand-alone BlockCache for setting data by access methods, for testing purposes. * @author dev1mc @@ -43,15 +44,25 @@ public class FakeBlockCache extends BlockCache { private final CoordMap boundsMapStored = new CoordHashMap(23); /** - * Convenience method to copy a cuboid region given by two endpoints without any order specified. + * Convenience method to copy a cuboid region given by two endpoints without + * any order specified. + * * @param other + * the other * @param x0 + * the x0 * @param y0 + * the y0 * @param z0 + * the z0 * @param x1 + * the x1 * @param y1 + * the y1 * @param z1 + * the z1 * @param margin + * the margin */ public void set(BlockCache other, double x0, double y0, double z0, double x1, double y1, double z1, double margin) { set(other, Location.locToBlock(Math.min(x0, x1) - margin), Location.locToBlock(Math.min(y0, y1) - margin), Location.locToBlock(Math.min(z0, z1) - margin), @@ -60,13 +71,21 @@ public class FakeBlockCache extends BlockCache { /** * Copy a cuboid region from the other BlockCache instance. + * * @param other + * the other * @param minX + * the min x * @param minY + * the min y * @param minZ + * the min z * @param maxX + * the max x * @param maxY + * the max y * @param maxZ + * the max z */ public void set(BlockCache other, int minX, int minY, int minZ, int maxX, int maxY, int maxZ) { for (int x = minX; x <= maxX; x++) { @@ -80,22 +99,33 @@ public class FakeBlockCache extends BlockCache { /** * Set with data=0 and bounds=full. + * * @param x + * the x * @param y + * the y * @param z + * the z * @param type + * the type */ public void set(int x, int y, int z, Material type) { set(x, y, z, BlockProperties.getId(type)); } /** - * Set with data=0- + * Set with data=0-. + * * @param x + * the x * @param y + * the y * @param z + * the z * @param type + * the type * @param bounds + * the bounds */ public void set(int x, int y, int z, Material type, double[] bounds) { set(x, y, z, BlockProperties.getId(type), 0, bounds); @@ -103,10 +133,15 @@ public class FakeBlockCache extends BlockCache { /** * Set with data=0 and bounds=full. + * * @param x + * the x * @param y + * the y * @param z + * the z * @param typeId + * the type id */ public void set(int x, int y, int z, int typeId) { set(x, y, z, typeId, 0); @@ -114,11 +149,17 @@ public class FakeBlockCache extends BlockCache { /** * Set with bounds=full. + * * @param x + * the x * @param y + * the y * @param z + * the z * @param typeId + * the type id * @param data + * the data */ public void set(int x, int y, int z, int typeId, int data) { set(x, y, z, typeId, data, new double[]{0.0, 0.0, 0.0, 1.0, 1.0, 1.0}); @@ -126,12 +167,19 @@ public class FakeBlockCache extends BlockCache { /** * Set custom properties. + * * @param x + * the x * @param y + * the y * @param z + * the z * @param typeId + * the type id * @param data - * @param bounds Stores the given bounds directly. + * the data + * @param bounds + * Stores the given bounds directly. */ public void set(int x, int y, int z, int typeId, int data, double[] bounds) { idMapStored.put(x, y, z, typeId); @@ -146,13 +194,21 @@ public class FakeBlockCache extends BlockCache { /** * Fill the entire cuboid. + * * @param x1 + * the x1 * @param y1 + * the y1 * @param z1 + * the z1 * @param x2 + * the x2 * @param y2 + * the y2 * @param z2 + * the z2 * @param type + * the type */ public void fill(int x1, int y1, int z1, int x2, int y2, int z2, Material type) { fill(x1, y1, z1, x2, y2, z2, BlockProperties.getId(type), 0, new double[]{0.0, 0.0, 0.0, 1.0, 1.0, 1.0}); @@ -160,15 +216,25 @@ public class FakeBlockCache extends BlockCache { /** * Fill the entire cuboid. + * * @param x1 + * the x1 * @param y1 + * the y1 * @param z1 + * the z1 * @param x2 + * the x2 * @param y2 + * the y2 * @param z2 + * the z2 * @param typeId + * the type id * @param data + * the data * @param bounds + * the bounds */ public void fill(int x1, int y1, int z1, int x2, int y2, int z2, int typeId, int data, double[] bounds) { for (int x = x1; x <= x2; x++) { @@ -182,13 +248,21 @@ public class FakeBlockCache extends BlockCache { /** * Horizontal walls. + * * @param x1 + * the x1 * @param y1 + * the y1 * @param z1 + * the z1 * @param x2 + * the x2 * @param y2 + * the y2 * @param z2 + * the z2 * @param type + * the type */ public void walls(int x1, int y1, int z1, int x2, int y2, int z2, Material type) { walls(x1, y1, z1, x2, y2, z2, BlockProperties.getId(type), 0, new double[]{0.0, 0.0, 0.0, 1.0, 1.0, 1.0}); @@ -196,15 +270,25 @@ public class FakeBlockCache extends BlockCache { /** * Horizontal walls. + * * @param x1 + * the x1 * @param y1 + * the y1 * @param z1 + * the z1 * @param x2 + * the x2 * @param y2 + * the y2 * @param z2 + * the z2 * @param typeId + * the type id * @param data + * the data * @param bounds + * the bounds */ public void walls(int x1, int y1, int z1, int x2, int y2, int z2, int typeId, int data, double[] bounds) { for (int x = x1; x <= x2; x++) { @@ -220,13 +304,21 @@ public class FakeBlockCache extends BlockCache { /** * Walls, floor, ceiling. + * * @param x1 + * the x1 * @param y1 + * the y1 * @param z1 + * the z1 * @param x2 + * the x2 * @param y2 + * the y2 * @param z2 + * the z2 * @param type + * the type */ public void room(int x1, int y1, int z1, int x2, int y2, int z2, Material type) { room(x1, y1, z1, x2, y2, z2, BlockProperties.getId(type), 0, new double[]{0.0, 0.0, 0.0, 1.0, 1.0, 1.0}); @@ -234,15 +326,25 @@ public class FakeBlockCache extends BlockCache { /** * Walls, floor, ceiling. + * * @param x1 + * the x1 * @param y1 + * the y1 * @param z1 + * the z1 * @param x2 + * the x2 * @param y2 + * the y2 * @param z2 + * the z2 * @param typeId + * the type id * @param data + * the data * @param bounds + * the bounds */ public void room(int x1, int y1, int z1, int x2, int y2, int z2, int typeId, int data, double[] bounds) { for (int x = x1; x <= x2; x++) { @@ -258,20 +360,30 @@ public class FakeBlockCache extends BlockCache { /** * Test if any an id is set for this block position. + * * @param x + * the x * @param y + * the y * @param z - * @return + * the z + * @return true, if successful */ public boolean hasIdEntry(int x, int y, int z) { return idMapStored.contains(x, y, z); } /** - * Return a line of java code to construct a new FakeBlockCache with the same content (no newlines). + * Return a line of java code to construct a new FakeBlockCache with the + * same content (no newlines). + * * @param builder - * @param fbcName Variable name of the FakeBlockCache instance. - * @param boundsPrefix A prefix for bounds variables for the case of repeated content. If set to null, no optimization will be performed. + * the builder + * @param fbcName + * Variable name of the FakeBlockCache instance. + * @param boundsPrefix + * A prefix for bounds variables for the case of repeated + * content. If set to null, no optimization will be performed. */ public void toJava(final StringBuilder builder, final String fbcName, final String boundsPrefix) { builder.append("FakeBlockCache " + fbcName + " = new FakeBlockCache();"); @@ -317,11 +429,17 @@ public class FakeBlockCache extends BlockCache { } } + /* (non-Javadoc) + * @see fr.neatmonster.nocheatplus.utilities.BlockCache#setAccess(org.bukkit.World) + */ @Override public void setAccess(World world) { // Ignore. } + /* (non-Javadoc) + * @see fr.neatmonster.nocheatplus.utilities.BlockCache#fetchTypeId(int, int, int) + */ @Override public int fetchTypeId(int x, int y, int z) { final Integer id = idMapStored.get(x, y, z); @@ -332,6 +450,9 @@ public class FakeBlockCache extends BlockCache { } } + /* (non-Javadoc) + * @see fr.neatmonster.nocheatplus.utilities.BlockCache#fetchData(int, int, int) + */ @Override public int fetchData(int x, int y, int z) { final Integer data = dataMapStored.get(x, y, z); @@ -342,6 +463,9 @@ public class FakeBlockCache extends BlockCache { } } + /* (non-Javadoc) + * @see fr.neatmonster.nocheatplus.utilities.BlockCache#fetchBounds(int, int, int) + */ @Override public double[] fetchBounds(int x, int y, int z) { final double[] bounds = boundsMapStored.get(x, y, z); @@ -349,6 +473,9 @@ public class FakeBlockCache extends BlockCache { return bounds; } + /* (non-Javadoc) + * @see fr.neatmonster.nocheatplus.utilities.BlockCache#standsOnEntity(org.bukkit.entity.Entity, double, double, double, double, double, double) + */ @Override public boolean standsOnEntity(Entity entity, double minX, double minY, double minZ, double maxX, double maxY, double maxZ) { @@ -356,6 +483,9 @@ public class FakeBlockCache extends BlockCache { return false; } + /* (non-Javadoc) + * @see fr.neatmonster.nocheatplus.utilities.BlockCache#cleanup() + */ @Override public void cleanup() { super.cleanup(); diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/IdUtil.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/IdUtil.java index 12db3a40..5254fafd 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/IdUtil.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/IdUtil.java @@ -16,6 +16,7 @@ package fr.neatmonster.nocheatplus.utilities; import java.util.UUID; +// TODO: Auto-generated Javadoc /** * Utility for UUIDs, player names. * @author mc_dev @@ -24,20 +25,24 @@ import java.util.UUID; public class IdUtil { /** - * Valid user name check (Minecraft).
    - * (Taken from TrustCore.) - * @param name Allows null input. - * @return - */ + * Valid user name check (Minecraft).
    + * (Taken from TrustCore.) + * + * @param name + * Allows null input. + * @return true, if is valid minecraft user name + */ public static boolean isValidMinecraftUserName(final String name) { return name != null && name.matches("[\\w]{2,16}"); } /** - * Safe method to parse a UUID, using UUIDFromString internally. - * @param input - * @return - */ + * Safe method to parse a UUID, using UUIDFromString internally. + * + * @param input + * the input + * @return the uuid + */ public static UUID UUIDFromStringSafe(final String input) { if (input == null) { return null; @@ -50,11 +55,13 @@ public class IdUtil { } /** - * More flexible UUID parsing.
    - * (Taken from TrustCore.) - * @param input - * @return - */ + * More flexible UUID parsing.
    + * (Taken from TrustCore.) + * + * @param input + * the input + * @return the uuid + */ public static UUID UUIDFromString(final String input) { // TODO: Add unit tests. final int len = input.length(); diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/InventoryUtil.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/InventoryUtil.java index 6300850b..fde4750c 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/InventoryUtil.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/InventoryUtil.java @@ -22,6 +22,7 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.InventoryView; import org.bukkit.inventory.ItemStack; +// TODO: Auto-generated Javadoc /** * Auxiliary/convenience methods for inventories. * @author mc_dev @@ -30,10 +31,12 @@ import org.bukkit.inventory.ItemStack; public class InventoryUtil { /** - * Does not account for special slots like armor. - * @param inventory - * @return - */ + * Does not account for special slots like armor. + * + * @param inventory + * the inventory + * @return the free slots + */ public static int getFreeSlots(final Inventory inventory) { final ItemStack[] contents = inventory.getContents(); int count = 0; @@ -46,11 +49,15 @@ public class InventoryUtil { } /** - * Count slots with type-id and data (enchantments and other meta data are ignored at present). - * @param inventory - * @param reference - * @return - */ + * Count slots with type-id and data (enchantments and other meta data are + * ignored at present). + * + * @param inventory + * the inventory + * @param reference + * the reference + * @return the stack count + */ public static int getStackCount(final Inventory inventory, final ItemStack reference) { if (inventory == null) return 0; if (reference == null) return getFreeSlots(inventory); @@ -71,19 +78,27 @@ public class InventoryUtil { } /** - * Sum of bottom + top inventory slots with item type / data, see: getStackCount(Inventory, reference). - * @param view - * @param reference - * @return - */ + * Sum of bottom + top inventory slots with item type / data, see: + * getStackCount(Inventory, reference). + * + * @param view + * the view + * @param reference + * the reference + * @return the stack count + */ public static int getStackCount(final InventoryView view, final ItemStack reference) { return getStackCount(view.getBottomInventory(), reference) + getStackCount(view.getTopInventory(), reference); } /** - * Search for players / passengers (broken by name: closes the inventory of first player found including entity and passengers recursively). - * @param entity - */ + * Search for players / passengers (broken by name: closes the inventory of + * first player found including entity and passengers recursively). + * + * @param entity + * the entity + * @return true, if successful + */ public static boolean closePlayerInventoryRecursively(Entity entity) { // Find a player. final Player player = getPlayerPassengerRecursively(entity); @@ -95,10 +110,13 @@ public class InventoryUtil { } /** - * Get a player from an entity. This will return the first player found amongst the entity itself and passengers checked recursively. - * @param entity - * @return - */ + * Get a player from an entity. This will return the first player found + * amongst the entity itself and passengers checked recursively. + * + * @param entity + * the entity + * @return the player passenger recursively + */ public static Player getPlayerPassengerRecursively(Entity entity) { while (entity != null) { if (entity instanceof Player) { @@ -118,10 +136,13 @@ public class InventoryUtil { } /** - * Close one players inventory, if open. This might ignore InventoryType.CRAFTING (see: hasInventoryOpen). - * @param player - * @return If closed. - */ + * Close one players inventory, if open. This might ignore + * InventoryType.CRAFTING (see: hasInventoryOpen). + * + * @param player + * the player + * @return If closed. + */ public static boolean closeOpenInventory(final Player player) { if (hasInventoryOpen(player)) { player.closeInventory(); @@ -132,10 +153,13 @@ public class InventoryUtil { } /** - * Check if the players inventory is open. This might ignore InventoryType.CRAFTING. - * @param player - * @return - */ + * Check if the players inventory is open. This might ignore + * InventoryType.CRAFTING. + * + * @param player + * the player + * @return true, if successful + */ public static boolean hasInventoryOpen(final Player player) { final InventoryView view = player.getOpenInventory(); return view != null && view.getType() != InventoryType.CRAFTING; diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/OnDemandTickListener.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/OnDemandTickListener.java index bce492d2..01f973fb 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/OnDemandTickListener.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/OnDemandTickListener.java @@ -16,6 +16,7 @@ package fr.neatmonster.nocheatplus.utilities; import fr.neatmonster.nocheatplus.components.registry.feature.TickListener; +// TODO: Auto-generated Javadoc /** * Auxiliary class for easier short term adding of TickListener. Override delegateTick.
    * NOTES: @@ -25,88 +26,101 @@ import fr.neatmonster.nocheatplus.components.registry.feature.TickListener; * */ public abstract class OnDemandTickListener implements TickListener{ - - protected boolean isRegistered = false; - - /** - * Override this to get called on a tick. - * @param tick See: TickListener.onTick - * @param timeLast See: TickListener.onTick - * @return true to stay registered, false to unregister. - */ - public abstract boolean delegateTick(final int tick, final long timeLast); - @Override - public void onTick(final int tick, final long timeLast) { - if (!isRegistered){ - // Could happen due to concurrency. - // (No extra unregister, to preserve order). - return; - } - else if (!delegateTick(tick, timeLast)){ - // Remove from TickListenerS. - unRegister(); - } - } - - /** - * Register with TickTask, does check the isRegistered flag. - * @return This instance for chaining. - */ - public OnDemandTickListener register(){ - return register(false); - } - - /** - * Register with the TickTask if force is true or if isRegistered is false. - * @param force Set to true to call TickTask.addTickListener. - * @return - */ - public OnDemandTickListener register(final boolean force){ - if (force || !isRegistered){ - // Flag is set in the TickTask. - TickTask.addTickListener(this); - } - return this; - } - - /** - * Unregister from TickTask, does check the isRegistered flag. - * @return This instance for chaining. - */ - public OnDemandTickListener unRegister(){ - return unRegister(false); - } - - /** - * Unregister from TickTask, if force is true or isRegistered is true. - * @param force - * @return This instance for chaining. - */ - public OnDemandTickListener unRegister(final boolean force){ - if (force || isRegistered){ - // Flag is set in the TickTask. - TickTask.removeTickListener(this); - } - return this; - } - - /** - * A way to set isRegistered without causing any further calls to TickTask (for call from TickTask itself).
    - * This must not cause any calls that use the TickListener registry of the TickTask (deadlocks / concurrent modification etc.).
    - * Used by the TickTask, called under lock of TickListenerS. - * @param registered - */ - public void setRegistered(final boolean registered){ - isRegistered = registered; - } - - /** - * Test if this instance has been registered with the TickTask. - * @return - */ - public boolean isRegistered(){ - return isRegistered; - } + /** The is registered. */ + protected boolean isRegistered = false; + + /** + * Override this to get called on a tick. + * @param tick See: TickListener.onTick + * @param timeLast See: TickListener.onTick + * @return true to stay registered, false to unregister. + */ + public abstract boolean delegateTick(final int tick, final long timeLast); + + /* (non-Javadoc) + * @see fr.neatmonster.nocheatplus.components.registry.feature.TickListener#onTick(int, long) + */ + @Override + public void onTick(final int tick, final long timeLast) { + if (!isRegistered){ + // Could happen due to concurrency. + // (No extra unregister, to preserve order). + return; + } + else if (!delegateTick(tick, timeLast)){ + // Remove from TickListenerS. + unRegister(); + } + } + + /** + * Register with TickTask, does check the isRegistered flag. + * @return This instance for chaining. + */ + public OnDemandTickListener register(){ + return register(false); + } + + /** + * Register with the TickTask if force is true or if isRegistered is false. + * + * @param force + * Set to true to call TickTask.addTickListener. + * @return the on demand tick listener + */ + public OnDemandTickListener register(final boolean force){ + if (force || !isRegistered){ + // Flag is set in the TickTask. + TickTask.addTickListener(this); + } + return this; + } + + /** + * Unregister from TickTask, does check the isRegistered flag. + * @return This instance for chaining. + */ + public OnDemandTickListener unRegister(){ + return unRegister(false); + } + + /** + * Unregister from TickTask, if force is true or isRegistered is true. + * + * @param force + * the force + * @return This instance for chaining. + */ + public OnDemandTickListener unRegister(final boolean force){ + if (force || isRegistered){ + // Flag is set in the TickTask. + TickTask.removeTickListener(this); + } + return this; + } + + /** + * A way to set isRegistered without causing any further calls to TickTask + * (for call from TickTask itself).
    + * This must not cause any calls that use the TickListener registry of the + * TickTask (deadlocks / concurrent modification etc.).
    + * Used by the TickTask, called under lock of TickListenerS. + * + * @param registered + * the new registered + */ + public void setRegistered(final boolean registered){ + isRegistered = registered; + } + + /** + * Test if this instance has been registered with the TickTask. + * + * @return true, if is registered + */ + public boolean isRegistered(){ + return isRegistered; + } } diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java index 16d081d6..d09d4ed0 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java @@ -20,6 +20,7 @@ import org.bukkit.entity.Player; import fr.neatmonster.nocheatplus.compat.MCAccess; +// TODO: Auto-generated Javadoc /** * Lots of content for a location a player is supposed to be at. Constructors * for convenient use. @@ -30,13 +31,27 @@ public class PlayerLocation extends RichEntityLocation { // "Heavy" object members that need to be set to null on cleanup. // + /** The player. */ private Player player = null; + /** + * Instantiates a new player location. + * + * @param mcAccess + * the mc access + * @param blockCache + * the block cache + */ public PlayerLocation(final MCAccess mcAccess, final BlockCache blockCache) { super(mcAccess, blockCache); } + /** + * Gets the player. + * + * @return the player + */ public Player getPlayer() { return player; } @@ -71,12 +86,11 @@ public class PlayerLocation extends RichEntityLocation { /** * Sets the player location object. - * + * * @param location * the location * @param player * the player - * @throws NullPointerException, if player.getLocation.getWorld() returns null. */ public void set(final Location location, final Player player) { set(location, player, 0.001); @@ -84,12 +98,13 @@ public class PlayerLocation extends RichEntityLocation { /** * Sets the player location object. Does not set or reset blockCache. - * + * * @param location * the location * @param player * the player - * @throws NullPointerException, if Location.getWorld() returns null. + * @param yOnGround + * the y on ground */ public void set(final Location location, final Player player, final double yOnGround) { @@ -100,6 +115,13 @@ public class PlayerLocation extends RichEntityLocation { /** * Not supported. + * + * @param location + * the location + * @param entity + * the entity + * @param yOnGround + * the y on ground */ @Override public void set(Location location, Entity entity, double yOnGround) { @@ -108,6 +130,15 @@ public class PlayerLocation extends RichEntityLocation { /** * Not supported. + * + * @param location + * the location + * @param entity + * the entity + * @param fullHeight + * the full height + * @param yOnGround + * the y on ground */ @Override public void set(Location location, Entity entity, double fullHeight, double yOnGround) { @@ -116,6 +147,17 @@ public class PlayerLocation extends RichEntityLocation { /** * Not supported. + * + * @param location + * the location + * @param entity + * the entity + * @param fullWidth + * the full width + * @param fullHeight + * the full height + * @param yOnGround + * the y on ground */ @Override public void set(Location location, Entity entity, double fullWidth, double fullHeight, double yOnGround) { @@ -124,8 +166,11 @@ public class PlayerLocation extends RichEntityLocation { /** * Set cached info according to other.
    - * Minimal optimizations: take block flags directly, on-ground max/min bounds, only set stairs if not on ground and not reset-condition. + * Minimal optimizations: take block flags directly, on-ground max/min + * bounds, only set stairs if not on ground and not reset-condition. + * * @param other + * the other */ public void prepare(final PlayerLocation other) { super.prepare(other); @@ -141,9 +186,10 @@ public class PlayerLocation extends RichEntityLocation { /** * Check absolute coordinates and stance for (typical) exploits. - * - * @return - * @deprecated Not used anymore (hasIllegalCoords and hasIllegalStance are used individually instead). + * + * @return true, if is illegal + * @deprecated Not used anymore (hasIllegalCoords and hasIllegalStance are + * used individually instead). */ public boolean isIllegal() { if (hasIllegalCoords()) { @@ -154,14 +200,19 @@ public class PlayerLocation extends RichEntityLocation { } /** - * Check for bounding box properties that might crash the server (if available, not the absolute coordinates). - * @return + * Check for bounding box properties that might crash the server (if + * available, not the absolute coordinates). + * + * @return true, if successful */ public boolean hasIllegalStance() { // TODO: This doesn't check this location, but the player. return getMCAccess().isIllegalBounds(player).decide(); // MAYBE = NO } + /* (non-Javadoc) + * @see fr.neatmonster.nocheatplus.utilities.RichEntityLocation#toString() + */ @Override public String toString() { final StringBuilder builder = new StringBuilder(128); diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/PotionUtil.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/PotionUtil.java index cc11dee2..bd59e503 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/PotionUtil.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/PotionUtil.java @@ -20,6 +20,7 @@ import org.bukkit.entity.Player; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; +// TODO: Auto-generated Javadoc /** * Could not help it. * @author mc_dev @@ -28,11 +29,15 @@ import org.bukkit.potion.PotionEffectType; public class PotionUtil { /** - * Get amplifier for a potion effect. - * @param player - * @param type - * @return Double.NEGATIVE_INFINITY if not present, otherwise the maximal amplifier. - */ + * Get amplifier for a potion effect. + * + * @param player + * the player + * @param type + * the type + * @return Double.NEGATIVE_INFINITY if not present, otherwise the maximal + * amplifier. + */ public static final double getPotionEffectAmplifier(final Player player, final PotionEffectType type) { if (!player.hasPotionEffect(type)) return Double.NEGATIVE_INFINITY; // TODO: Might not win anything. final Collection effects = player.getActivePotionEffects(); diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/RichBoundsLocation.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/RichBoundsLocation.java index dae24e16..d25d6448 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/RichBoundsLocation.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/RichBoundsLocation.java @@ -30,6 +30,7 @@ import fr.neatmonster.nocheatplus.components.location.IGetBlockPosition; import fr.neatmonster.nocheatplus.components.location.IGetBukkitLocation; import fr.neatmonster.nocheatplus.components.location.IGetPosition; +// TODO: Auto-generated Javadoc /** * A location with bounds with a lot of extra stuff. * @@ -51,6 +52,7 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** The exact coordinates. */ double x, y, z; + /** The pitch. */ float yaw, pitch; // TODO: -> entity ? /** Bounding box. */ @@ -58,7 +60,8 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** Horizontal margin for the bounding box (center towards edge). */ double boxMarginHorizontal; - /** Vertical margin for the bounding box (y towards top)*/ + + /** Vertical margin for the bounding box (y towards top). */ double boxMarginVertical; // TODO: Check if onGround can be completely replaced by onGroundMinY and notOnGroundMaxY. @@ -85,7 +88,7 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** All block flags collected for maximum used bounds. */ Long blockFlags = null; - /** Is the player on ladder? */ + /** Is the player on ladder?. */ Boolean onClimbable = null; /** Simple test if the exact position is passable. */ @@ -94,22 +97,22 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** Bounding box collides with blocks. */ Boolean passableBox = null; - /** Is the player above stairs? */ + /** Is the player above stairs?. */ Boolean aboveStairs = null; - /** Is the player in lava? */ + /** Is the player in lava?. */ Boolean inLava = null; - /** Is the player in water? */ + /** Is the player in water?. */ Boolean inWater = null; - /** Is the player is web? */ + /** Is the player is web?. */ Boolean inWeb = null; - /** Is the player on ice? */ + /** Is the player on ice?. */ Boolean onIce = null; - /** Is the player on the ground? */ + /** Is the player on the ground?. */ Boolean onGround = null; @@ -122,54 +125,85 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition World world = null; + /** + * Instantiates a new rich bounds location. + * + * @param blockCache + * the block cache + */ public RichBoundsLocation(final BlockCache blockCache) { this.blockCache = blockCache; } + /* (non-Javadoc) + * @see fr.neatmonster.nocheatplus.components.location.IGetBukkitLocation#getWorld() + */ @Override public World getWorld() { return world; } + /* (non-Javadoc) + * @see fr.neatmonster.nocheatplus.components.location.IGetLocation#getWorldName() + */ @Override public String getWorldName() { return world.getName(); } + /* (non-Javadoc) + * @see fr.neatmonster.nocheatplus.components.location.IGetPosition#getX() + */ @Override public double getX() { return x; } + /* (non-Javadoc) + * @see fr.neatmonster.nocheatplus.components.location.IGetPosition#getY() + */ @Override public double getY() { return y; } + /* (non-Javadoc) + * @see fr.neatmonster.nocheatplus.components.location.IGetPosition#getZ() + */ @Override public double getZ() { return z; } + /* (non-Javadoc) + * @see fr.neatmonster.nocheatplus.components.location.IGetLook#getYaw() + */ @Override public float getYaw() { return yaw; } + /* (non-Javadoc) + * @see fr.neatmonster.nocheatplus.components.location.IGetLook#getPitch() + */ @Override public float getPitch() { return pitch; } + /** + * Gets the vector. + * + * @return the vector + */ public Vector getVector() { return new Vector(x, y, z); } /** * Gets a new Location instance representing this position. - * + * * @return the location - * @throws NullPointerException, if the world stored internally is null. */ public Location getLocation() { if (this.world == null) { @@ -178,16 +212,25 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition return new Location(world, x, y, z, yaw, pitch); } + /* (non-Javadoc) + * @see fr.neatmonster.nocheatplus.components.location.IGetBlockPosition#getBlockX() + */ @Override public int getBlockX() { return blockX; } + /* (non-Javadoc) + * @see fr.neatmonster.nocheatplus.components.location.IGetBlockPosition#getBlockY() + */ @Override public int getBlockY() { return blockY; } + /* (non-Javadoc) + * @see fr.neatmonster.nocheatplus.components.location.IGetBlockPosition#getBlockZ() + */ @Override public int getBlockZ() { return blockZ; @@ -196,8 +239,8 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Return the bounding box as a new double array (minX, minY, minZ, maxX, * maxY, maxZ). - * - * @return + * + * @return the bounds as doubles */ public double[] getBoundsAsDoubles() { return new double[] {minX, minY, minZ, maxX, maxY, maxZ}; @@ -207,8 +250,8 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition * Get the bounding box margin from the center (x ,z) to the edge of the * box. This value may be adapted from entity width or other input, and it * might be cut down to a certain resolution (e.g. 1/1000). - * - * @return + * + * @return the box margin horizontal */ public double getBoxMarginHorizontal() { return boxMarginHorizontal; @@ -217,8 +260,8 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Get the bounding box margin from the y coordinate (feet for entities) to * the top. - * - * @return + * + * @return the box margin vertical */ public double getBoxMarginVertical() { return boxMarginVertical; @@ -226,9 +269,10 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Compares block coordinates (not the world). - * + * * @param other - * @return + * the other + * @return true, if is same block */ public final boolean isSameBlock(final IGetBlockPosition other) { return blockX == other.getBlockX() && blockZ == other.getBlockZ() && blockY == other.getBlockY(); @@ -236,10 +280,14 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Block coordinate comparison. + * * @param x + * the x * @param y + * the y * @param z - * @return + * the z + * @return true, if is same block */ public final boolean isSameBlock(final int x, final int y, final int z) { return blockX == x && blockZ == z && blockY == y; @@ -247,8 +295,10 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Compares block coordinates (not the world). + * * @param loc - * @return + * the loc + * @return true, if is same block */ public final boolean isSameBlock(final Location loc) { return blockX == loc.getBlockX() && blockZ == loc.getBlockZ() && blockY == loc.getBlockY(); @@ -256,8 +306,10 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Check if this location is above the given one (blockY + 1). + * * @param loc - * @return + * the loc + * @return true, if is block above */ public boolean isBlockAbove(final IGetBlockPosition loc) { return blockY == loc.getBlockY() + 1 && blockX == loc.getBlockX() && blockZ == loc.getBlockZ(); @@ -265,8 +317,10 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Check if this location is above the given one (blockY + 1). + * * @param loc - * @return + * the loc + * @return true, if is block above */ public boolean isBlockAbove(final Location loc) { return blockY == loc.getBlockY() + 1 && blockX == loc.getBlockX() && blockZ == loc.getBlockZ(); @@ -274,9 +328,10 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Compares exact coordinates (not the world). - * + * * @param loc - * @return + * the loc + * @return true, if is same pos */ public boolean isSamePos(final IGetPosition loc) { return x == loc.getX() && z == loc.getZ() && y == loc.getY(); @@ -284,9 +339,10 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Compares exact coordinates (not the world). - * + * * @param loc - * @return + * the loc + * @return true, if is same pos */ public boolean isSamePos(final Location loc) { return x == loc.getX() && z == loc.getZ() && y == loc.getY(); @@ -294,8 +350,10 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Manhattan distance, see Trigutil. + * * @param other - * @return + * the other + * @return the int */ public int manhattan(final IGetBlockPosition other) { // TODO: Consider using direct field access from other methods as well. @@ -304,8 +362,10 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Maximum block distance comparing dx, dy, dz. + * * @param other - * @return + * the other + * @return the int */ public int maxBlockDist(final IGetBlockPosition other) { // TODO: Consider using direct field access from other methods as well. @@ -313,24 +373,31 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition } /** - * Quick check for really bad coordinates (actual problem, if true is returned.). - * @return + * Quick check for really bad coordinates (actual problem, if true is + * returned.). + * + * @return true, if successful */ public boolean hasIllegalCoords() { return CheckUtils.isBadCoordinate(minX, maxX, minY, maxY, minZ, maxZ); } /** - * Get the collected block-flags. This will return null if collectBlockFlags has not been called. - * @return + * Get the collected block-flags. This will return null if collectBlockFlags + * has not been called. + * + * @return the block flags */ public Long getBlockFlags() { return blockFlags; } /** - * Set the block flags which are usually collected on base of bounding box, yOnGround and other considerations, such as 1.5 high blocks. + * Set the block flags which are usually collected on base of bounding box, + * yOnGround and other considerations, such as 1.5 high blocks. + * * @param blockFlags + * the new block flags */ public void setBlockFlags(Long blockFlags) { this.blockFlags = blockFlags; @@ -338,7 +405,8 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Not cached. - * @return + * + * @return the type id above */ public int getTypeIdAbove() { return blockCache.getTypeId(blockX, blockY + 1, blockZ); @@ -346,26 +414,43 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Convenience method: delegate to BlockProperties.isDoppwnStream . - * + * * @param xDistance + * the x distance * @param zDistance - * @return + * the z distance + * @return true, if is down stream */ public boolean isDownStream(final double xDistance, final double zDistance) { return BlockProperties.isDownStream(blockCache, blockX, blockY, blockZ, getData(), xDistance, zDistance); } + /** + * Gets the type id. + * + * @return the type id + */ public Integer getTypeId() { if (typeId == null) typeId = getTypeId(blockX, blockY, blockZ); return typeId; } + /** + * Gets the type id below. + * + * @return the type id below + */ public Integer getTypeIdBelow() { if (typeIdBelow == null) typeIdBelow = getTypeId(blockX, blockY - 1, blockZ); return typeIdBelow; } + /** + * Gets the data. + * + * @return the data + */ public Integer getData() { if (data == null) data = getData(blockX, blockY, blockZ); return data; @@ -373,11 +458,14 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Uses id cache if present. - * + * * @param x + * the x * @param y + * the y * @param z - * @return + * the z + * @return the type id */ public final int getTypeId(final int x, final int y, final int z) { return blockCache.getTypeId(x, y, z); @@ -385,11 +473,14 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Uses id cache if present. - * + * * @param x + * the x * @param y + * the y * @param z - * @return + * the z + * @return the data */ public final int getData(final int x, final int y, final int z) { return blockCache.getData(x, y, z); @@ -397,8 +488,9 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Set the id cache for faster id getting. - * + * * @param cache + * the new block cache */ public void setBlockCache(final BlockCache cache) { this.blockCache = cache; @@ -406,7 +498,8 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Get the underlying BLockCache. - * @return + * + * @return the block cache */ public final BlockCache getBlockCache() { return blockCache; @@ -523,9 +616,12 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Check if solid blocks hit the box. + * * @param xzMargin + * the xz margin * @param yMargin - * @return + * the y margin + * @return true, if is next to ground */ public boolean isNextToGround(final double xzMargin, final double yMargin) { // TODO: Adjust to check block flags ? @@ -533,8 +629,10 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition } /** - * Reset condition for flying checks (sf + nofall): liquids, web, ladder (not on-ground, though). - * @return + * Reset condition for flying checks (sf + nofall): liquids, web, ladder + * (not on-ground, though). + * + * @return true, if is reset cond */ public boolean isResetCond() { // NOTE: if optimizing, setYOnGround has to be kept in mind. @@ -545,9 +643,10 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition * Check if the location is on ground and if it is hitting the bounding box * of a block with the given id. Currently this is coarse (not checking if * it is really possible to stand on such a block). - * + * * @param id - * @return + * the id + * @return true, if successful */ public boolean standsOnBlock(final int id) { if (!isOnGround()) { @@ -585,8 +684,8 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Check the location is on ice, only regarding the center. Currently * demands to be on ground as well. - * - * @return + * + * @return true, if is on ice */ public boolean isOnIce() { if (onIce == null) { @@ -606,8 +705,8 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Test if the location is on rails (assuming minecarts with some magic * bounds/behavior). - * - * @return + * + * @return true, if is on rails */ public boolean isOnRails() { return BlockProperties.isRails(getTypeId()) @@ -673,9 +772,12 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition } /** - * Simple block-on-ground check for given margin (no entities). Meant for checking bigger margin than the normal yOnGround. - * @param yOnGround Margin below the player. - * @return + * Simple block-on-ground check for given margin (no entities). Meant for + * checking bigger margin than the normal yOnGround. + * + * @param yOnGround + * Margin below the player. + * @return true, if is on ground */ public boolean isOnGround(final double yOnGround) { if (notOnGroundMaxY >= yOnGround) return false; @@ -684,10 +786,14 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition } /** - * SSimple block-on-ground check for given margin (no entities). Meant for checking bigger margin than the normal yOnGround. + * SSimple block-on-ground check for given margin (no entities). Meant for + * checking bigger margin than the normal yOnGround. + * * @param yOnGround - * @param ignoreFlags Flags to not regard as ground. - * @return + * the y on ground + * @param ignoreFlags + * Flags to not regard as ground. + * @return true, if is on ground */ public boolean isOnGround(final double yOnGround, final long ignoreFlags) { if (ignoreFlags == 0) { @@ -699,11 +805,16 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** - * Simple block-on-ground check for given margin (no entities). Meant for checking bigger margin than the normal yOnGround. - * @param yOnGround Margin below the player. + * Simple block-on-ground check for given margin (no entities). Meant for + * checking bigger margin than the normal yOnGround. + * + * @param yOnGround + * Margin below the player. * @param xzMargin - * @param yMargin Extra margin added below and above. - * @return + * the xz margin + * @param yMargin + * Extra margin added below and above. + * @return true, if is on ground */ public boolean isOnGround(final double yOnGround, final double xzMargin, final double yMargin) { if (xzMargin >= 0 && onGroundMinY <= yOnGround) return true; @@ -714,12 +825,18 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition } /** - * Simple block-on-ground check for given margin (no entities). Meant for checking bigger margin than the normal yOnGround. - * @param yOnGround Margin below the player. + * Simple block-on-ground check for given margin (no entities). Meant for + * checking bigger margin than the normal yOnGround. + * + * @param yOnGround + * Margin below the player. * @param xzMargin - * @param yMargin Extra margin added below and above. - * @param ignoreFlags Flags to not regard as ground. - * @return + * the xz margin + * @param yMargin + * Extra margin added below and above. + * @param ignoreFlags + * Flags to not regard as ground. + * @return true, if is on ground */ public boolean isOnGround(final double yOnGround, final double xzMargin, final double yMargin, final long ignoreFlags) { if (ignoreFlags == 0) { @@ -747,9 +864,12 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Check if solid blocks hit the box. + * * @param xzMargin + * the xz margin * @param yMargin - * @return + * the y margin + * @return true, if is next to solid */ public boolean isNextToSolid(final double xzMargin, final double yMargin) { // TODO: Adjust to check block flags ? @@ -758,19 +878,27 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Convenience method for testing for either. - * @return + * + * @return true, if is on ground or reset cond */ public boolean isOnGroundOrResetCond() { return isOnGround() || isResetCond(); } + /** + * Gets the y on ground. + * + * @return the y on ground + */ public double getyOnGround() { return yOnGround; } /** * This resets onGround and blockFlags. + * * @param yOnGround + * the new y on ground */ public void setyOnGround(final double yOnGround) { this.yOnGround = yOnGround; @@ -779,9 +907,10 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition } /** - * Test if the foot location is passable (not the bounding box). - *
    The result is cached. - * @return + * Test if the foot location is passable (not the bounding box).
    + * The result is cached. + * + * @return true, if is passable */ public boolean isPassable() { if (passable == null) { @@ -799,8 +928,8 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Test if the bounding box is colliding (passable check with accounting for * workarounds). - * - * @return + * + * @return true, if is passable box */ public boolean isPassableBox() { // TODO: Might need a variation with margins as parameters. @@ -819,6 +948,11 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition return passableBox; } + /** + * Checks if is block flags passable. + * + * @return true, if is block flags passable + */ private boolean isBlockFlagsPassable() { return blockFlags != null && (blockFlags & (BlockProperties.F_SOLID | BlockProperties.F_GROUND)) == 0; } @@ -827,8 +961,6 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition * Set block flags using yOnGround, unless already set. Check the maximally * used bounds for the block checking, to have flags ready for faster * denial. - * - * @param maxYonGround */ public void collectBlockFlags() { if (blockFlags == null) { @@ -837,9 +969,11 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition } /** - * Check the maximally used bounds for the block checking, - * to have flags ready for faster denial. + * Check the maximally used bounds for the block checking, to have flags + * ready for faster denial. + * * @param maxYonGround + * the max yon ground */ public void collectBlockFlags(double maxYonGround) { maxYonGround = Math.max(yOnGround, maxYonGround); @@ -860,8 +994,11 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition } /** - * Check chunks within xzMargin radius for if they are loaded and load unloaded chunks. + * Check chunks within xzMargin radius for if they are loaded and load + * unloaded chunks. + * * @param xzMargin + * the xz margin * @return Number of chunks loaded. */ public int ensureChunksLoaded(final double xzMargin) { @@ -871,10 +1008,13 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Check for push using the full bounding box (pistons). The given * BlockChangeReference is not changed, it has to be updated externally. - * + * * @param blockChangeTracker - * @param oldChangeId + * the block change tracker + * @param ref + * the ref * @param direction + * the direction * @param coverDistance * The (always positive) distance to cover. * @return A matching BlockChangeEntry with the minimal id. If no entry was @@ -908,11 +1048,14 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Test, if the block intersects the bounding box, if assuming full bounds. - * + * * @param x + * the x * @param y + * the y * @param z - * @return + * the z + * @return true, if is block intersecting */ public boolean isBlockIntersecting(final int x, final int y, final int z) { return TrigUtil.intersectsBlock(minX, maxX, x) @@ -921,14 +1064,20 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition } /** - * Test if a block fully pushed into that direction can push the player by coverDistance. - * - * @param x Block coordinates. + * Test if a block fully pushed into that direction can push the player by + * coverDistance. + * + * @param x + * Block coordinates. * @param y + * the y * @param z + * the z * @param direction + * the direction * @param coverDistance - * @return + * the cover distance + * @return true, if successful */ private boolean coversDistance(final int x, final int y, final int z, final Direction direction, final double coverDistance) { switch (direction) { @@ -959,8 +1108,11 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition /** * Set cached info according to other.
    - * Minimal optimizations: take block flags directly, on-ground max/min bounds, only set stairs if not on ground and not reset-condition. + * Minimal optimizations: take block flags directly, on-ground max/min + * bounds, only set stairs if not on ground and not reset-condition. + * * @param other + * the other */ public void prepare(final RichBoundsLocation other) { // Simple first. @@ -985,10 +1137,34 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition } } + /** + * Sets the. + * + * @param location + * the location + * @param fullWidth + * the full width + * @param fullHeight + * the full height + * @param yOnGround + * the y on ground + */ public void set(final Location location, final double fullWidth, final double fullHeight, final double yOnGround) { doSet(location, fullWidth, fullHeight, yOnGround); } + /** + * Do set. + * + * @param location + * the location + * @param fullWidth + * the full width + * @param fullHeight + * the full height + * @param yOnGround + * the y on ground + */ protected void doSet(final Location location, final double fullWidth, final double fullHeight, final double yOnGround) { // Set coordinates. blockX = location.getBlockX(); @@ -1037,11 +1213,17 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition blockCache = null; // No reset here. } + /* (non-Javadoc) + * @see java.lang.Object#hashCode() + */ @Override public int hashCode() { return LocUtil.hashCode(this); } + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ @Override public String toString() { final StringBuilder builder = new StringBuilder(128); diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/RichEntityLocation.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/RichEntityLocation.java index b9f7578b..7df186b3 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/RichEntityLocation.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/RichEntityLocation.java @@ -20,6 +20,7 @@ import org.bukkit.entity.LivingEntity; import fr.neatmonster.nocheatplus.compat.MCAccess; +// TODO: Auto-generated Javadoc /** * A location with an entity with a lot of extra stuff. * @@ -28,6 +29,7 @@ import fr.neatmonster.nocheatplus.compat.MCAccess; */ public class RichEntityLocation extends RichBoundsLocation { + /** The mc access. */ // Final members // private final MCAccess mcAccess; @@ -55,34 +57,63 @@ public class RichEntityLocation extends RichBoundsLocation { // "Heavy" object members that need to be set to null on cleanup. // + /** The entity. */ private Entity entity = null; + /** + * Instantiates a new rich entity location. + * + * @param mcAccess + * the mc access + * @param blockCache + * the block cache + */ public RichEntityLocation(final MCAccess mcAccess, final BlockCache blockCache) { super(blockCache); this.mcAccess = mcAccess; } + /** + * Gets the width. + * + * @return the width + */ public double getWidth() { return width; } + /** + * Gets the height. + * + * @return the height + */ public double getHeight() { return height; } + /** + * Gets the eye height. + * + * @return the eye height + */ public double getEyeHeight() { return eyeHeight; } + /** + * Gets the entity. + * + * @return the entity + */ public Entity getEntity() { return entity; } /** * Test if this is a LivingEntity instance. - * - * @return + * + * @return true, if is living */ public boolean isLiving() { return isLiving; @@ -90,7 +121,8 @@ public class RichEntityLocation extends RichBoundsLocation { /** * Retrieve the internally stored MCAccess instance. - * @return + * + * @return the MC access */ public MCAccess getMCAccess() { return mcAccess; @@ -99,13 +131,14 @@ public class RichEntityLocation extends RichBoundsLocation { /** * Simple check with custom margins (Boat, Minecart). Does not update the * internally stored standsOnEntity field. - * + * * @param yOnGround * Margin below the player. * @param xzMargin + * the xz margin * @param yMargin * Extra margin added below and above. - * @return + * @return true, if successful */ public boolean standsOnEntity(final double yOnGround, final double xzMargin, final double yMargin) { return blockCache.standsOnEntity(entity, minX - xzMargin, minY - yOnGround - yMargin, minZ - xzMargin, maxX + xzMargin, minY + yMargin, maxZ + xzMargin); @@ -142,10 +175,13 @@ public class RichEntityLocation extends RichBoundsLocation { } /** - * Check if a player may climb upwards (isOnClimbable returned true, player does not move from/to ground).
    + * Check if a player may climb upwards (isOnClimbable returned true, player + * does not move from/to ground).
    * Having checked the other stuff is prerequisite for calling this (!). - * @param jumpHeigth Height the player is allowed to have jumped. - * @return + * + * @param jumpHeigth + * Height the player is allowed to have jumped. + * @return true, if successful */ public boolean canClimbUp(double jumpHeigth) { // TODO: distinguish vines. @@ -177,9 +213,10 @@ public class RichEntityLocation extends RichBoundsLocation { /** * Test if something solid/ground-like collides within the given margin * above the eye height of the player. - * + * * @param marginAboveEyeHeight - * @return + * the margin above eye height + * @return true, if is head obstructed */ public boolean isHeadObstructed(double marginAboveEyeHeight) { return isHeadObstructed(marginAboveEyeHeight, true); // TODO: This is changed behavior, need to check calls. @@ -188,12 +225,12 @@ public class RichEntityLocation extends RichBoundsLocation { /** * Test if something solid/ground-like collides within the given margin * above the eye height of the player. - * + * * @param marginAboveEyeHeight * Must be greater than or equal zero. * @param stepCorrection * If set to true, a correction method is used for leniency. - * @return + * @return true, if is head obstructed * @throws IllegalArgumentException * If marginAboveEyeHeight is smaller than 0. */ @@ -220,8 +257,8 @@ public class RichEntityLocation extends RichBoundsLocation { /** * Test if something solid/ground-like collides within a default * margin/estimation above the eye height of the player. - * - * @return + * + * @return true, if is head obstructed */ public boolean isHeadObstructed() { return isHeadObstructed(0.0, true); @@ -229,42 +266,68 @@ public class RichEntityLocation extends RichBoundsLocation { /** * Convenience constructor for using mcAccess.getHeight for fullHeight. + * * @param location + * the location * @param entity + * the entity * @param yOnGround + * the y on ground */ public void set(final Location location, final Entity entity, final double yOnGround) { doSet(location, entity, mcAccess.getWidth(entity), mcAccess.getHeight(entity), yOnGround); } /** - * + * Sets the. + * * @param location + * the location * @param entity + * the entity * @param fullHeight * Allows to specify eyeHeight here. Currently might be * overridden by eyeHeight, if that is greater. * @param yOnGround + * the y on ground */ public void set(final Location location, final Entity entity, double fullHeight, final double yOnGround) { doSet(location, entity, mcAccess.getWidth(entity), fullHeight, yOnGround); } /** - * + * Sets the. + * * @param location + * the location * @param entity + * the entity * @param fullWidth * Override the bounding box width (full width). * @param fullHeight * Allows to specify eyeHeight here. Currently might be * overridden by eyeHeight, if that is greater. * @param yOnGround + * the y on ground */ public void set(final Location location, final Entity entity, final double fullWidth, double fullHeight, final double yOnGround) { doSet(location, entity, fullWidth, fullHeight, yOnGround); } + /** + * Do set. + * + * @param location + * the location + * @param entity + * the entity + * @param fullWidth + * the full width + * @param fullHeight + * the full height + * @param yOnGround + * the y on ground + */ protected void doSet(final Location location, final Entity entity, final double fullWidth, double fullHeight, final double yOnGround) { if (entity instanceof LivingEntity) { isLiving = true; @@ -284,6 +347,15 @@ public class RichEntityLocation extends RichBoundsLocation { /** * Not supported. + * + * @param location + * the location + * @param fullWidth + * the full width + * @param fullHeight + * the full height + * @param yOnGround + * the y on ground */ @Override public void set(Location location, double fullWidth, double fullHeight, double yOnGround) { @@ -292,8 +364,11 @@ public class RichEntityLocation extends RichBoundsLocation { /** * Set cached info according to other.
    - * Minimal optimizations: take block flags directly, on-ground max/min bounds, only set stairs if not on ground and not reset-condition. + * Minimal optimizations: take block flags directly, on-ground max/min + * bounds, only set stairs if not on ground and not reset-condition. + * * @param other + * the other */ public void prepare(final RichEntityLocation other) { super.prepare(other); @@ -308,6 +383,9 @@ public class RichEntityLocation extends RichBoundsLocation { entity = null; } + /* (non-Javadoc) + * @see fr.neatmonster.nocheatplus.utilities.RichBoundsLocation#toString() + */ @Override public String toString() { final StringBuilder builder = new StringBuilder(128); diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/TeleportUtil.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/TeleportUtil.java index 40eb1f4a..630f0ad3 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/TeleportUtil.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/TeleportUtil.java @@ -28,6 +28,10 @@ import fr.neatmonster.nocheatplus.checks.moving.model.VehicleMoveData; import fr.neatmonster.nocheatplus.checks.moving.util.AuxMoving; import fr.neatmonster.nocheatplus.checks.workaround.WRPT; +// TODO: Auto-generated Javadoc +/** + * The Class TeleportUtil. + */ public class TeleportUtil { /** Temp use. LocUtil.clone on passing. setWorld(null) after use. */ @@ -36,10 +40,15 @@ public class TeleportUtil { /** * Teleport the player with vehicle, temporarily eject the passenger and set * teleported in MovingData. - * + * * @param vehicle + * the vehicle * @param player + * the player * @param location + * the location + * @param debug + * the debug */ public static void teleport(final Entity vehicle, final Player player, final Location location, final boolean debug) { // TODO: Rubber band issue needs synchronizing with packet level and ignore certain incoming ones? @@ -116,9 +125,11 @@ public class TeleportUtil { /** * Force mounting the vehicle, eject existing passenger. - * + * * @param passenger + * the passenger * @param vehicle + * the vehicle */ public static void forceMount(Entity passenger, Entity vehicle) { if (vehicle.getPassenger() != null) { diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/TickTask.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/TickTask.java index ccbf91f0..c9dd291d 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/TickTask.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/TickTask.java @@ -38,6 +38,7 @@ import fr.neatmonster.nocheatplus.logging.StaticLog; import fr.neatmonster.nocheatplus.players.DataManager; import fr.neatmonster.nocheatplus.utilities.ds.count.ActionFrequency; +// TODO: Auto-generated Javadoc /** * Task to run every tick, to update permissions and execute actions, and for lag measurement. * @@ -48,15 +49,37 @@ import fr.neatmonster.nocheatplus.utilities.ds.count.ActionFrequency; */ public class TickTask implements Runnable { + /** + * The Class PermissionUpdateEntry. + */ protected static final class PermissionUpdateEntry{ + + /** The check type. */ public final CheckType checkType; + + /** The player name. */ public final String playerName; + + /** The hash code. */ private final int hashCode; + + /** + * Instantiates a new permission update entry. + * + * @param playerName + * the player name + * @param checkType + * the check type + */ public PermissionUpdateEntry(final String playerName, final CheckType checkType) { this.playerName = playerName; this.checkType = checkType; hashCode = playerName.hashCode() ^ checkType.hashCode(); } + + /* (non-Javadoc) + * @see java.lang.Object#equals(java.lang.Object) + */ @Override public boolean equals(final Object obj) { if (!(obj instanceof PermissionUpdateEntry)) { @@ -65,19 +88,36 @@ public class TickTask implements Runnable { final PermissionUpdateEntry other = (PermissionUpdateEntry) obj; return playerName.equals(other.playerName) && checkType.equals(other.checkType); } + + /* (non-Javadoc) + * @see java.lang.Object#hashCode() + */ @Override public int hashCode() { return hashCode; } } + /** + * The Class ImprobableUpdateEntry. + */ protected static final class ImprobableUpdateEntry { + + /** The add level. */ public float addLevel; + + /** + * Instantiates a new improbable update entry. + * + * @param addLevel + * the add level + */ public ImprobableUpdateEntry(float addLevel) { this.addLevel = addLevel; } } + /** The Constant lagMaxTicks. */ public static final int lagMaxTicks = 80; /** Lock for accessing permissionUpdates. */ @@ -86,6 +126,8 @@ public class TickTask implements Runnable { private static Set permissionUpdates = new LinkedHashSet(50); /** Improbable entries to update. */ private static Map improbableUpdates = new LinkedHashMap(50); + + /** The Constant improbableLock. */ private static final ReentrantLock improbableLock = new ReentrantLock(); /** Lock for delayedActions. */ @@ -99,7 +141,7 @@ public class TickTask implements Runnable { /** Last n tick durations, measured from run to run.*/ private static final long[] tickDurations = new long[lagMaxTicks]; - /** Tick durations summed up in packs of n (nxn time covered) */ + /** Tick durations summed up in packs of n (nxn time covered). */ private static final long[] tickDurationsSq = new long[lagMaxTicks]; /** Maximally covered time on ms for lag tracking, roughly. */ @@ -111,13 +153,16 @@ public class TickTask implements Runnable { /** Lag spikes > 150 ms counting (3 x 20 minutes). For lag spike length see spikeDurations. */ private static ActionFrequency[] spikes = new ActionFrequency[spikeDurations.length]; - /** Task id of the running TickTask */ + /** Task id of the running TickTask. */ protected static int taskId = -1; + /** The tick. */ protected static int tick = 0; + /** The time start. */ protected static long timeStart = 0; + /** The time last. */ protected static long timeLast = 0; /** Lock flag set on disable. */ @@ -206,8 +251,11 @@ public class TickTask implements Runnable { /** * Access method to request permission updates.
    * NOTE: Thread safe. + * * @param playerName + * the player name * @param checkType + * the check type */ public static void requestPermissionUpdate(final String playerName, final CheckType checkType) { synchronized(permissionLock) { @@ -221,7 +269,9 @@ public class TickTask implements Runnable { /** * Request actions execution.
    * NOTE: Thread safe. + * * @param actions + * the actions */ public static void requestActionsExecution(final ViolationData actions) { synchronized (actionLock) { @@ -234,8 +284,11 @@ public class TickTask implements Runnable { /** * NOTE: Thread-safe. + * * @param playerId - * @param amount + * the player id + * @param addLevel + * the add level */ public static void requestImprobableUpdate(final UUID playerId, final float addLevel) { if (playerId == null) { @@ -253,13 +306,18 @@ public class TickTask implements Runnable { } /** - * Add a tick listener. Can be called during processing, but will take effect on the next tick.
    + * Add a tick listener. Can be called during processing, but will take + * effect on the next tick.
    * NOTES: *
  • Thread safe.
  • *
  • Does not work if the TickTask is locked.
  • - *
  • For OnDemandTickListenerS, setRegistered(true) will get called if not locked.
  • - *
  • Will not add the same instance twice, but will call setRegistered each time for OnDemandTickListener instances.
  • + *
  • For OnDemandTickListenerS, setRegistered(true) will get called if not + * locked.
  • + *
  • Will not add the same instance twice, but will call setRegistered + * each time for OnDemandTickListener instances.
  • + * * @param listener + * the listener */ public static void addTickListener(TickListener listener) { synchronized (tickListeners) { @@ -276,12 +334,15 @@ public class TickTask implements Runnable { } /** - * Remove a tick listener. Can be called during processing, but will take effect on the next tick.
    + * Remove a tick listener. Can be called during processing, but will take + * effect on the next tick.
    * NOTES: *
  • Thread safe.
  • *
  • Always works.
  • *
  • For OnDemandTickListenerS, setRegistered(false) will get called.
  • + * * @param listener + * the listener * @return If previously contained. */ public static boolean removeTickListener(TickListener listener) { @@ -334,7 +395,8 @@ public class TickTask implements Runnable { /** * Get the time at which the task was started. - * @return + * + * @return the time start */ public static final long getTimeStart() { return timeStart; @@ -342,7 +404,8 @@ public class TickTask implements Runnable { /** * Time when last time processing was finished. - * @return + * + * @return the time last */ public static final long getTimeLast() { return timeLast; @@ -408,9 +471,11 @@ public class TickTask implements Runnable { } /** - * Get moderate lag spikes of the last hour (>150 ms, lowest tracked spike duration). + * Get moderate lag spikes of the last hour (>150 ms, lowest tracked spike + * duration). + * + * @return the moderate lag spikes * @deprecated What is moderate :) ? - * @return */ public static final int getModerateLagSpikes() { spikes[0].update(System.currentTimeMillis()); @@ -418,9 +483,11 @@ public class TickTask implements Runnable { } /** - * Get heavy lag spikes of the last hour (> 450 ms supposedly, first duration bigger than 150 ms). + * Get heavy lag spikes of the last hour (> 450 ms supposedly, first + * duration bigger than 150 ms). + * + * @return the heavy lag spikes * @deprecated What is heavy :) ? - * @return */ public static final int getHeavyLagSpikes() { spikes[1].update(System.currentTimeMillis()); @@ -428,8 +495,11 @@ public class TickTask implements Runnable { } /** - * Get total number of lag spikes counted at all. This is the number of lag spikes with a duration above spikeDuations[0] which should be 150 ms. This is the score of spikes[0]. - * @return + * Get total number of lag spikes counted at all. This is the number of lag + * spikes with a duration above spikeDuations[0] which should be 150 ms. + * This is the score of spikes[0]. + * + * @return the number of lag spikes */ public static final int getNumberOfLagSpikes() { spikes[0].update(System.currentTimeMillis()); @@ -438,15 +508,19 @@ public class TickTask implements Runnable { /** * Get the stepping for lag spike duration tracking. - * @return + * + * @return the lag spike durations */ public static final long[] getLagSpikeDurations() { return Arrays.copyOf(spikeDurations, spikeDurations.length); } /** - * Get lag spike count according to getLagSpikeDurations() values. Entries of lower indexes contain the entries of higher indexes (so subtraction would be necessary to get spikes from...to). - * @return + * Get lag spike count according to getLagSpikeDurations() values. Entries + * of lower indexes contain the entries of higher indexes (so subtraction + * would be necessary to get spikes from...to). + * + * @return the lag spikes */ public static final int[] getLagSpikes() { final int[] out = new int[spikeDurations.length]; @@ -466,6 +540,13 @@ public class TickTask implements Runnable { return locked; } + /** + * Start. + * + * @param plugin + * the plugin + * @return the int + */ // Public methods for internal use. public static int start(final Plugin plugin) { cancel(); @@ -479,6 +560,9 @@ public class TickTask implements Runnable { return taskId; } + /** + * Cancel. + */ public static void cancel() { if (taskId == -1) { return; @@ -490,7 +574,9 @@ public class TickTask implements Runnable { /** * Control if new elements can be added to request queues.
    * NOTE: This is just a flag, no sync is done here. + * * @param locked + * the new locked */ public static void setLocked(boolean locked) { // TODO: synchronize over lists !? @@ -561,6 +647,9 @@ public class TickTask implements Runnable { } } + /* (non-Javadoc) + * @see java.lang.Runnable#run() + */ @Override public void run() { // Actions. diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/TrigUtil.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/TrigUtil.java index 2b02c3ce..e58f6a4e 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/TrigUtil.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/TrigUtil.java @@ -22,6 +22,7 @@ import org.bukkit.util.Vector; import fr.neatmonster.nocheatplus.components.location.IGetPosition; import fr.neatmonster.nocheatplus.components.location.IGetPositionWithLook; +// TODO: Auto-generated Javadoc /** * Auxiliary methods for trigonometry related tasks, such as distances, directions, angles. * @author mc_dev @@ -40,12 +41,13 @@ public class TrigUtil { /** Precision for the fight.direction check within the LocationTrace loop. */ public static final double DIRECTION_LOOP_PRECISION = 0.5; + /** The Constant useLoc. */ private static final Location useLoc = new Location(null, 0, 0, 0); /** * Check if a player looks at a target of a specific size, with a specific * precision value (roughly). - * + * * @param player * the player * @param targetX @@ -60,7 +62,7 @@ public class TrigUtil { * the target height * @param precision * the precision - * @return + * @return the double */ public static double directionCheck(final Player player, final double targetX, final double targetY, final double targetZ, final double targetWidth, final double targetHeight, final double precision) { @@ -73,12 +75,18 @@ public class TrigUtil { /** * Convenience method. + * * @param sourceFoot + * the source foot * @param eyeHeight + * the eye height * @param dir + * the dir * @param target - * @param precision (width/height are set to 1) - * @return + * the target + * @param precision + * (width/height are set to 1) + * @return the double */ public static double directionCheck(final Location sourceFoot, final double eyeHeight, final Vector dir, final Block target, final double precision) { @@ -87,16 +95,26 @@ public class TrigUtil { /** * Convenience method. + * * @param sourceFoot + * the source foot * @param eyeHeight + * the eye height * @param dir + * the dir * @param targetX + * the target x * @param targetY + * the target y * @param targetZ + * the target z * @param targetWidth + * the target width * @param targetHeight + * the target height * @param precision - * @return + * the precision + * @return the double */ public static double directionCheck(final Location sourceFoot, final double eyeHeight, final Vector dir, final double targetX, final double targetY, final double targetZ, final double targetWidth, final double targetHeight, final double precision) { @@ -105,18 +123,31 @@ public class TrigUtil { /** * Check how far the looking direction is off the target. - * @param sourceX Source location of looking direction. + * + * @param sourceX + * Source location of looking direction. * @param sourceY + * the source y * @param sourceZ - * @param dirX Looking direction. + * the source z + * @param dirX + * Looking direction. * @param dirY + * the dir y * @param dirZ - * @param targetX Location that should be looked towards. + * the dir z + * @param targetX + * Location that should be looked towards. * @param targetY + * the target y * @param targetZ - * @param targetWidth xz extent - * @param targetHeight y extent + * the target z + * @param targetWidth + * xz extent + * @param targetHeight + * y extent * @param precision + * the precision * @return Some offset. */ public static double directionCheck(final double sourceX, final double sourceY, final double sourceZ, final double dirX, final double dirY, final double dirZ, final double targetX, final double targetY, final double targetZ, final double targetWidth, final double targetHeight, final double precision) @@ -151,32 +182,89 @@ public class TrigUtil { return off; } + /** + * Combined direction check. + * + * @param sourceFoot + * the source foot + * @param eyeHeight + * the eye height + * @param dir + * the dir + * @param targetX + * the target x + * @param targetY + * the target y + * @param targetZ + * the target z + * @param targetWidth + * the target width + * @param targetHeight + * the target height + * @param precision + * the precision + * @param anglePrecision + * the angle precision + * @return the double + */ public static double combinedDirectionCheck(final Location sourceFoot, final double eyeHeight, final Vector dir, final double targetX, final double targetY, final double targetZ, final double targetWidth, final double targetHeight, final double precision, final double anglePrecision) { return combinedDirectionCheck(sourceFoot.getX(), sourceFoot.getY() + eyeHeight, sourceFoot.getZ(), dir.getX(), dir.getY(), dir.getZ(), targetX, targetY, targetZ, targetWidth, targetHeight, precision, anglePrecision); } + /** + * Combined direction check. + * + * @param sourceFoot + * the source foot + * @param eyeHeight + * the eye height + * @param dir + * the dir + * @param target + * the target + * @param precision + * the precision + * @param anglePrecision + * the angle precision + * @return the double + */ public static double combinedDirectionCheck(final Location sourceFoot, final double eyeHeight, final Vector dir, final Block target, final double precision, final double anglePrecision) { return combinedDirectionCheck(sourceFoot.getX(), sourceFoot.getY() + eyeHeight, sourceFoot.getZ(), dir.getX(), dir.getY(), dir.getZ(), target.getX(), target.getY(), target.getZ(), 1, 1, precision, anglePrecision); } /** - * Combine directionCheck with angle, in order to prevent low-distance abuse. + * Combine directionCheck with angle, in order to prevent low-distance + * abuse. + * * @param sourceX + * the source x * @param sourceY + * the source y * @param sourceZ + * the source z * @param dirX + * the dir x * @param dirY + * the dir y * @param dirZ + * the dir z * @param targetX + * the target x * @param targetY + * the target y * @param targetZ + * the target z * @param targetWidth + * the target width * @param targetHeight + * the target height * @param blockPrecision - * @param anglePrecision Precision in grad. - * @return + * the block precision + * @param anglePrecision + * Precision in grad. + * @return the double */ public static double combinedDirectionCheck(final double sourceX, final double sourceY, final double sourceZ, final double dirX, final double dirY, final double dirZ, final double targetX, final double targetY, final double targetZ, final double targetWidth, final double targetHeight, final double blockPrecision, final double anglePrecision) { @@ -252,9 +340,12 @@ public class TrigUtil { /** * 3d-distance from location (exact) to block middle. + * * @param location + * the location * @param block - * @return + * the block + * @return the double */ public static final double distance(final Location location, final Block block) { @@ -263,13 +354,20 @@ public class TrigUtil { /** * 3D-distance. + * * @param x1 + * the x1 * @param y1 + * the y1 * @param z1 + * the z1 * @param x2 + * the x2 * @param y2 + * the y2 * @param z2 - * @return + * the z2 + * @return the double */ public static final double distance(final double x1, final double y1, final double z1, final double x2, final double y2, final double z2) { final double dx = Math.abs(x1 - x2); @@ -278,11 +376,29 @@ public class TrigUtil { return Math.sqrt(dx * dx + dy * dy + dz * dz); } + /** + * Distance squared. + * + * @param location1 + * the location1 + * @param location2 + * the location2 + * @return the double + */ public static final double distanceSquared(final Location location1, final Location location2) { return distanceSquared(location1.getX(), location1.getY(), location1.getZ(), location2.getX(), location2.getY(), location2.getZ()); } + /** + * Distance squared. + * + * @param location1 + * the location1 + * @param location2 + * the location2 + * @return the double + */ public static final double distanceSquared(final IGetPosition location1, final IGetPosition location2) { return distanceSquared(location1.getX(), location1.getY(), location1.getZ(), location2.getX(), location2.getY(), location2.getZ()); @@ -290,20 +406,51 @@ public class TrigUtil { /** * Horizontal: squared distance. - * @param location1 - * @param x1 - * @return + * + * @param location + * the location + * @param x + * the x + * @param z + * the z + * @return the double */ public static final double distanceSquared(final IGetPosition location, final double x, final double z) { return distanceSquared(location.getX(), location.getZ(), x, z); } + /** + * Distance squared. + * + * @param location1 + * the location1 + * @param location2 + * the location2 + * @return the double + */ public static final double distanceSquared(final IGetPosition location1, final Location location2) { return distanceSquared(location1.getX(), location1.getY(), location1.getZ(), location2.getX(), location2.getY(), location2.getZ()); } + /** + * Distance squared. + * + * @param x1 + * the x1 + * @param y1 + * the y1 + * @param z1 + * the z1 + * @param x2 + * the x2 + * @param y2 + * the y2 + * @param z2 + * the z2 + * @return the double + */ public static final double distanceSquared(final double x1, final double y1, final double z1, final double x2, final double y2, final double z2) { final double dx = Math.abs(x1 - x2); final double dy = Math.abs(y1 - y2); @@ -311,6 +458,19 @@ public class TrigUtil { return dx * dx + dy * dy + dz * dz; } + /** + * Distance squared. + * + * @param x1 + * the x1 + * @param z1 + * the z1 + * @param x2 + * the x2 + * @param z2 + * the z2 + * @return the double + */ public static final double distanceSquared(final double x1, final double z1, final double x2, final double z2) { final double dx = Math.abs(x1 - x2); final double dz = Math.abs(z1 - z2); @@ -319,9 +479,12 @@ public class TrigUtil { /** * 2D-distance in x-z plane. + * * @param location1 + * the location1 * @param location2 - * @return + * the location2 + * @return the double */ public static final double xzDistance(final Location location1, final Location location2) { @@ -330,9 +493,12 @@ public class TrigUtil { /** * 2D-distance in x-z plane. + * * @param location1 + * the location1 * @param location2 - * @return + * the location2 + * @return the double */ public static final double xzDistance(final IGetPosition location1, final IGetPosition location2) { @@ -341,9 +507,12 @@ public class TrigUtil { /** * 2D-distance in x-z plane. + * * @param location1 + * the location1 * @param location2 - * @return + * the location2 + * @return the double */ public static final double xzDistance(final Location location1, final IGetPosition location2) { @@ -352,11 +521,16 @@ public class TrigUtil { /** * 2D-distance. + * * @param x1 + * the x1 * @param z1 + * the z1 * @param x2 + * the x2 * @param z2 - * @return + * the z2 + * @return the double */ public static final double distance(final double x1, final double z1, final double x2, final double z2) { final double dx = Math.abs(x1 - x2); @@ -365,17 +539,29 @@ public class TrigUtil { } /** - * Positive angle between vector from source to target and the vector for the given direction [0...PI]. + * Positive angle between vector from source to target and the vector for + * the given direction [0...PI]. + * * @param sourceX + * the source x * @param sourceY + * the source y * @param sourceZ + * the source z * @param dirX + * the dir x * @param dirY + * the dir y * @param dirZ + * the dir z * @param targetX + * the target x * @param targetY + * the target y * @param targetZ - * @return Positive angle between vector from source to target and the vector for the given direction [0...PI]. + * the target z + * @return Positive angle between vector from source to target and the + * vector for the given direction [0...PI]. */ public static float angle(final double sourceX, final double sourceY, final double sourceZ, final double dirX, final double dirY, final double dirZ, final double targetX, final double targetY, final double targetZ) { double dirLength = Math.sqrt(dirX * dirX + dirY * dirY + dirZ * dirZ); @@ -396,9 +582,12 @@ public class TrigUtil { /** * Angle of a 2d vector, x being the side at the angle. (radians). + * * @param x + * the x * @param z - * @return + * the z + * @return the double */ public static final double angle(final double x, final double z){ final double a; @@ -414,9 +603,13 @@ public class TrigUtil { } /** - * Get the difference of angles (radians) as given from angle(x,z), from a1 to a2, i.e. rather a2 - a1 in principle. + * Get the difference of angles (radians) as given from angle(x,z), from a1 + * to a2, i.e. rather a2 - a1 in principle. + * * @param a1 + * the a1 * @param a2 + * the a2 * @return Difference of angle from -pi to pi */ public static final double angleDiff(final double a1, final double a2){ @@ -428,10 +621,15 @@ public class TrigUtil { } /** - * Yaw (angle in grad) difference. This ensures inputs are interpreted correctly (for 360 degree offsets). + * Yaw (angle in grad) difference. This ensures inputs are interpreted + * correctly (for 360 degree offsets). + * * @param fromYaw + * the from yaw * @param toYaw - * @return Angle difference to get from fromYaw to toYaw. Result is in [-180, 180]. + * the to yaw + * @return Angle difference to get from fromYaw to toYaw. Result is in + * [-180, 180]. */ public static final float yawDiff(float fromYaw, float toYaw){ if (fromYaw <= -360f) fromYaw = -((-fromYaw) % 360f); @@ -446,9 +644,12 @@ public class TrigUtil { /** * Manhattan distance. + * * @param loc1 + * the loc1 * @param loc2 - * @return + * the loc2 + * @return the int */ public static int manhattan(final Location loc1, final Location loc2) { return manhattan(loc1.getBlockX(), loc1.getBlockY(), loc1.getBlockZ(), loc2.getBlockX(), loc2.getBlockY(), loc2.getBlockZ()); @@ -456,47 +657,96 @@ public class TrigUtil { /** * Manhattan distance. + * * @param x1 + * the x1 * @param y1 + * the y1 * @param z1 + * the z1 * @param block - * @return + * the block + * @return the int */ public static int manhattan(final int x1, final int y1, final int z1, final Block block) { return manhattan(x1, y1, z1, block.getX(), block.getY(), block.getZ()); } + /** + * Manhattan. + * + * @param x1 + * the x1 + * @param z1 + * the z1 + * @param x2 + * the x2 + * @param z2 + * the z2 + * @return the double + */ public static double manhattan(final double x1,final double z1, final double x2, final double z2){ return manhattan(Location.locToBlock(x1), Location.locToBlock(z1), Location.locToBlock(x2), Location.locToBlock(z2)); } /** * Manhattan distance (steps along the sides of an orthogonal grid). + * * @param x1 + * the x1 * @param y1 + * the y1 * @param z1 + * the z1 * @param x2 + * the x2 * @param y2 + * the y2 * @param z2 - * @return + * the z2 + * @return the int */ public static int manhattan(final int x1, final int y1, final int z1, final int x2, final int y2, final int z2){ return Math.abs(x1 - x2) + Math.abs(y1 - y2) + Math.abs(z1 - z2); } + /** + * Manhattan. + * + * @param x1 + * the x1 + * @param y1 + * the y1 + * @param z1 + * the z1 + * @param x2 + * the x2 + * @param y2 + * the y2 + * @param z2 + * the z2 + * @return the double + */ public static double manhattan(final double x1, final double y1, final double z1, final double x2, final double y2, final double z2){ return manhattan(Location.locToBlock(x1), Location.locToBlock(y1), Location.locToBlock(z1), Location.locToBlock(x2), Location.locToBlock(y2), Location.locToBlock(z2)); } /** * Maximum distance comparing dx, dy, dz. + * * @param x1 + * the x1 * @param y1 + * the y1 * @param z1 + * the z1 * @param x2 + * the x2 * @param y2 + * the y2 * @param z2 - * @return + * the z2 + * @return the int */ public static int maxDistance(final int x1, final int y1, final int z1, final int x2, final int y2, final int z2){ return Math.max(Math.max(Math.abs(x1 - x2), Math.abs(y1 - y2)), Math.abs(z1 - z2)); @@ -504,24 +754,36 @@ public class TrigUtil { /** * Maximum distance comparing dx, dy, dz. + * * @param x1 + * the x1 * @param y1 + * the y1 * @param z1 + * the z1 * @param x2 + * the x2 * @param y2 + * the y2 * @param z2 - * @return + * the z2 + * @return the double */ public static double maxDistance(final double x1, final double y1, final double z1, final double x2, final double y2, final double z2){ return Math.max(Math.max(Math.abs(x1 - x2), Math.abs(y1 - y2)), Math.abs(z1 - z2)); } /** - * Check if the x-z plane move is "any backwards" regarding the yaw direction. + * Check if the x-z plane move is "any backwards" regarding the yaw + * direction. + * * @param xDistance + * the x distance * @param zDistance + * the z distance * @param yaw - * @return + * the yaw + * @return true, if is moving backwards */ public static boolean isMovingBackwards(final double xDistance, final double zDistance, final float yaw) { return xDistance < 0D && zDistance > 0D && yaw > 180F && yaw < 270F @@ -532,8 +794,11 @@ public class TrigUtil { /** * Compare position and looking direction. + * * @param loc1 + * the loc1 * @param loc2 + * the loc2 * @return Returns false if either is null. */ public static boolean isSamePosAndLook(final Location loc1, final Location loc2) { @@ -543,9 +808,11 @@ public class TrigUtil { /** * Test if both locations have the exact same coordinates. Does not check * yaw/pitch. - * + * * @param loc1 + * the loc1 * @param loc2 + * the loc2 * @return Returns false if either is null. */ public static boolean isSamePos(final Location loc1, final Location loc2) { @@ -555,8 +822,11 @@ public class TrigUtil { /** * Compare position and looking direction. + * * @param loc1 + * the loc1 * @param loc2 + * the loc2 * @return Returns false if either is null. */ public static boolean isSamePosAndLook(final IGetPositionWithLook loc1, final Location loc2) { @@ -566,9 +836,11 @@ public class TrigUtil { /** * Test if both locations have the exact same coordinates. Does not check * yaw/pitch. - * + * * @param loc1 + * the loc1 * @param loc2 + * the loc2 * @return Returns false if either is null. */ public static boolean isSamePos(final IGetPositionWithLook loc1, final Location loc2) { @@ -578,8 +850,11 @@ public class TrigUtil { /** * Compare position and looking direction. + * * @param loc1 + * the loc1 * @param loc2 + * the loc2 * @return Returns false if either is null. */ public static boolean isSamePosAndLook(final IGetPositionWithLook loc1, final IGetPositionWithLook loc2) { @@ -589,9 +864,11 @@ public class TrigUtil { /** * Test if both locations have the exact same coordinates. Does not check * yaw/pitch. - * + * * @param loc1 + * the loc1 * @param loc2 + * the loc2 * @return Returns false if either is null. */ public static boolean isSamePos(final IGetPositionWithLook loc1, final IGetPositionWithLook loc2) { @@ -601,10 +878,15 @@ public class TrigUtil { /** * Test if the coordinates represent the same position. + * * @param loc + * the loc * @param x + * the x * @param y + * the y * @param z + * the z * @return Returns false if loc is null; */ public static boolean isSamePos(final Location loc, final double x, final double y, final double z) { @@ -616,13 +898,20 @@ public class TrigUtil { /** * Test if the coordinates represent the same position. + * * @param x1 + * the x1 * @param y1 + * the y1 * @param z1 + * the z1 * @param x2 + * the x2 * @param y2 + * the y2 * @param z2 - * @return + * the z2 + * @return true, if is same pos */ public static boolean isSamePos(final double x1, final double y1, final double z1, final double x2, final double y2, final double z2){ return x1 == x2 && y1 == y2 && z1 == z2; @@ -630,23 +919,34 @@ public class TrigUtil { /** * Test if the coordinates represent the same position (2D). + * * @param x1 + * the x1 * @param z1 + * the z1 * @param x2 + * the x2 * @param z2 - * @return + * the z2 + * @return true, if is same pos */ public static boolean isSamePos(final double x1, final double z1, final double x2, final double z2){ return x1 == x2 && z1 == z2; } /** - * Test if the given double-coordinates are on the same block as specified by the int-coordinates. + * Test if the given double-coordinates are on the same block as specified + * by the int-coordinates. + * * @param loc + * the loc * @param x + * the x * @param y + * the y * @param z - * @return + * the z + * @return true, if is same block */ public static boolean isSameBlock(final Location loc, final double x, final double y, final double z) { if (loc == null) { @@ -656,14 +956,21 @@ public class TrigUtil { } /** - * + * Checks if is same block. + * * @param x1 + * the x1 * @param y1 + * the y1 * @param z1 + * the z1 * @param x2 + * the x2 * @param y2 + * the y2 * @param z2 - * @return + * the z2 + * @return true, if is same block */ public static boolean isSameBlock(final int x1, final int y1, final int z1, final double x2, final double y2, final double z2) { return x1 == Location.locToBlock(x2) && z1 == Location.locToBlock(z2) && y1 == Location.locToBlock(y2); @@ -671,12 +978,16 @@ public class TrigUtil { /** * Test if the block coordinate is intersecting with min+max bounds, - * assuming the a full block. Excludes the case of only the edges intersecting. - * + * assuming the a full block. Excludes the case of only the edges + * intersecting. + * * @param min + * the min * @param max - * @param block Block coordinate of the block. - * @return + * the max + * @param block + * Block coordinate of the block. + * @return true, if successful */ public static boolean intersectsBlock(final double min, final double max, final int block) { final double db = (double) block; diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/Axis.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/Axis.java index 38fd7758..72671afb 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/Axis.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/Axis.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.utilities.collision; /** diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/AxisTracing.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/AxisTracing.java index 812c258d..1c608ae8 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/AxisTracing.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/AxisTracing.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.utilities.collision; import org.bukkit.Location; diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/BlockPositionContainer.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/BlockPositionContainer.java index 355cfae4..1411543a 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/BlockPositionContainer.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/BlockPositionContainer.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.utilities.collision; import java.util.LinkedList; diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/ICollide.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/ICollide.java index 48eef419..55e3ffc5 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/ICollide.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/ICollide.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.utilities.collision; /** diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/ICollidePassable.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/ICollidePassable.java index 0cf87987..f6839f91 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/ICollidePassable.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/ICollidePassable.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.utilities.collision; import fr.neatmonster.nocheatplus.utilities.BlockCache; diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/ISetMargins.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/ISetMargins.java index 0f016948..9accea6c 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/ISetMargins.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/ISetMargins.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.utilities.collision; public interface ISetMargins { diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/PassableAxisTracing.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/PassableAxisTracing.java index 339b8ac4..07c5e50c 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/PassableAxisTracing.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/utilities/collision/PassableAxisTracing.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.utilities.collision; import fr.neatmonster.nocheatplus.utilities.BlockCache; diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/compat/meta/BridgeCrossPlugin.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/compat/meta/BridgeCrossPlugin.java index b9fc5786..b16b5dfa 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/compat/meta/BridgeCrossPlugin.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/compat/meta/BridgeCrossPlugin.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.meta; import org.bukkit.entity.Entity; diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/compat/registry/AttributeAccessFactory.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/compat/registry/AttributeAccessFactory.java index b4142040..fd959de8 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/compat/registry/AttributeAccessFactory.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/compat/registry/AttributeAccessFactory.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.registry; import fr.neatmonster.nocheatplus.compat.MCAccess; diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/compat/registry/RegistryHelper.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/compat/registry/RegistryHelper.java index c920b31b..a12a310f 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/compat/registry/RegistryHelper.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/compat/registry/RegistryHelper.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.compat.registry; import fr.neatmonster.nocheatplus.NCPAPIProvider; diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/components/registry/DefaultGenericInstanceRegistry.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/components/registry/DefaultGenericInstanceRegistry.java index c360c298..0b4b391c 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/components/registry/DefaultGenericInstanceRegistry.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/components/registry/DefaultGenericInstanceRegistry.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.components.registry; import java.util.ArrayList; diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/components/registry/event/GenericInstanceHandle.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/components/registry/event/GenericInstanceHandle.java index cbd3858d..5ea37e18 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/components/registry/event/GenericInstanceHandle.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/components/registry/event/GenericInstanceHandle.java @@ -1,3 +1,17 @@ +/* + * 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 . + */ package fr.neatmonster.nocheatplus.components.registry.event; import fr.neatmonster.nocheatplus.components.registry.GenericInstanceRegistry;