Skip to content

Commit 0692fab

Browse files
committed
Add support for Minecraft 26.2
1 parent c9c8760 commit 0692fab

28 files changed

Lines changed: 392 additions & 38 deletions

‎pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
<dependency>
174174
<groupId>io.papermc.paper</groupId>
175175
<artifactId>paper-api</artifactId>
176-
<version>1.21.11-R0.1-SNAPSHOT</version>
176+
<version>[26.2.build,)</version>
177177
</dependency>
178178

179179
<!-- Used for storing and retreiving Constructs in a storage transparent medium: JSONs -->

‎src/main/java/com/laytonsmith/abstraction/MCParticleData.java‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,22 @@ public MCColor color() {
9797
return this.color;
9898
}
9999
}
100+
101+
public static class GeyserBase {
102+
int waterBlocks;
103+
float burstImpulseBase;
104+
105+
public GeyserBase(int waterBlocks, float burstImpulseBase) {
106+
this.waterBlocks = waterBlocks;
107+
this.burstImpulseBase = burstImpulseBase;
108+
}
109+
110+
public int waterBlocks() {
111+
return this.waterBlocks;
112+
}
113+
114+
public float burstImpulseBase() {
115+
return this.burstImpulseBase;
116+
}
117+
}
100118
}

‎src/main/java/com/laytonsmith/abstraction/blocks/MCMaterial.java‎

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1871,7 +1871,40 @@ public enum MCVanillaMaterial {
18711871

18721872
// 26.1 additions
18731873
GOLDEN_DANDELION(MCVersion.MC26_1),
1874-
POTTED_GOLDEN_DANDELION(MCVersion.MC26_1);
1874+
POTTED_GOLDEN_DANDELION(MCVersion.MC26_1),
1875+
1876+
// 26.2 additions
1877+
CHISELED_CINNABAR(MCVersion.MC26_2),
1878+
CHISELED_SULFUR(MCVersion.MC26_2),
1879+
CINNABAR(MCVersion.MC26_2),
1880+
CINNABAR_BRICK_SLAB(MCVersion.MC26_2),
1881+
CINNABAR_BRICK_STAIRS(MCVersion.MC26_2),
1882+
CINNABAR_BRICK_WALL(MCVersion.MC26_2),
1883+
CINNABAR_BRICKS(MCVersion.MC26_2),
1884+
CINNABAR_SLAB(MCVersion.MC26_2),
1885+
CINNABAR_STAIRS(MCVersion.MC26_2),
1886+
CINNABAR_WALL(MCVersion.MC26_2),
1887+
MUSIC_DISC_BOUNCE(MCVersion.MC26_2),
1888+
POLISHED_CINNABAR(MCVersion.MC26_2),
1889+
POLISHED_CINNABAR_SLAB(MCVersion.MC26_2),
1890+
POLISHED_CINNABAR_STAIRS(MCVersion.MC26_2),
1891+
POLISHED_CINNABAR_WALL(MCVersion.MC26_2),
1892+
POLISHED_SULFUR(MCVersion.MC26_2),
1893+
POLISHED_SULFUR_SLAB(MCVersion.MC26_2),
1894+
POLISHED_SULFUR_STAIRS(MCVersion.MC26_2),
1895+
POLISHED_SULFUR_WALL(MCVersion.MC26_2),
1896+
POTENT_SULFUR(MCVersion.MC26_2),
1897+
SULFUR(MCVersion.MC26_2),
1898+
SULFUR_CUBE_BUCKET(MCVersion.MC26_2),
1899+
SULFUR_CUBE_SPAWN_EGG(MCVersion.MC26_2),
1900+
SULFUR_BRICK_SLAB(MCVersion.MC26_2),
1901+
SULFUR_BRICK_STAIRS(MCVersion.MC26_2),
1902+
SULFUR_BRICK_WALL(MCVersion.MC26_2),
1903+
SULFUR_BRICKS(MCVersion.MC26_2),
1904+
SULFUR_SLAB(MCVersion.MC26_2),
1905+
SULFUR_SPIKE(MCVersion.MC26_2),
1906+
SULFUR_STAIRS(MCVersion.MC26_2),
1907+
SULFUR_WALL(MCVersion.MC26_2);
18751908

18761909
private final MCVersion since;
18771910
private final MCVersion until;

‎src/main/java/com/laytonsmith/abstraction/bukkit/BukkitMCWorld.java‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import com.laytonsmith.abstraction.enums.MCWorldType;
4040
import com.laytonsmith.abstraction.enums.bukkit.BukkitMCBiomeType;
4141
import com.laytonsmith.abstraction.enums.bukkit.BukkitMCDifficulty;
42+
import com.laytonsmith.abstraction.enums.bukkit.BukkitMCEffect;
4243
import com.laytonsmith.abstraction.enums.bukkit.BukkitMCEntityType;
4344
import com.laytonsmith.abstraction.enums.bukkit.BukkitMCParticle;
4445
import com.laytonsmith.abstraction.enums.bukkit.BukkitMCSound;
@@ -319,13 +320,13 @@ public boolean generateTree(MCLocation l, MCTreeType treeType) {
319320
}
320321

321322
@Override
322-
public void playEffect(MCLocation l, MCEffect mCEffect, int data, int radius) {
323-
w.playEffect(((BukkitMCLocation) l).l, Effect.valueOf(mCEffect.name()), data, radius);
323+
public void playEffect(MCLocation l, MCEffect mcEffect, int data, int radius) {
324+
w.playEffect(((BukkitMCLocation) l).l, BukkitMCEffect.getConvertor().getConcreteEnum(mcEffect), data, radius);
324325
}
325326

326327
@Override
327328
public void playEffect(MCLocation l, MCEffect mcEffect, Object data, int radius) {
328-
Effect effect = Effect.valueOf(mcEffect.name());
329+
Effect effect = BukkitMCEffect.getConvertor().getConcreteEnum(mcEffect);
329330
switch(mcEffect) {
330331
case RECORD_PLAY:
331332
case STEP_SOUND:
@@ -336,6 +337,7 @@ public void playEffect(MCLocation l, MCEffect mcEffect, Object data, int radius)
336337
w.playEffect((Location) l.getHandle(), effect, BlockFace.valueOf(((MCBlockFace) data).name()), radius);
337338
return;
338339
case PARTICLES_AND_SOUND_BRUSH_BLOCK_COMPLETE:
340+
case DESTROY_BLOCK:
339341
w.playEffect((Location) l.getHandle(), effect, ((MCBlockData) data).getHandle(), radius);
340342
return;
341343
}

‎src/main/java/com/laytonsmith/abstraction/bukkit/BukkitMCWorldCreator.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.laytonsmith.abstraction.MCWorld;
44
import com.laytonsmith.abstraction.MCWorldCreator;
5+
import com.laytonsmith.abstraction.enums.MCVersion;
56
import com.laytonsmith.abstraction.enums.MCWorldEnvironment;
67
import com.laytonsmith.abstraction.enums.MCWorldType;
78
import com.laytonsmith.abstraction.enums.bukkit.BukkitMCWorldEnvironment;
@@ -26,7 +27,8 @@ public BukkitMCWorldCreator(String name) {
2627
@Override
2728
public MCWorld createWorld() {
2829
World w = creator.createWorld();
29-
if(w != null && w.getEnvironment() == Environment.NORMAL) {
30+
if(w != null && w.getEnvironment() == Environment.NORMAL
31+
&& Static.getServer().getMinecraftVersion().lt(MCVersion.MC26_1)) {
3032
File nether = new File(w.getWorldFolder(), "DIM-1");
3133
if(nether.exists()) {
3234
Static.getLogger().log(Level.WARNING, "Loaded " + w.getName() + " world with overworld (NORMAL)"
@@ -44,6 +46,9 @@ public MCWorld createWorld() {
4446
@Override
4547
public MCWorldCreator type(MCWorldType type) {
4648
WorldType wt = BukkitMCWorldType.getConvertor().getConcreteEnum(type);
49+
if(wt == null) {
50+
throw new IllegalArgumentException(type.name() + " unsupported on this version.");
51+
}
4752
creator.type(wt);
4853
return this;
4954
}

‎src/main/java/com/laytonsmith/abstraction/bukkit/entities/BukkitMCPlayer.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ public void playSound(MCEntity ent, MCSound sound, MCSoundCategory category, flo
693693
if(cat == null) {
694694
cat = SoundCategory.MASTER;
695695
}
696-
if(category == null) {
696+
if(seed == null) {
697697
p.playSound((Entity) ent.getHandle(), ((BukkitMCSound) sound).getConcrete(), cat, volume, pitch);
698698
} else {
699699
p.playSound((Entity) ent.getHandle(), ((BukkitMCSound) sound).getConcrete(), cat, volume, pitch, seed);
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.laytonsmith.abstraction.bukkit.entities;
2+
3+
import com.laytonsmith.abstraction.entities.MCSulfurCube;
4+
import org.bukkit.entity.Entity;
5+
import org.bukkit.entity.SulfurCube;
6+
7+
public class BukkitMCSulfurCube extends BukkitMCLivingEntity implements MCSulfurCube {
8+
9+
public BukkitMCSulfurCube(Entity sulfurCube) {
10+
super(sulfurCube);
11+
}
12+
13+
@Override
14+
public int getSize() {
15+
return ((SulfurCube) getHandle()).getSize();
16+
}
17+
18+
@Override
19+
public void setSize(int size) {
20+
((SulfurCube) getHandle()).setSize(size);
21+
}
22+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.laytonsmith.abstraction.entities;
2+
3+
import com.laytonsmith.abstraction.MCLivingEntity;
4+
5+
public interface MCSulfurCube extends MCLivingEntity {
6+
7+
int getSize();
8+
9+
void setSize(int size);
10+
}

‎src/main/java/com/laytonsmith/abstraction/enums/MCAttribute.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ public enum MCVanillaAttribute {
104104
CAMERA_DISTANCE(MCVersion.MC1_21_6),
105105
WAYPOINT_TRANSMIT_RANGE(MCVersion.MC1_21_6),
106106
WAYPOINT_RECEIVE_RANGE(MCVersion.MC1_21_6),
107+
AIR_DRAG_MODIFIER(MCVersion.MC26_2),
108+
FRICTION_MODIFIER(MCVersion.MC26_2),
109+
BOUNCINESS(MCVersion.MC26_2),
110+
BELOW_NAME_DISTANCE(MCVersion.MC26_2),
111+
NAME_TAG_DISTANCE(MCVersion.MC26_2),
107112

108113
UNKNOWN(MCVersion.NEVER);
109114

‎src/main/java/com/laytonsmith/abstraction/enums/MCBiomeType.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ public enum MCVanillaBiomeType {
178178
DEEP_DARK(MCVersion.MC1_19),
179179
CHERRY_GROVE(MCVersion.MC1_19_4),
180180
PALE_GARDEN(MCVersion.MC1_21_3),
181+
SULFUR_CAVES(MCVersion.MC26_2),
181182
UNKNOWN(MCVersion.NEVER);
182183

183184
private final MCVersion since;

0 commit comments

Comments
 (0)