Skip to content

Commit 0ca416c

Browse files
committed
Add support for Minecraft 26.3
1 parent 7387a0f commit 0ca416c

27 files changed

Lines changed: 484 additions & 34 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>[26.2.build,)</version>
176+
<version>[26.3.build,)</version>
177177
</dependency>
178178

179179
<!-- Used for storing and retreiving Constructs in a storage transparent medium: JSONs -->
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package com.laytonsmith.abstraction;
2+
3+
public interface MCBrewingRecipe extends MCRecipe {
4+
MCRecipeChoice getInput();
5+
MCRecipeChoice getIngredient();
6+
}

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

Lines changed: 127 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1904,7 +1904,133 @@ public enum MCVanillaMaterial {
19041904
SULFUR_SLAB(MCVersion.MC26_2),
19051905
SULFUR_SPIKE(MCVersion.MC26_2),
19061906
SULFUR_STAIRS(MCVersion.MC26_2),
1907-
SULFUR_WALL(MCVersion.MC26_2);
1907+
SULFUR_WALL(MCVersion.MC26_2),
1908+
1909+
// MC 26.3 additions
1910+
ABANDONED_CAMP_MAP(MCVersion.MC26_3),
1911+
BLACK_CONCRETE_SLAB(MCVersion.MC26_3),
1912+
BLACK_CONCRETE_STAIRS(MCVersion.MC26_3),
1913+
BLACK_CUSHION(MCVersion.MC26_3),
1914+
BLACK_WOOL_SLAB(MCVersion.MC26_3),
1915+
BLACK_WOOL_STAIRS(MCVersion.MC26_3),
1916+
BLUE_CONCRETE_SLAB(MCVersion.MC26_3),
1917+
BLUE_CONCRETE_STAIRS(MCVersion.MC26_3),
1918+
BLUE_CUSHION(MCVersion.MC26_3),
1919+
BLUE_WOOL_SLAB(MCVersion.MC26_3),
1920+
BLUE_WOOL_STAIRS(MCVersion.MC26_3),
1921+
BROWN_CONCRETE_SLAB(MCVersion.MC26_3),
1922+
BROWN_CONCRETE_STAIRS(MCVersion.MC26_3),
1923+
BROWN_CUSHION(MCVersion.MC26_3),
1924+
BROWN_WOOL_SLAB(MCVersion.MC26_3),
1925+
BROWN_WOOL_STAIRS(MCVersion.MC26_3),
1926+
BURIED_ANCIENT_CITY_MAP(MCVersion.MC26_3),
1927+
BURIED_MINESHAFT_MAP(MCVersion.MC26_3),
1928+
BURIED_TREASURE_MAP(MCVersion.MC26_3),
1929+
BURIED_TRIAL_CHAMBERS_MAP(MCVersion.MC26_3),
1930+
CYAN_CONCRETE_SLAB(MCVersion.MC26_3),
1931+
CYAN_CONCRETE_STAIRS(MCVersion.MC26_3),
1932+
CYAN_CUSHION(MCVersion.MC26_3),
1933+
CYAN_WOOL_SLAB(MCVersion.MC26_3),
1934+
CYAN_WOOL_STAIRS(MCVersion.MC26_3),
1935+
DESERT_PYRAMID_MAP(MCVersion.MC26_3),
1936+
DESERT_VILLAGE_MAP(MCVersion.MC26_3),
1937+
GRAY_CONCRETE_SLAB(MCVersion.MC26_3),
1938+
GRAY_CONCRETE_STAIRS(MCVersion.MC26_3),
1939+
GRAY_CUSHION(MCVersion.MC26_3),
1940+
GRAY_WOOL_SLAB(MCVersion.MC26_3),
1941+
GRAY_WOOL_STAIRS(MCVersion.MC26_3),
1942+
GREEN_CONCRETE_SLAB(MCVersion.MC26_3),
1943+
GREEN_CONCRETE_STAIRS(MCVersion.MC26_3),
1944+
GREEN_CUSHION(MCVersion.MC26_3),
1945+
GREEN_WOOL_SLAB(MCVersion.MC26_3),
1946+
GREEN_WOOL_STAIRS(MCVersion.MC26_3),
1947+
JUNGLE_PYRAMID_MAP(MCVersion.MC26_3),
1948+
LIGHT_BLUE_CONCRETE_SLAB(MCVersion.MC26_3),
1949+
LIGHT_BLUE_CONCRETE_STAIRS(MCVersion.MC26_3),
1950+
LIGHT_BLUE_CUSHION(MCVersion.MC26_3),
1951+
LIGHT_BLUE_WOOL_SLAB(MCVersion.MC26_3),
1952+
LIGHT_BLUE_WOOL_STAIRS(MCVersion.MC26_3),
1953+
LIGHT_GRAY_CONCRETE_SLAB(MCVersion.MC26_3),
1954+
LIGHT_GRAY_CONCRETE_STAIRS(MCVersion.MC26_3),
1955+
LIGHT_GRAY_CUSHION(MCVersion.MC26_3),
1956+
LIGHT_GRAY_WOOL_SLAB(MCVersion.MC26_3),
1957+
LIGHT_GRAY_WOOL_STAIRS(MCVersion.MC26_3),
1958+
LIME_CONCRETE_SLAB(MCVersion.MC26_3),
1959+
LIME_CONCRETE_STAIRS(MCVersion.MC26_3),
1960+
LIME_CUSHION(MCVersion.MC26_3),
1961+
LIME_WOOL_SLAB(MCVersion.MC26_3),
1962+
LIME_WOOL_STAIRS(MCVersion.MC26_3),
1963+
MAGENTA_CONCRETE_SLAB(MCVersion.MC26_3),
1964+
MAGENTA_CONCRETE_STAIRS(MCVersion.MC26_3),
1965+
MAGENTA_CUSHION(MCVersion.MC26_3),
1966+
MAGENTA_WOOL_SLAB(MCVersion.MC26_3),
1967+
MAGENTA_WOOL_STAIRS(MCVersion.MC26_3),
1968+
OCEAN_MONUMENT_MAP(MCVersion.MC26_3),
1969+
ORANGE_CONCRETE_SLAB(MCVersion.MC26_3),
1970+
ORANGE_CONCRETE_STAIRS(MCVersion.MC26_3),
1971+
ORANGE_CUSHION(MCVersion.MC26_3),
1972+
ORANGE_POPLAR_LEAVES(MCVersion.MC26_3),
1973+
ORANGE_WOOL_SLAB(MCVersion.MC26_3),
1974+
ORANGE_WOOL_STAIRS(MCVersion.MC26_3),
1975+
PINK_CONCRETE_SLAB(MCVersion.MC26_3),
1976+
PINK_CONCRETE_STAIRS(MCVersion.MC26_3),
1977+
PINK_CUSHION(MCVersion.MC26_3),
1978+
PINK_WOOL_SLAB(MCVersion.MC26_3),
1979+
PINK_WOOL_STAIRS(MCVersion.MC26_3),
1980+
PLAINS_VILLAGE_MAP(MCVersion.MC26_3),
1981+
POPLAR_BOAT(MCVersion.MC26_3),
1982+
POPLAR_BUTTON(MCVersion.MC26_3),
1983+
POPLAR_CHEST_BOAT(MCVersion.MC26_3),
1984+
POPLAR_DOOR(MCVersion.MC26_3),
1985+
POPLAR_FENCE(MCVersion.MC26_3),
1986+
POPLAR_FENCE_GATE(MCVersion.MC26_3),
1987+
POPLAR_HANGING_SIGN(MCVersion.MC26_3),
1988+
POPLAR_LOG(MCVersion.MC26_3),
1989+
POPLAR_PLANKS(MCVersion.MC26_3),
1990+
POPLAR_PRESSURE_PLATE(MCVersion.MC26_3),
1991+
POPLAR_SAPLING(MCVersion.MC26_3),
1992+
POPLAR_SHELF(MCVersion.MC26_3),
1993+
POPLAR_SIGN(MCVersion.MC26_3),
1994+
POPLAR_SLAB(MCVersion.MC26_3),
1995+
POPLAR_STAIRS(MCVersion.MC26_3),
1996+
POPLAR_TRAPDOOR(MCVersion.MC26_3),
1997+
POPLAR_WALL_HANGING_SIGN(MCVersion.MC26_3),
1998+
POPLAR_WALL_SIGN(MCVersion.MC26_3),
1999+
POPLAR_WOOD(MCVersion.MC26_3),
2000+
POTTED_POPLAR_SAPLING(MCVersion.MC26_3),
2001+
PURPLE_CONCRETE_SLAB(MCVersion.MC26_3),
2002+
PURPLE_CONCRETE_STAIRS(MCVersion.MC26_3),
2003+
PURPLE_CUSHION(MCVersion.MC26_3),
2004+
PURPLE_WOOL_SLAB(MCVersion.MC26_3),
2005+
PURPLE_WOOL_STAIRS(MCVersion.MC26_3),
2006+
RED_CONCRETE_SLAB(MCVersion.MC26_3),
2007+
RED_CONCRETE_STAIRS(MCVersion.MC26_3),
2008+
RED_CUSHION(MCVersion.MC26_3),
2009+
RED_POPLAR_LEAVES(MCVersion.MC26_3),
2010+
RED_SHRUB(MCVersion.MC26_3),
2011+
RED_WOOL_SLAB(MCVersion.MC26_3),
2012+
RED_WOOL_STAIRS(MCVersion.MC26_3),
2013+
SAVANNA_VILLAGE_MAP(MCVersion.MC26_3),
2014+
SHELF_MUSHROOM(MCVersion.MC26_3),
2015+
SNOWY_VILLAGE_MAP(MCVersion.MC26_3),
2016+
STRAW_BED(MCVersion.MC26_3),
2017+
STRIPPED_POPLAR_LOG(MCVersion.MC26_3),
2018+
STRIPPED_POPLAR_WOOD(MCVersion.MC26_3),
2019+
SWAMP_HUT_MAP(MCVersion.MC26_3),
2020+
TAIGA_VILLAGE_MAP(MCVersion.MC26_3),
2021+
WARM_OCEAN_RUINS_MAP(MCVersion.MC26_3),
2022+
WHITE_CONCRETE_SLAB(MCVersion.MC26_3),
2023+
WHITE_CONCRETE_STAIRS(MCVersion.MC26_3),
2024+
WHITE_CUSHION(MCVersion.MC26_3),
2025+
WHITE_WOOL_SLAB(MCVersion.MC26_3),
2026+
WHITE_WOOL_STAIRS(MCVersion.MC26_3),
2027+
WOODLAND_MANSION_MAP(MCVersion.MC26_3),
2028+
YELLOW_CONCRETE_SLAB(MCVersion.MC26_3),
2029+
YELLOW_CONCRETE_STAIRS(MCVersion.MC26_3),
2030+
YELLOW_CUSHION(MCVersion.MC26_3),
2031+
YELLOW_POPLAR_LEAVES(MCVersion.MC26_3),
2032+
YELLOW_WOOL_SLAB(MCVersion.MC26_3),
2033+
YELLOW_WOOL_STAIRS(MCVersion.MC26_3);
19082034

19092035
private final MCVersion since;
19102036
private final MCVersion until;

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
import com.laytonsmith.commandhelper.CommandHelperPlugin;
9696
import com.laytonsmith.core.LogLevel;
9797
import com.laytonsmith.core.MSLog;
98+
import com.laytonsmith.core.MSLog.Tags;
9899
import com.laytonsmith.core.Static;
99100
import com.laytonsmith.core.constructs.Target;
100101
import com.laytonsmith.core.environments.CommandHelperEnvironment;
@@ -154,6 +155,7 @@
154155
import org.bukkit.entity.Vehicle;
155156
import org.bukkit.entity.minecart.CommandMinecart;
156157
import org.bukkit.inventory.BlastingRecipe;
158+
import org.bukkit.inventory.BrewingRecipe;
157159
import org.bukkit.inventory.CampfireRecipe;
158160
import org.bukkit.inventory.ComplexRecipe;
159161
import org.bukkit.inventory.EquipmentSlot;
@@ -873,6 +875,7 @@ public MCRecipe GetNewRecipe(String key, MCRecipeType type, MCItemStack result)
873875
return new BukkitMCStonecuttingRecipe(new StonecuttingRecipe(nskey, is, Material.STRUCTURE_VOID));
874876
case SMITHING:
875877
case COMPLEX:
878+
case BREWING:
876879
throw new IllegalArgumentException("Unable to generate recipe type: " + type.name());
877880
}
878881
} catch (NoClassDefFoundError ex) {
@@ -909,7 +912,10 @@ public static MCRecipe BukkitGetRecipe(Recipe r) {
909912
return new BukkitMCShapedRecipe((ShapedRecipe) r);
910913
} else if(r instanceof MerchantRecipe) {
911914
return new BukkitMCMerchantRecipe((MerchantRecipe) r);
915+
} else if(Static.getServer().getMinecraftVersion().gte(MCVersion.MC26_3) && r instanceof BrewingRecipe) {
916+
return new BukkitMCBrewingRecipe((BrewingRecipe) r);
912917
} else {
918+
MSLog.GetLogger().e(Tags.GENERAL, "Unhandled recipe type: " + r.getClass().getSimpleName(), Target.UNKNOWN);
913919
return null;
914920
}
915921
}
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
package com.laytonsmith.abstraction.bukkit;
2+
3+
import com.laytonsmith.abstraction.MCItemStack;
4+
import com.laytonsmith.abstraction.MCRecipeChoice;
5+
import com.laytonsmith.abstraction.MCRecipeChoice.ExactChoice;
6+
import com.laytonsmith.abstraction.MCRecipeChoice.MaterialChoice;
7+
import com.laytonsmith.abstraction.MCBrewingRecipe;
8+
import com.laytonsmith.abstraction.bukkit.blocks.BukkitMCMaterial;
9+
import com.laytonsmith.abstraction.enums.MCRecipeType;
10+
import org.bukkit.Material;
11+
import org.bukkit.inventory.ItemStack;
12+
import org.bukkit.inventory.RecipeChoice;
13+
import org.bukkit.inventory.BrewingRecipe;
14+
15+
public class BukkitMCBrewingRecipe extends BukkitMCRecipe implements MCBrewingRecipe {
16+
17+
private final BrewingRecipe recipe;
18+
19+
public BukkitMCBrewingRecipe(BrewingRecipe recipe) {
20+
super(recipe);
21+
this.recipe = recipe;
22+
}
23+
24+
@Override
25+
public String getKey() {
26+
return recipe.getKey().getKey();
27+
}
28+
29+
@Override
30+
public MCRecipeType getRecipeType() {
31+
return MCRecipeType.BREWING;
32+
}
33+
34+
@Override
35+
public String getGroup() {
36+
return "";
37+
}
38+
39+
@Override
40+
public void setGroup(String group) {
41+
}
42+
43+
@Override
44+
public MCItemStack getResult() {
45+
return new BukkitMCItemStack(recipe.getResult());
46+
}
47+
48+
@Override
49+
public Object getHandle() {
50+
return recipe;
51+
}
52+
53+
@Override
54+
public MCRecipeChoice getInput() {
55+
RecipeChoice recipeChoice = recipe.getInput();
56+
if(recipeChoice instanceof RecipeChoice.MaterialChoice materialChoice) {
57+
MaterialChoice choice = new MaterialChoice();
58+
for(Material material : materialChoice.getChoices()) {
59+
choice.addMaterial(BukkitMCMaterial.valueOfConcrete(material));
60+
}
61+
return choice;
62+
} else if(recipeChoice instanceof RecipeChoice.ExactChoice exactChoice) {
63+
ExactChoice choice = new ExactChoice();
64+
for(ItemStack itemStack : exactChoice.getChoices()) {
65+
choice.addItem(new BukkitMCItemStack(itemStack));
66+
}
67+
return choice;
68+
}
69+
throw new UnsupportedOperationException("Unsupported recipe choice");
70+
}
71+
72+
@Override
73+
public MCRecipeChoice getIngredient() {
74+
RecipeChoice recipeChoice = recipe.getIngredient();
75+
if(recipeChoice instanceof RecipeChoice.MaterialChoice materialChoice) {
76+
MaterialChoice choice = new MaterialChoice();
77+
for(Material material : materialChoice.getChoices()) {
78+
choice.addMaterial(BukkitMCMaterial.valueOfConcrete(material));
79+
}
80+
return choice;
81+
} else if(recipeChoice instanceof RecipeChoice.ExactChoice exactChoice) {
82+
ExactChoice choice = new ExactChoice();
83+
for(ItemStack itemStack : exactChoice.getChoices()) {
84+
choice.addItem(new BukkitMCItemStack(itemStack));
85+
}
86+
return choice;
87+
}
88+
throw new UnsupportedOperationException("Unsupported recipe choice");
89+
}
90+
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,13 @@ public void playEffect(MCLocation l, MCEffect mcEffect, Object data, int radius)
334334
return;
335335
case SMOKE:
336336
case SHOOT_WHITE_SMOKE:
337+
case DESTROY_PROGRESS:
338+
case DESTROY_PROGRESS_WITH_SOUND:
337339
w.playEffect((Location) l.getHandle(), effect, BlockFace.valueOf(((MCBlockFace) data).name()), radius);
338340
return;
339341
case PARTICLES_AND_SOUND_BRUSH_BLOCK_COMPLETE:
340342
case DESTROY_BLOCK:
343+
case DESTROY_BLOCK_WITH_SOUND:
341344
w.playEffect((Location) l.getHandle(), effect, ((MCBlockData) data).getHandle(), radius);
342345
return;
343346
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package com.laytonsmith.abstraction.bukkit.entities;
2+
3+
import com.laytonsmith.abstraction.entities.MCCushion;
4+
import com.laytonsmith.abstraction.enums.MCDyeColor;
5+
import com.laytonsmith.abstraction.enums.bukkit.BukkitMCDyeColor;
6+
import org.bukkit.entity.Entity;
7+
import org.bukkit.entity.Cushion;
8+
9+
public class BukkitMCCushion extends BukkitMCEntity implements MCCushion {
10+
11+
Cushion c;
12+
13+
public BukkitMCCushion(Entity e) {
14+
super(e);
15+
this.c = (Cushion) e;
16+
}
17+
18+
@Override
19+
public MCDyeColor getColor() {
20+
try {
21+
return BukkitMCDyeColor.getConvertor().getAbstractedEnum(c.getColor());
22+
} catch(NoSuchMethodError ex) {
23+
// may be missing in Spigot
24+
return MCDyeColor.WHITE;
25+
}
26+
}
27+
28+
@Override
29+
public void setColor(MCDyeColor color) {
30+
try {
31+
c.setColor(BukkitMCDyeColor.getConvertor().getConcreteEnum(color));
32+
} catch(NoSuchMethodError ignore) {
33+
// may be missing in Spigot
34+
}
35+
}
36+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.laytonsmith.abstraction.entities;
2+
3+
import com.laytonsmith.abstraction.MCEntity;
4+
import com.laytonsmith.abstraction.enums.MCDyeColor;
5+
6+
public interface MCCushion extends MCEntity {
7+
8+
MCDyeColor getColor();
9+
10+
void setColor(MCDyeColor color);
11+
12+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ public enum MCVanillaBiomeType {
179179
CHERRY_GROVE(MCVersion.MC1_19_4),
180180
PALE_GARDEN(MCVersion.MC1_21_3),
181181
SULFUR_CAVES(MCVersion.MC26_2),
182+
DAPPLED_FOREST(MCVersion.MC26_3),
182183
UNKNOWN(MCVersion.NEVER);
183184

184185
private final MCVersion since;

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,19 @@ public enum MCEffect {
1010
BEE_GROWTH, // integer, Paper, added in 1.20.6, partially replaces VILLAGER_PLANT_GROW
1111
BONE_MEAL_USE, // integer
1212
COMPOSTER_FILL_ATTEMPT, // boolean for success
13+
CONSUME_EFFECT_TELEPORT, // integer, added in Paper 26.3
1314
COPPER_WAX_OFF,
1415
COPPER_WAX_ON,
15-
DESTROY_BLOCK, // Material for block type destroyed, added in Paper 26.2, replaces STEP_SOUND
16+
DESTROY_BLOCK, // BlockData, added in Paper 26.2
17+
DESTROY_BLOCK_WITH_SOUND, // BlockData, added in Paper 26.3, replaced STEP_SOUND
18+
DESTROY_PROGRESS, // BlockFace, added in Paper 26.3
19+
DESTROY_PROGRESS_WITH_SOUND, // BlockFace, added in Paper 26.3
1620
DRAGON_BREATH,
21+
ENDER_DRAGON_EGG_TELEPORT, // integer, added in Paper 26.3
1722
DRIPPING_DRIPSTONE,
1823
ELECTRIC_SPARK, // Axis at which particles are shown
1924
ENDER_DRAGON_DESTROY_BLOCK,
25+
ENDERMAN_TELEPORT, // integer, added in Paper 26.3
2026
END_GATEWAY_SPAWN,
2127
END_PORTAL_FRAME_FILL,
2228
ENDER_SIGNAL,
@@ -30,6 +36,7 @@ public enum MCEffect {
3036
POTION_BREAK, // Color
3137
REDSTONE_TORCH_BURNOUT,
3238
SHOOT_WHITE_SMOKE, // BlockFace for the direction, Paper, added 1.20 - 1.20.4
39+
SHULKER_TELEPORT, // integer, added in Paper 26.3
3340
SMASH_ATTACK, // integer, Paper, added in 1.20.5
3441
SMOKE, // BlockFace for the direction of the smoke particles
3542
SPAWN_COBWEB, // Paper, added in 1.20.6
@@ -76,6 +83,7 @@ public enum MCEffect {
7683
GHAST_SHRIEK,
7784
GRINDSTONE_USE,
7885
HUSK_CONVERTED_TO_ZOMBIE,
86+
INSTANT_POTION_SPLASH, // Paper, added 26.3
7987
IRON_DOOR_CLOSE, // deprecated in 1.19.3
8088
IRON_DOOR_TOGGLE, // deprecated in 1.19.3
8189
IRON_TRAPDOOR_CLOSE, // deprecated in 1.19.3
@@ -91,6 +99,7 @@ public enum MCEffect {
9199
SMITHING_TABLE_USE,
92100
SOUND_STOP_JUKEBOX_SONG, // Paper, added 1.20 - 1.20.4
93101
SOUND_WITH_CHARGE_SHOT, // Paper, added 1.21
102+
SPELL_POTION_SPLASH, // Paper, added 26.3
94103
STEP_SOUND, // Material for block type stepped on, deprecated for DESTROY_BLOCK in Paper 26.2
95104
SULFUR_SPIKE_LAND, // Paper, added in 26.2
96105
TRAPDOOR_CLOSE, // deprecated in 1.19.3

0 commit comments

Comments
 (0)