Skip to content

Instantly share code, notes, and snippets.

@GizmoTheMoonPig
Last active April 19, 2024 00:36
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GizmoTheMoonPig/77a90a48e0aeecd15b4c524e1c7f0a4a to your computer and use it in GitHub Desktop.
Save GizmoTheMoonPig/77a90a48e0aeecd15b4c524e1c7f0a4a to your computer and use it in GitHub Desktop.
Materials: where did they go?

Starting in 1.20, the Material class has completely disappeared and has been replaced with a series of properties that are chained to BlockBehavior.Properties.of. This list exists so you can easily figure out which propeties to use to replace the old materials.

Every Material here gives its default MapColor (previously known as MaterialColor), regardless of if it had one or not. It also defines which properties to use to replicate the exact behavior used previously.

The very bottom of this file defines the more complicated replacements to certain material properties.

  • AIR - No MapColor, replaceable
  • STRUCTURAL_AIR - No MapColor, replaceable
  • PORTAL - No MapColor, PushReaction.BLOCK
  • CLOTH_DECORATION - MapColor.WOOL, ignitedByLava
  • PLANT - MapColor.PLANT, PushReaction.DESTROY
  • WATER_PLANT - MapColor.WATER, NoteBlockInstrument.BASEDRUM
  • REPLACEABLE_PLANT - MapColor.PLANT, replaceable, ignitedByLava, PushReaction.DESTROY
  • REPLACEABLE_FIREPROOF_PLANT - MapColor.PLANT, replaceable, PushReaction.DESTROY
  • REPLACEABLE_WATER_PLANT - MapColor.WATER, replaceable, PushReaction.DESTROY
  • WATER - MapColor.WATER, replaceable, PushReaction.DESTROY, liquid
  • BUBBLE_COLUMN - MapColor.WATER, replaceable, PushReaction.DESTROY, liquid
  • LAVA - MapColor.FIRE, replaceable, PushReaction.DESTROY, liquid
  • TOP_SNOW - MapColor.SNOW, replaceable, PushReaction.DESTROY
  • FIRE - MapColor.FIRE, replaceable, PushReaction.DESTROY
  • DECORATION - No MapColor, PushReaction.DESTROY
  • WEB - MapColor.WOOL, PushReaction.DESTROY
  • SCULK - MapColor.COLOR_BACK
  • BUILDABLE_GRASS = No MapColor
  • CLAY - MapColor.CLAY
  • DIRT - MapColor.DIRT
  • GRASS - MapColor.GRASS
  • ICE_SOLID - MapColor.ICE
  • SAND - MapColor.SAND, NoteBlockInstrument.SNARE
  • SPONGE - MapColor.COLOR_YELLOW
  • SHULKER_SHELL - MapColor.COLOR_PURPLE
  • WOOD - MapColor.WOOD, ignitedByLava, NoteBlockInstrument.BASS
  • NETHER_WOOD - MapColor.WOOD
  • BAMBOO_SAPLING - MapColor.WOOD, ignitedByLava, PushReaction.DESTROY
  • BAMBOO - MapColor.WOOD, ignitedByLava, PushReaction.DESTROY
  • WOOL - MapColor.WOOL, ignitedByLava
  • EXPLOSIVE - MapColor.FIRE, ignitedByLava
  • LEAVES - MapColor.PLANT, ignitedByLava, PushReaction.DESTROY
  • GLASS - No MapColor, NoteBlockInstrument.HAT
  • ICE - MapColor.ICE
  • CACTUS - MapColor.PLANT, PushReaction.DESTROY
  • STONE - MapColor.STONE, NoteBlockInstrument.BASEDRUM
  • METAL - MapColor.METAL
  • SNOW - MapColor.SNOW
  • HEAVY_METAL - MapColor.METAL, PushReaction.BLOCK
  • BARRIER - No MapColor, PushReaction.BLOCK
  • PISTON - MapColor.STONE, PushReaction.BLOCK
  • MOSS - MapColor.PLANT, PushReaction.DESTROY
  • VEGETABLE - MapColor.PLANT, PushReaction.DESTROY
  • EGG - MapColor.PLANT, PushReaction.DESTROY
  • CAKE - No MapColor, PushReaction.DESTROY
  • AMETHYST - MapColor.COLOR_PURPLE
  • POWDER_SNOW - MapColor.SNOW
  • FROGSPAWN - MapColor.WATER, PushReaction.DESTROY
  • FLOGLIGHT - No MapColor
  • DECORATED_POT - MapColor.TERRACOTTA_RED, PushReaction.DESTROY

Redstone Conduction: any blocks with the material AIR, STRUCTURAL_AIR, PORTAL, CLOTH_DECORATION, PLANT, REPLACEABLE_PLANT, REPLACEABLE_FIREPROOF_PLANT, REPLACEABLE_WATER_PLANT, WATER, BUBBLE_COLUMN, LAVA, TOP_SNOW, FIRE, DECORATION, WEB, EXPLOSIVE, LEAVES, GLASS, ICE, CACTUS, and FROGSPAWN were not considered redstone conductors regardless if they were a full block or not. You can replicate this by using the following property: isRedstoneConductor((state, getter, pos) -> false)

Motion Blocking: any blocks with the material AIR, STRUCTURAL_AIR, PORTAL, CLOTH_DECORATION, PLANT, REPLACEABLE_PLANT, REPLACEABLE_FIREPROOF_PLANT, REPLACEABLE_WATER_PLANT, WATER, BUBBLE_COLUMN, LAVA, TOP_SNOW, FIRE, DECORATION, WEB, BAMBOO_SAPLING, POWDER_SNOW, and FROGSPAWN are not considered "motion blocking" blocks regardless of if they have collision or not. This weird-ass beahior is used only in a few places (look for uses of BlockBehavior.blocksMotion) and can either be replicated by overriding the method mentioned up above or using the forceSolidOff property. Alternatively you can use forceSolidOn to make your block "motion blocking".

Not Solid: any blocks with the material AIR, STRUCTURAL_AIR, PORTAL, CLOTH_DECORATION, PLANT, REPLACEABLE_PLANT, REPLACEABLE_FIREPROOF_PLANT, REPLACEABLE_WATER_PLANT, WATER, BUBBLE_COLUMN, LAVA, TOP_SNOW, FIRE, DECORATION, POWDER_SNOW, and FROGSPAWN are not considered "not solid" blocks regardless of if they have collision or not. This functions the exact same way motion blocking functions, but its just used in a lot of other places. You can toggle it using the forceSolidOff and forceSolidOn. If neither are defined its calculated based on the block's voxelshape, the properties serve as overrides. Handy for allowing blocks that require sturdy surface to sit on the block, and also allows mobs to pathfind over it. (For all uses look up BlockBehavior.isSolid)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment