Skip to content

Commit 00282c6

Browse files
KaevonDchatasma
authored andcommitted
removed unnecessary NSM_HACKS functions and one other fun thing
1 parent 4497d8f commit 00282c6

File tree

4 files changed

+2
-55
lines changed

4 files changed

+2
-55
lines changed

core/src/main/java/tc/oc/pgm/projectile/ProjectileModule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ private static ProjectileDefinition.ProjectileEntity parseProjectileEntity(
128128
if (!entityText.matches("[a-zA-Z0-9_]+")) {
129129
throw new InvalidXMLException("Invalid entity type '" + entityText + "'", node);
130130
}
131-
if (ABSTRACT_ENTITY_MAP.containsKey(entityText)) {
132-
return ABSTRACT_ENTITY_MAP.get(entityText);
131+
if (ABSTRACT_ENTITY_MAP.containsKey(entityText.toLowerCase())) {
132+
return ABSTRACT_ENTITY_MAP.get(entityText.toLowerCase());
133133
}
134134
return new ProjectileDefinition.ProjectileEntity.RealEntity(XMLUtils.parseEntityTypeAttribute(element, attributeName, def));
135135
}

platform/platform-modern/src/main/java/tc/oc/pgm/platform/modern/impl/ModernNMSHacks.java

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -394,36 +394,4 @@ public int allocateEntityId() {
394394
public boolean isBlockDisplayEntity(Class<? extends Entity> entity) {
395395
return entity.isAssignableFrom(BlockDisplay.class);
396396
}
397-
398-
@Override
399-
public void setTeleportationDuration(Entity entity, int duration) {
400-
((BlockDisplay) entity).setTeleportDuration(duration);
401-
}
402-
403-
@Override
404-
public void setBlockDisplayBlock(Entity entity, Material block) {
405-
((BlockDisplay) entity).setBlock(block.createBlockData());
406-
}
407-
408-
@Override
409-
public void alignBlockDisplayToPlayerFacing(Entity entity, float pitch, float yaw, float scale) {
410-
final Matrix4f translation = new Matrix4f().translate(
411-
new Vector3f(
412-
-0.5f * scale,
413-
-0.5f * scale,
414-
-0.5f * scale
415-
));
416-
417-
final Matrix4f rotationMatrix = new Matrix4f();
418-
final Quaternionf rotation = new Quaternionf();
419-
rotation.rotateLocalX((float) Math.toRadians(-1 * pitch));
420-
rotation.rotateLocalY((float) Math.toRadians(180 - yaw));
421-
rotation.get(rotationMatrix);
422-
423-
final Matrix4f scaleMatrix = new Matrix4f().scale(scale);
424-
final Matrix4f transformationMatrix = rotationMatrix.mul(translation.mul(scaleMatrix));
425-
((BlockDisplay) entity).setTransformationMatrix(
426-
transformationMatrix
427-
);
428-
}
429397
}

platform/platform-sportpaper/src/main/java/tc/oc/pgm/platform/sportpaper/impl/SpNMSHacks.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -230,19 +230,4 @@ public int allocateEntityId() {
230230
public boolean isBlockDisplayEntity(Class<? extends Entity> entity) {
231231
return false;
232232
}
233-
234-
@Override
235-
public void setTeleportationDuration(Entity entity, int duration) {
236-
throw new UnsupportedOperationException("Teleportation duration is not supported on lower versions.");
237-
}
238-
239-
@Override
240-
public void setBlockDisplayBlock(Entity entity, Material block) {
241-
throw new UnsupportedOperationException("Block display entities are not supported on lower versions.");
242-
}
243-
244-
@Override
245-
public void alignBlockDisplayToPlayerFacing(Entity entity, float pitch, float yaw, float scale) {
246-
throw new UnsupportedOperationException("Block display entities are not supported on lower versions.");
247-
}
248233
}

util/src/main/java/tc/oc/pgm/util/nms/NMSHacks.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,4 @@ public interface NMSHacks {
6060
int allocateEntityId();
6161

6262
boolean isBlockDisplayEntity(Class<? extends Entity> entity);
63-
64-
void setTeleportationDuration(Entity entity, int duration);
65-
66-
void setBlockDisplayBlock(Entity entity, Material block);
67-
68-
void alignBlockDisplayToPlayerFacing(Entity entity, float pitch, float yaw, float scale);
6963
}

0 commit comments

Comments
 (0)