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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/nms-groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ java21:
- "1.21.5" # 1_21_R4
- "1.21.8" # 1_21_R5
- "1.21.10" # 1_21_R6
- "1.21.11" # 1_21_R7
2 changes: 2 additions & 0 deletions NEXT_RELEASE_CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
- Add full support for Minecraft 1.21.11.
- Add some accidentally omitted materials in #61. Thanks, Strahilchu, for the bug report!
- Update ByteBuddy to fix support for up to Java 26. Thanks, Strahilchu, for the bug report!
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version 0.1.8.65
- Add full support for Minecraft 1.21.11.
- Add some accidentally omitted materials in #61. Thanks, Strahilchu, for the bug report!
- Update ByteBuddy to fix support for up to Java 26. Thanks, Strahilchu, for the bug report!

Expand Down
7 changes: 7 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,13 @@
<scope>compile</scope>
</dependency>

<dependency>
<groupId>nl.pim16aap2.BigDoors</groupId>
<artifactId>v1_21_R7</artifactId>
<version>0.1.8.65-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>${dependency.xseries.groupid}</groupId>
<artifactId>XSeries</artifactId>
Expand Down
3 changes: 3 additions & 0 deletions core/src/main/java/nl/pim16aap2/bigDoors/BigDoors.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import nl.pim16aap2.bigDoors.NMS.FallingBlockFactoryProvider_V1_21_R4;
import nl.pim16aap2.bigDoors.NMS.FallingBlockFactoryProvider_V1_21_R5;
import nl.pim16aap2.bigDoors.NMS.FallingBlockFactoryProvider_V1_21_R6;
import nl.pim16aap2.bigDoors.NMS.FallingBlockFactoryProvider_V1_21_R7;
import nl.pim16aap2.bigDoors.NMS.FallingBlockFactory_V1_11_R1;
import nl.pim16aap2.bigDoors.NMS.FallingBlockFactory_V1_12_R1;
import nl.pim16aap2.bigDoors.NMS.FallingBlockFactory_V1_13_R1;
Expand Down Expand Up @@ -909,6 +910,8 @@ public static boolean isOnFlattenedVersion()
case 9:
case 10:
return FallingBlockFactoryProvider_V1_21_R6.getFactory();
case 11:
return FallingBlockFactoryProvider_V1_21_R7.getFactory();
}

default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,32 +141,39 @@ public enum ResourcePackDetails
Semver.of(1, 21, 10)
),

FORMAT_75(
"https://www.dropbox.com/scl/fi/kczu66cqd6px9j709or73/BigDoorsResourcePack-Format75.zip?rlkey=l0xjfykpj0mtjbftllkqu693q&st=1ixd3obx&dl=1",
"8ddb4e0ec0bdde9ac3851112cf1f857d27b46c9a",
Semver.of(1, 21, 11),
Semver.of(1, 21, 11)
),

;

private static final ResourcePackDetails[] VALUES = values();
private static final ResourcePackDetails LATEST = VALUES[VALUES.length - 1];

private final String url;
private final byte[] hash;
private final byte[] sha1Hash;
private final Semver minVersion;
private final Semver maxVersion;

/**
* @param url The URL to the resource pack.
* @param hash The SHA1 hash of the resource pack.
* @param sha1Hash The SHA1 hash of the resource pack.
* @param minVersion The minimum version for which the resource pack is suitable (inclusive).
* @param maxVersion The maximum version for which the resource pack is suitable (inclusive).
*/
ResourcePackDetails(String url, byte[] hash, Semver minVersion, Semver maxVersion)
ResourcePackDetails(String url, byte[] sha1Hash, Semver minVersion, Semver maxVersion)
{
this.url = url;
this.hash = hash;
this.sha1Hash = sha1Hash;

this.minVersion = minVersion;
this.maxVersion = maxVersion;

if (this.hash.length != 0 && this.hash.length != 20)
throw new IllegalArgumentException("The hash must be empty or 20 bytes long! Got: " + this.hash.length + " bytes.");
if (this.sha1Hash.length != 0 && this.sha1Hash.length != 20)
throw new IllegalArgumentException("The hash must be empty or 20 bytes long! Got: " + this.sha1Hash.length + " bytes.");
}

ResourcePackDetails(String url, String hash, Semver minVersion, Semver maxVersion)
Expand Down Expand Up @@ -242,6 +249,6 @@ public String getUrl()
*/
public byte[] getHash()
{
return hash;
return sha1Hash;
}
}
1 change: 1 addition & 0 deletions nms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<module>v1_21_R4</module>
<module>v1_21_R5</module>
<module>v1_21_R6</module>
<module>v1_21_R7</module>
</modules>

<dependencies>
Expand Down
34 changes: 34 additions & 0 deletions nms/v1_21_R7/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>v1_21_R7</artifactId>

<parent>
<groupId>nl.pim16aap2.BigDoors</groupId>
<artifactId>nms</artifactId>
<version>0.1.8.65-SNAPSHOT</version>
</parent>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.21.11-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>nl.pim16aap2.BigDoors</groupId>
<artifactId>nms-api</artifactId>
<version>0.1.8.65-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
package nl.pim16aap2.bigDoors.NMS;

import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.data.BlockData;
import org.bukkit.craftbukkit.v1_21_R7.CraftServer;
import org.bukkit.craftbukkit.v1_21_R7.block.data.CraftBlockData;
import org.bukkit.craftbukkit.v1_21_R7.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_21_R7.util.CraftMagicNumbers;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntitySnapshot;
import org.bukkit.entity.FallingBlock;
import org.bukkit.util.EulerAngle;
import org.bukkit.util.Vector;
import org.jetbrains.annotations.NotNull;

public class CustomCraftFallingBlock_V1_21_R7 extends CraftEntity implements FallingBlock, CustomCraftFallingBlock
{
public CustomCraftFallingBlock_V1_21_R7(final CraftServer server, final CustomEntityFallingBlock_V1_21_R7 entity)
{
super(server, entity);
setVelocity(new Vector(0, 0, 0));
setDropItem(false);
}

@Override
public CustomEntityFallingBlock_V1_21_R7 getHandle()
{
return (CustomEntityFallingBlock_V1_21_R7) entity;
}

@Override
public boolean isOnGround()
{
return false;
}

@Override
public String toString()
{
return "CraftFallingBlock";
}

@Override
public void setVisibleByDefault(boolean flag)
{
}

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

@Override
public boolean isInWorld()
{
return false;
}

@Override
public EntitySnapshot createSnapshot()
{
throw new UnsupportedOperationException("Not implemented for animated blocks!");
}

@Override
public Entity copy()
{
throw new UnsupportedOperationException("Not implemented for animated blocks!");
}

@Override
public Entity copy(@NotNull Location location)
{
throw new UnsupportedOperationException("Not implemented for animated blocks!");
}

@Override
@Deprecated
public @NotNull Material getMaterial()
{
return CraftMagicNumbers.getMaterial(getHandle().scGetIBlockData()).getItemType();
}

@Override
public @NotNull BlockData getBlockData()
{
return CraftBlockData.fromData(this.getHandle().scGetIBlockData());
}

@Override
public boolean getDropItem()
{
return false;
}

@Override
public void setDropItem(final boolean drop)
{
}

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

@Override
public void setCancelDrop(boolean b)
{
}

@Override
public boolean canHurtEntities()
{
return false;
}

@Override
public void setHurtEntities(final boolean hurtEntities)
{
}

@Override
public float getDamagePerBlock()
{
return 0;
}

@Override
public void setDamagePerBlock(float damage)
{
}

@Override
public int getMaxDamage()
{
return 0;
}

@Override
public void setMaxDamage(int damage)
{
}

@Override
public void setTicksLived(final int value)
{
super.setTicksLived(value);
getHandle().scSetTicksLived(value);
}

@Override
public void setHeadPose(EulerAngle pose)
{
}

@Override
public void setBodyPose(EulerAngle eulerAngle)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package nl.pim16aap2.bigDoors.NMS;

/**
* Represents a class that can generate a subclass of {@link CustomEntityFallingBlock_V1_21_R7}.
*/
class CustomEntityFallingBlockGenerator_V1_21_R7
{
/**
* Gets a {@link FallingBlockFactory_V1_21_R7.CustomEntityFallingBlockFactory} that can be used to create new
* {@link CustomEntityFallingBlock_V1_21_R7} instances.
*
* @return The supplier for new {@link CustomEntityFallingBlock_V1_21_R7} instances.
*/
public FallingBlockFactory_V1_21_R7.CustomEntityFallingBlockFactory getEntityFallingBlockSupplier()
{
return (world, x, y, z, blockData) -> {
try
{
return new CustomEntityFallingBlock_V1_21_R7(world, x, y, z, blockData);
}
catch (Exception e)
{
throw new RuntimeException("Failed to create a new CustomEntityFallingBlock instance!", e);
}
};
}
}
Loading