BlockType class
Пакет: com.hypixel.hytale.server.core.asset.type.blocktype.config
Файл: com/hypixel/hytale/server/core/asset/type/blocktype/config/BlockType.java
implements: JsonAssetWithMap<String, BlockTypeAssetMap<String, BlockType>>, NetworkSerializable<com.hypixel.hytale.protocol.BlockType>
Поля (71)
| Модификаторы | Тип | Имя |
|---|---|---|
|
|
ALL_SUPPORTING_FACES |
|
|
ASSET_STORE |
|
|
DEBUG_CUBE |
|
|
DEBUG_MODEL |
|
|
DEFAULT_BLOCK_TYPE |
|
|
DEFAULT_SHADER_EFFECTS |
|
|
EMPTY |
|
|
KEY_MEMORY_DESERIALIZER |
|
|
KEY_MEMORY_SERIALIZER |
final |
float |
MAX_CUSTOM_MODEL_ANIMATION_SPEED |
|
|
UNKNOWN |
|
|
break |
|
EnumMap |
var0 |
|
BlockType |
var1 |
|
com.hypixel.hytale.protocol.BlockType |
var1 |
|
String |
var1 |
|
Object2ObjectOpenHashMap |
var11 |
|
float |
var12 |
|
int |
var13 |
|
int[] |
var14 |
|
RequiredBlockFaceSupport |
var14 |
|
BlockFaceSupport |
var14 |
|
Object2IntOpenHashMap |
var17 |
|
BlockGathering |
var2 |
|
BlockTypeAssetMap |
var2 |
|
String |
var2 |
|
String |
var2 |
|
|
var2 |
|
|
var2 |
|
Map |
var2 |
|
|
var2 |
|
Map |
var2 |
|
|
var2 |
|
|
var2 |
|
RailConfig |
var2 |
|
|
var2 |
|
Map |
var2 |
|
BlockType |
var2 |
|
String |
var2 |
|
BlockTextures[] |
var20 |
|
ModelTexture[] |
var22 |
|
String |
var25 |
|
IntSet |
var26 |
|
com.hypixel.hytale.protocol.BlockType |
var3 |
|
RotationTuple |
var3 |
|
RotationTuple |
var3 |
|
RotationTuple |
var3 |
|
Map |
var3 |
|
BlockBoundingBoxes |
var3 |
|
BlockFaceSupport[] |
var33 |
|
com.hypixel.hytale.protocol.BlockFaceSupport[] |
var36 |
|
Item |
var4 |
|
Map |
var4 |
|
Map |
var4 |
|
RootInteraction |
var4 |
|
BlockBoundingBoxes.RotatedVariantBoxes |
var4 |
|
int |
var4 |
|
|
var4 |
|
Object2ObjectOpenHashMap |
var5 |
|
Box |
var5 |
|
int |
var5 |
|
BlockFace |
var7 |
|
BlockFace |
var7 |
|
RequiredBlockFaceSupport[] |
var8 |
|
RequiredBlockFaceSupport[] |
var8 |
|
BlockFaceSupport[] |
var8 |
|
Vector3f |
var8 |
|
|
var8 |
|
com.hypixel.hytale.protocol.RequiredBlockFaceSupport[] |
var9 |
|
BlockFace |
var9 |
|
BlockFace |
var9 |
Методы (161)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
abstract |
throw new |
IllegalArgumentExceptionthrow new IllegalArgumentException("Unknown key! " + var1) |
abstract |
throw new |
IllegalStateExceptionthrow new IllegalStateException("Unknown hitbox: " + this.hitboxType) |
static |
boolean |
blocksLineOfSightboolean blocksLineOfSight(int var0) |
public |
boolean |
canBePlacedAsDecoboolean canBePlacedAsDeco() |
private |
boolean |
computeHasUniformTexturesboolean computeHasUniformTextures() |
|
public int |
deserializepublic int deserialize(MemorySegment var1, int var2) |
|
|
for for(int var10 = 0; var10 < var8.length; var10++) |
|
|
for for(int var39 = 0; var39 < var33.length; var39++) |
|
|
for for(BlockTypeTextures var37 : this.textures) |
|
|
for for(int var29 = 0; var29 < this.textures.length; var29++) |
|
|
for for(CustomModelTexture var38 : this.customModelTexture) |
|
|
for for(int var31 = 0; var31 < this.customModelTexture.length; var31++) |
|
|
for for(int var23 = 0; var23 < this.transitionToGroups.length; var23++) |
|
|
for for(int var15 = 0; var15 < this.conditionalSounds.length; var15++) |
|
|
for for(int var16 = 0; var16 < this.particles.length; var16++) |
|
|
for for(BlockTypeTextures var4 : this.textures) |
|
|
for for(RequiredBlockFaceSupport var13 : var8) |
|
|
for for(BlockFaceSupport var13 : var8) |
|
|
for for(RailPoint var7 : var2.points) |
|
|
for for(BlockFace var4 : BlockFace.VALUES) |
public |
String |
getAmbientSoundEventIdString getAmbientSoundEventId() |
public |
int |
getAmbientSoundEventIndexint getAmbientSoundEventIndex() |
static |
BlockTypeAssetMap<String, BlockType> |
getAssetMapBlockTypeAssetMap<String, BlockType> getAssetMap() |
static |
AssetStore<String, BlockType, BlockTypeAssetMap<String, BlockType>> |
getAssetStoreAssetStore<String, BlockType, BlockTypeAssetMap<String, BlockType>> getAssetStore() |
public |
Bench |
getBenchBench getBench() |
public |
int |
getBiomeTintDownint getBiomeTintDown() |
public |
int |
getBiomeTintEastint getBiomeTintEast() |
public |
int |
getBiomeTintNorthint getBiomeTintNorth() |
public |
int |
getBiomeTintSouthint getBiomeTintSouth() |
public |
int |
getBiomeTintUpint getBiomeTintUp() |
public |
int |
getBiomeTintWestint getBiomeTintWest() |
public |
String |
getBlockBreakingDecalIdString getBlockBreakingDecalId() |
public |
void |
getBlockCentervoid getBlockCenter(int var1, @Nonnull Vector3d var2) |
public |
Holder<ChunkStore> |
getBlockEntityHolder<ChunkStore> getBlockEntity() |
static |
int |
getBlockIdOrUnknownint getBlockIdOrUnknown(@Nonnull String var0, String var1, Object... var2) |
static |
int |
getBlockIdOrUnknownint getBlockIdOrUnknown(@Nonnull BlockTypeAssetMap<String, BlockType> var0, @Nonnull String var1, String var2, Object... var3) |
public |
String |
getBlockListAssetIdString getBlockListAssetId() |
public |
String |
getBlockParticleSetIdString getBlockParticleSetId() |
public |
String |
getBlockSoundSetIdString getBlockSoundSetId() |
public |
int |
getBlockSoundSetIndexint getBlockSoundSetIndex() |
public |
BlockSupportsRequiredForType |
getBlockSupportsRequiredForBlockSupportsRequiredForType getBlockSupportsRequiredFor() |
public |
String |
getCustomModelAnimationString getCustomModelAnimation() |
public |
float |
getCustomModelAnimationSpeedfloat getCustomModelAnimationSpeed() |
public |
float |
getCustomModelScalefloat getCustomModelScale() |
public |
int |
getDamageToEntitiesint getDamageToEntities() |
public |
AssetExtraInfo.Data |
getDataAssetExtraInfo.Data getData() |
public |
DrawType |
getDrawTypeDrawType getDrawType() |
public |
ShaderType[] |
getEffectShaderType[] getEffect() |
public |
FarmingData |
getFarmingFarmingData getFarming() |
public |
BlockFlags |
getFlagsBlockFlags getFlags() |
public |
BlockFlipType |
getFlipTypeBlockFlipType getFlipType() |
public |
String |
getGroupString getGroup() |
public |
String |
getHitboxTypeString getHitboxType() |
public |
int |
getHitboxTypeIndexint getHitboxTypeIndex() |
public |
String |
getIdString getId() |
public |
String |
getInteractionHintString getInteractionHint() |
public |
int |
getInteractionHitboxTypeIndexint getInteractionHitboxTypeIndex() |
public |
String |
getInteractionSoundEventIdString getInteractionSoundEventId() |
public |
int |
getInteractionSoundEventIndexint getInteractionSoundEventIndex() |
public |
Map<InteractionType, String> |
getInteractionsMap<InteractionType, String> getInteractions() |
public |
ColorLight |
getLightColorLight getLight() |
public |
BlockMaterial |
getMaterialBlockMaterial getMaterial() |
public |
int |
getMaxSupportDistanceint getMaxSupportDistance() |
public |
BlockMovementSettings |
getMovementSettingsBlockMovementSettings getMovementSettings() |
public |
Opacity |
getOpacityOpacity getOpacity() |
public |
Color |
getParticleColorColor getParticleColor() |
public |
ModelParticle[] |
getParticlesModelParticle[] getParticles() |
public |
BlockPlacementSettings |
getPlacementSettingsBlockPlacementSettings getPlacementSettings() |
public |
String |
getPrefabListAssetIdString getPrefabListAssetId() |
public |
RandomRotation |
getRandomRotationRandomRotation getRandomRotation() |
public |
RandomTickProcedure |
getRandomTickProcedureRandomTickProcedure getRandomTickProcedure() |
public |
Rotation |
getRotationYawPlacementOffsetRotation getRotationYawPlacementOffset() |
public |
StateData |
getStateStateData getState() |
public |
SupportDropType |
getSupportDropTypeSupportDropType getSupportDropType() |
public |
Color |
getTextureComputedColorColor getTextureComputedColor() |
public |
String |
getTextureSideMaskString getTextureSideMask() |
public |
BlockTypeTextures[] |
getTexturesBlockTypeTextures[] getTextures() |
public |
TickProcedure |
getTickProcedureTickProcedure getTickProcedure() |
public |
Color[] |
getTintDownColor[] getTintDown() |
public |
Color[] |
getTintEastColor[] getTintEast() |
public |
Color[] |
getTintNorthColor[] getTintNorth() |
public |
Color[] |
getTintSouthColor[] getTintSouth() |
public |
Color[] |
getTintUpColor[] getTintUp() |
public |
Color[] |
getTintWestColor[] getTintWest() |
public |
String |
getTransitionTextureString getTransitionTexture() |
public |
String[] |
getTransitionToGroupsString[] getTransitionToGroups() |
public |
boolean |
hasSupportboolean hasSupport() |
public |
boolean |
hasUniformTexturesboolean hasUniformTextures() |
|
|
if if(ASSET_STORE == null) |
|
|
if if(var0 != 0 && var0 != 1) |
|
|
if if(var1 == null) |
|
|
if if(var1 != null) |
|
|
if if(var4 != null) |
|
|
if if(this.group != null) |
|
|
if if(this.support != null) |
|
|
if if(this.supporting != null) |
|
|
if if(this.effect != null && this.effect.length > 0) |
|
|
if if(this.textures != null && this.textures.length > 0) |
|
|
if if(this.customModelTexture != null && this.customModelTexture.length > 0) |
|
|
if if(this.customModel != null) |
|
|
if if(this.customModelAnimation != null) |
|
|
if if(this.tintUp != null && this.tintUp.length > 0) |
|
|
if if(this.tintDown != null && this.tintDown.length > 0) |
|
|
if if(this.tintNorth != null && this.tintNorth.length > 0) |
|
|
if if(this.tintSouth != null && this.tintSouth.length > 0) |
|
|
if if(this.tintWest != null && this.tintWest.length > 0) |
|
|
if if(this.tintEast != null && this.tintEast.length > 0) |
|
|
if if(this.transitionTexture != null) |
|
|
if if(this.transitionToGroups != null && this.transitionToGroups.length > 0) |
|
|
if if(this.transitionToTag != null) |
|
|
if if(this.gathering != null) |
|
|
if if(this.placementSettings != null) |
|
|
if if(this.conditionalSounds != null && this.conditionalSounds.length > 0) |
|
|
if if(this.particles != null && this.particles.length > 0) |
|
|
if if(this.state != null) |
|
|
if if(var25 != null) |
|
|
if if(this.data != null) |
|
|
if if(var26 != null) |
|
|
if if(this.bench != null) |
|
|
if if(this.connectedBlockRuleSet != null) |
|
|
if if(this.data == null) |
|
|
if if(this.data == null) |
|
|
if if(this.defaultStateKey == null) |
|
|
if if(this.uniformTextures == null) |
|
|
if if(this.drawType != DrawType.Cube && this.drawType != DrawType.CubeWithModel && this.drawType != DrawType.GizmoCube) |
|
|
if if(this.textures != null && this.textures.length != 0) |
|
|
if if(this.support != null && var1 != 0) |
|
|
if if(this.rotatedSupport == null) |
|
|
if if(var2 == null) |
|
|
if if(this.supporting != null && var1 != 0) |
|
|
if if(this.rotatedSupporting == null) |
|
|
if if(var2 == null) |
|
|
if if(this.railConfig != null && var1 != 0) |
|
|
if if(this.rotatedRailConfig == null) |
|
|
if if(var2 == null) |
|
|
if if(this.interactionHint == null) |
|
|
if if(this.bench != null || this.isDoor) |
|
|
if if(this.ambientSoundEventId != null) |
|
|
if if(this.interactionSoundEventId != null) |
|
|
if if(this.hitboxTypeIndex == Integer.MIN_VALUE) |
|
|
if if(this.interactionHitboxType != null) |
|
|
if if(this.interactionHitboxTypeIndex == Integer.MIN_VALUE) |
|
|
if if(this.blockSoundSetIndex == Integer.MIN_VALUE) |
|
|
if if(this.physicalMaterialIndex == Integer.MIN_VALUE) |
|
|
if if(var4 != null) |
|
|
if if(var3 == null) |
|
|
if if(var4 == Integer.MIN_VALUE) |
|
|
if if(var5 == Integer.MIN_VALUE) |
public |
boolean |
isAllowsMultipleUsersboolean isAllowsMultipleUsers() |
public |
boolean |
isCubeDrawTypeboolean isCubeDrawType() |
public |
boolean |
isFullySupportiveboolean isFullySupportive() |
public |
boolean |
isLoopingboolean isLooping() |
public |
boolean |
isStateboolean isState() |
public |
boolean |
isTriggerboolean isTrigger() |
public |
boolean |
isUnknownboolean isUnknown() |
|
public int |
keySizepublic int keySize(int var1) |
|
public int |
keySizepublic int keySize(MemorySegment var1, int var2) |
protected |
void |
processConfigvoid processConfig() |
|
public int |
serializepublic int serialize(MemorySegment var1, int var2, int var3) |
public |
void |
setBlockEntityvoid setBlockEntity(@Nullable Holder<ChunkStore> var1) |
public |
boolean |
shouldIgnoreSupportWhenPlacedboolean shouldIgnoreSupportWhenPlaced() |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.asset.type.blocktype.config;
class="kw">import com.hypixel.hytale.assetstore.AssetExtraInfo;
class="kw">import com.hypixel.hytale.assetstore.AssetKeyValidator;
class="kw">import com.hypixel.hytale.assetstore.AssetRegistry;
class="kw">import com.hypixel.hytale.assetstore.AssetStore;
class="kw">import com.hypixel.hytale.assetstore.AssetUpdateQuery;
class="kw">import com.hypixel.hytale.assetstore.codec.AssetBuilderCodec;
class="kw">import com.hypixel.hytale.assetstore.map.BlockTypeAssetMap;
class="kw">import com.hypixel.hytale.assetstore.map.JsonAssetWithMap;
class="kw">import com.hypixel.hytale.codec.Codec;
class="kw">import com.hypixel.hytale.codec.KeyedCodec;
class="kw">import com.hypixel.hytale.codec.codecs.EnumCodec;
class="kw">import com.hypixel.hytale.codec.codecs.array.ArrayCodec;
class="kw">import com.hypixel.hytale.codec.codecs.map.EnumMapCodec;
class="kw">import com.hypixel.hytale.codec.codecs.map.MergedEnumMapCodec;
class="kw">import com.hypixel.hytale.codec.schema.metadata.ui.UIDefaultCollapsedState;
class="kw">import com.hypixel.hytale.codec.schema.metadata.ui.UIEditor;
class="kw">import com.hypixel.hytale.codec.schema.metadata.ui.UIEditorSectionStart;
class="kw">import com.hypixel.hytale.codec.schema.metadata.ui.UIPropertyTitle;
class="kw">import com.hypixel.hytale.codec.schema.metadata.ui.UIRebuildCaches;
class="kw">import com.hypixel.hytale.codec.store.StoredCodec;
class="kw">import com.hypixel.hytale.codec.validation.ValidatorCache;
class="kw">import com.hypixel.hytale.codec.validation.Validators;
class="kw">import com.hypixel.hytale.common.util.ArrayUtil;
class="kw">import com.hypixel.hytale.component.Holder;
class="kw">import com.hypixel.hytale.logger.HytaleLogger;
class="kw">import com.hypixel.hytale.math.shape.Box;
class="kw">import com.hypixel.hytale.protocol.BlockMaterial;
class="kw">import com.hypixel.hytale.protocol.BlockNeighbor;
class="kw">import com.hypixel.hytale.protocol.BlockTextures;
class="kw">import com.hypixel.hytale.protocol.Color;
class="kw">import com.hypixel.hytale.protocol.ColorLight;
class="kw">import com.hypixel.hytale.protocol.DrawType;
class="kw">import com.hypixel.hytale.protocol.InteractionType;
class="kw">import com.hypixel.hytale.protocol.ModelTexture;
class="kw">import com.hypixel.hytale.protocol.Opacity;
class="kw">import com.hypixel.hytale.protocol.RailConfig;
class="kw">import com.hypixel.hytale.protocol.RailPoint;
class="kw">import com.hypixel.hytale.protocol.RandomRotation;
class="kw">import com.hypixel.hytale.protocol.ShaderType;
class="kw">import com.hypixel.hytale.protocol.ShadingMode;
class="kw">import com.hypixel.hytale.protocol.Tint;
class="kw">import com.hypixel.hytale.server.core.asset.common.CommonAssetValidator;
class="kw">import com.hypixel.hytale.server.core.asset.type.blockbreakingdecal.config.BlockBreakingDecal;
class="kw">import com.hypixel.hytale.server.core.asset.type.blockhitbox.BlockBoundingBoxes;
class="kw">import com.hypixel.hytale.server.core.asset.type.blockparticle.config.BlockParticleSet;
class="kw">import com.hypixel.hytale.server.core.asset.type.blocksound.config.BlockSoundSet;
class="kw">import com.hypixel.hytale.server.core.asset.type.blocktick.config.RandomTickProcedure;
class="kw">import com.hypixel.hytale.server.core.asset.type.blocktick.config.TickProcedure;
class="kw">import com.hypixel.hytale.server.core.asset.type.blocktype.config.bench.Bench;
class="kw">import com.hypixel.hytale.server.core.asset.type.blocktype.config.fallingblocks.FallingBlockSettings;
class="kw">import com.hypixel.hytale.server.core.asset.type.blocktype.config.farming.FarmingData;
class="kw">import com.hypixel.hytale.server.core.asset.type.blocktype.config.mountpoints.RotatedMountPointsArray;
class="kw">import com.hypixel.hytale.server.core.asset.type.buildertool.config.BlockTypeListAsset;
class="kw">import com.hypixel.hytale.server.core.asset.type.buildertool.config.PrefabListAsset;
class="kw">import com.hypixel.hytale.server.core.asset.type.item.config.Item;
class="kw">import com.hypixel.hytale.server.core.asset.type.model.config.ModelParticle;
class="kw">import com.hypixel.hytale.server.core.asset.type.physicalmaterial.config.PhysicalMaterial;
class="kw">import com.hypixel.hytale.server.core.asset.type.soundevent.config.SoundEvent;
class="kw">import com.hypixel.hytale.server.core.asset.type.soundevent.validator.SoundEventValidators;
class="kw">import com.hypixel.hytale.server.core.asset.util.ColorParseUtil;
class="kw">import com.hypixel.hytale.server.core.codec.ProtocolCodecs;
class="kw">import com.hypixel.hytale.server.core.entity.ExplosionConfig;
class="kw">import com.hypixel.hytale.server.core.io.NetworkSerializable;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.InteractionTypeUtils;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.RootInteraction;
class="kw">import com.hypixel.hytale.server.core.universe.world.chunk.section.palette.AbstractSectionPalette;
class="kw">import com.hypixel.hytale.server.core.universe.world.connectedblocks.ConnectedBlockRuleSet;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.ChunkStore;
class="kw">import com.hypixel.hytale.server.core.util.io.MemorySegmentUtil;
class="kw">import it.unimi.dsi.fastutil.ints.IntSet;
class="kw">import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
class="kw">import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
class="kw">import it.unimi.dsi.fastutil.objects.ObjectArrayList;
class="kw">import java.lang.foreign.MemorySegment;
class="kw">import java.lang.ref.SoftReference;
class="kw">import java.util.Arrays;
class="kw">import java.util.Collections;
class="kw">import java.util.EnumMap;
class="kw">import java.util.List;
class="kw">import java.util.Map;
class="kw">import java.util.Map.Entry;
class="kw">import java.util.logging.Level;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">import org.joml.Vector3d;
class="kw">import org.joml.Vector3f;
class="kw">public class BlockType class="kw">implements JsonAssetWithMap<String, BlockTypeAssetMap<String, BlockType>>, NetworkSerializable<com.hypixel.hytale.protocol.BlockType> {
class="kw">public class="kw">static class="kw">final float MAX_CUSTOM_MODEL_ANIMATION_SPEED = 100.0F;
class="kw">public class="kw">static class="kw">final AssetBuilderCodec<String, BlockType> CODEC = AssetBuilderCodec.<String, BlockType>builder(
BlockType.class,
BlockType::new,
Codec.STRING,
(var0x, var1) -> var0x.id = var1,
var0x -> var0x.id,
(var0x, var1) -> var0x.data = var1,
var0x -> var0x.data
)
.documentation("The definition for a block in the game. Can only be defined within an **Item** and not standalone.")
.<String>appendInherited(
new KeyedCodec<>("Group", Codec.STRING), (var0x, var1) -> var0x.group = var1, var0x -> var0x.group, (var0x, var1) -> var0x.group = var1.group
)
.documentation(
"Sets the group for this block. Used by **BlockSets**.\n\nA group of _\"@Tech\"_ will prevent physics from being automatically applied to the block."
)
.metadata(new UIEditor(new UIEditor.TextField("BlockGroups")))
.add()
.<String>appendInherited(
new KeyedCodec<>("BlockListAssetId", Codec.STRING),
(var0x, var1) -> var0x.blockListAssetId = var1,
var0x -> var0x.blockListAssetId,
(var0x, var1) -> var0x.blockListAssetId = var1.blockListAssetId
)
.addValidator(BlockTypeListAsset.VALIDATOR_CACHE.getValidator())
.documentation("The name of a BlockList asset, for use in builder tool brushes")
.add()
.<String>appendInherited(
new KeyedCodec<>("PrefabListAssetId", Codec.STRING),
(var0x, var1) -> var0x.prefabListAssetId = var1,
var0x -> var0x.prefabListAssetId,
(var0x, var1) -> var0x.prefabListAssetId = var1.prefabListAssetId
)
.addValidator(PrefabListAsset.VALIDATOR_CACHE.getValidator())
.documentation("The name of a PrefabList asset, for use in builder tool brushes")
.add()
.<DrawType>appendInherited(
new KeyedCodec<>("DrawType", new EnumCodec<>(DrawType.class)),
(var0x, var1) -> var0x.drawType = var1,
var0x -> var0x.drawType,
(var0x, var1) -> var0x.drawType = var1.drawType
)
.addValidator(Validators.nonNull())
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MODELS, UIRebuildCaches.ClientCache.BLOCK_TEXTURES, UIRebuildCaches.ClientCache.MODEL_TEXTURES))
.metadata(new UIEditorSectionStart("Rendering"))
.add()
.<BlockTypeTextures[]>appendInherited(
new KeyedCodec<>("Textures", new ArrayCodec<>(BlockTypeTextures.CODEC, BlockTypeTextures[]::new)),
(var0x, var1) -> var0x.textures = var1,
var0x -> var0x.textures,
(var0x, var1) -> var0x.textures = var1.textures
)
.metadata(new UIPropertyTitle("Block Textures"))
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MODELS, UIRebuildCaches.ClientCache.BLOCK_TEXTURES))
.add()
.<String>appendInherited(
new KeyedCodec<>("TextureSideMask", Codec.STRING),
(var0x, var1) -> var0x.textureSideMask = var1,
var0x -> var0x.textureSideMask,
(var0x, var1) -> var0x.textureSideMask = var1.textureSideMask
)
.addValidator(CommonAssetValidator.TEXTURE_ITEM)
.metadata(new UIPropertyTitle("Block Texture Side Mask"))
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MODELS, UIRebuildCaches.ClientCache.BLOCK_TEXTURES))
.add()
.<ShadingMode>appendInherited(
new KeyedCodec<>("CubeShadingMode", new EnumCodec<>(ShadingMode.class)),
(var0x, var1) -> var0x.cubeShadingMode = var1,
var0x -> var0x.cubeShadingMode,
(var0x, var1) -> var0x.cubeShadingMode = var1.cubeShadingMode
)
.addValidator(Validators.nonNull())
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MODELS))
.add()
.<CustomModelTexture[]>appendInherited(
new KeyedCodec<>("CustomModelTexture", new ArrayCodec<>(CustomModelTexture.CODEC, CustomModelTexture[]::new)),
(var0x, var1) -> var0x.customModelTexture = var1,
var0x -> var0x.customModelTexture,
(var0x, var1) -> var0x.customModelTexture = var1.customModelTexture
)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MODELS, UIRebuildCaches.ClientCache.BLOCK_TEXTURES))
.metadata(new UIPropertyTitle("Block Model Textures"))
.add()
.<String>appendInherited(
new KeyedCodec<>("CustomModel", Codec.STRING),
(var0x, var1) -> var0x.customModel = var1,
var0x -> var0x.customModel,
(var0x, var1) -> var0x.customModel = var1.customModel
)
.addValidator(CommonAssetValidator.MODEL_ITEM)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MODELS))
.metadata(new UIPropertyTitle("Block Model"))
.add()
.<String>appendInherited(
new KeyedCodec<>("BlockBreakingDecalId", Codec.STRING),
(var0x, var1) -> var0x.blockBreakingDecalId = var1,
var0x -> var0x.blockBreakingDecalId,
(var0x, var1) -> var0x.blockBreakingDecalId = var1.blockBreakingDecalId
)
.documentation("The block breaking decal defined here defines the decal asset that should be overlaid when this block is damaged")
.addValidator(BlockBreakingDecal.VALIDATOR_CACHE.getValidator())
.add()
.<BlockMaterial>appendInherited(
new KeyedCodec<>("Material", new EnumCodec<>(BlockMaterial.class)),
(var0x, var1) -> var0x.material = var1,
var0x -> var0x.material,
(var0x, var1) -> var0x.material = var1.material
)
.addValidator(Validators.nonNull())
.add()
.<Opacity>appendInherited(
new KeyedCodec<>("Opacity", new EnumCodec<>(Opacity.class)),
(var0x, var1) -> var0x.opacity = var1,
var0x -> var0x.opacity,
(var0x, var1) -> var0x.opacity = var1.opacity
)
.addValidator(Validators.nonNull())
.add()
.<Boolean>appendInherited(
new KeyedCodec<>("RequiresAlphaBlending", Codec.BOOLEAN),
(var0x, var1) -> var0x.requiresAlphaBlending = var1,
var0x -> var0x.requiresAlphaBlending,
(var0x, var1) -> var0x.requiresAlphaBlending = var1.requiresAlphaBlending
)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MODELS))
.add()
.<Float>appendInherited(
new KeyedCodec<>("CustomModelScale", Codec.FLOAT),
(var0x, var1) -> var0x.customModelScale = var1,
var0x -> var0x.customModelScale,
(var0x, var1) -> var0x.customModelScale = var1.customModelScale
)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MODELS))
.add()
.<String>appendInherited(
new KeyedCodec<>("CustomModelAnimation", Codec.STRING),
(var0x, var1) -> var0x.customModelAnimation = var1,
var0x -> var0x.customModelAnimation,
(var0x, var1) -> var0x.customModelAnimation = var1.customModelAnimation
)
.addValidator(CommonAssetValidator.ANIMATION_ITEM_BLOCK)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MODELS))
.metadata(new UIPropertyTitle("Block Model Animation"))
.add()
.<Float>appendInherited(
new KeyedCodec<>("CustomModelAnimationSpeed", Codec.FLOAT),
(var0x, var1) -> var0x.customModelAnimationSpeed = var1,
var0x -> var0x.customModelAnimationSpeed,
(var0x, var1) -> var0x.customModelAnimationSpeed = var1.customModelAnimationSpeed
)
.addValidator(Validators.greaterThanOrEqual(0.0F))
.addValidator(Validators.lessThan(100.0F))
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MODELS))
.metadata(new UIPropertyTitle("Block Model Animation Speed"))
.documentation("A multiplier for the playback speed of the block model animation. 1 is the authored speed.")
.add()
.<ColorLight>appendInherited(
new KeyedCodec<>("Light", ProtocolCodecs.COLOR_LIGHT),
(var0x, var1) -> var0x.light = var1,
var0x -> var0x.light,
(var0x, var1) -> var0x.light = var1.light
)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MODELS))
.metadata(new UIPropertyTitle("Block Light"))
.add()
.appendInherited(
new KeyedCodec<>("TickProcedure", TickProcedure.CODEC),
(var0x, var1) -> var0x.tickProcedure = var1,
var0x -> var0x.tickProcedure,
(var0x, var1) -> var0x.tickProcedure = var1.tickProcedure
)
.add()
.appendInherited(
new KeyedCodec<>("RandomTickProcedure", RandomTickProcedure.CODEC),
(var0x, var1) -> var0x.randomTickProcedure = var1,
var0x -> var0x.randomTickProcedure,
(var0x, var1) -> var0x.randomTickProcedure = var1.randomTickProcedure
)
.add()
.appendInherited(
new KeyedCodec<>("ConnectedBlockRuleSet", ConnectedBlockRuleSet.CODEC),
(var0x, var1) -> var0x.connectedBlockRuleSet = var1,
var0x -> var0x.connectedBlockRuleSet,
(var0x, var1) -> var0x.connectedBlockRuleSet = var1.connectedBlockRuleSet
)
.add()
.<ShaderType[]>appendInherited(
new KeyedCodec<>("Effect", new ArrayCodec<>(new EnumCodec<>(ShaderType.class), ShaderType[]::new)),
(var0x, var1) -> var0x.effect = var1,
var0x -> var0x.effect,
(var0x, var1) -> var0x.effect = var1.effect
)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MODELS))
.add()
.<String>appendInherited(
new KeyedCodec<>("TransitionTexture", Codec.STRING),
(var0x, var1) -> var0x.transitionTexture = var1,
var0x -> var0x.transitionTexture,
(var0x, var1) -> var0x.transitionTexture = var1.transitionTexture
)
.addValidator(CommonAssetValidator.TEXTURE_ITEM)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MODELS, UIRebuildCaches.ClientCache.BLOCK_TEXTURES))
.add()
.<String[]>appendInherited(
new KeyedCodec<>("TransitionToGroups", new ArrayCodec<>(Codec.STRING, String[]::new).metadata(new UIEditor(new UIEditor.TextField("BlockGroups")))),
(var0x, var1) -> var0x.transitionToGroups = var1,
var0x -> var0x.transitionToGroups,
(var0x, var1) -> var0x.transitionToGroups = var1.transitionToGroups
)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MODELS))
.add()
.<String>appendInherited(
new KeyedCodec<>("TransitionToTag", Codec.STRING),
(var0x, var1) -> var0x.transitionToTag = var1,
var0x -> var0x.transitionToTag,
(var0x, var1) -> var0x.transitionToTag = var1.transitionToTag
)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MODELS))
.add()
.<String>appendInherited(
new KeyedCodec<>("BlockParticleSetId", Codec.STRING),
(var0x, var1) -> var0x.blockParticleSetId = var1,
var0x -> var0x.blockParticleSetId,
(var0x, var1) -> var0x.blockParticleSetId = var1.blockParticleSetId
)
.documentation(
"The block particle set defined here defines which particles should be spawned when an entity interacts with this block (like when stepping on it for example"
)
.addValidator(BlockParticleSet.VALIDATOR_CACHE.getValidator())
.metadata(new UIEditorSectionStart("Particles"))
.add()
.appendInherited(
new KeyedCodec<>("ParticleColor", ProtocolCodecs.COLOR),
(var0x, var1) -> var0x.particleColor = var1,
var0x -> var0x.particleColor,
(var0x, var1) -> var0x.particleColor = var1.particleColor
)
.add()
.appendInherited(
new KeyedCodec<>("TextureComputedColor", ProtocolCodecs.COLOR),
(var0x, var1) -> var0x.textureComputedColor = var1,
var0x -> var0x.textureComputedColor,
(var0x, var1) -> var0x.textureComputedColor = var1.textureComputedColor
)
.add()
.<ModelParticle[]>appendInherited(
new KeyedCodec<>("Particles", ModelParticle.ARRAY_CODEC),
(var0x, var1) -> var0x.particles = var1,
var0x -> var0x.particles,
(var0x, var1) -> var0x.particles = var1.particles
)
.documentation("The particles defined here will be spawned on top of blocks of this type placed in the world.")
.metadata(new UIPropertyTitle("Block Particles"))
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MODELS))
.metadata(UIDefaultCollapsedState.UNCOLLAPSED)
.addValidator(Validators.nonNullArrayElements())
.add()
.<RandomRotation>appendInherited(
new KeyedCodec<>("RandomRotation", new EnumCodec<>(RandomRotation.class)),
(var0x, var1) -> var0x.randomRotation = var1,
var0x -> var0x.randomRotation,
(var0x, var1) -> var0x.randomRotation = var1.randomRotation
)
.metadata(new UIEditorSectionStart("Rotation"))
.addValidator(Validators.nonNull())
.add()
.<VariantRotation>appendInherited(
new KeyedCodec<>("VariantRotation", new EnumCodec<>(VariantRotation.class)),
(var0x, var1) -> var0x.variantRotation = var1,
var0x -> var0x.variantRotation,
(var0x, var1) -> var0x.variantRotation = var1.variantRotation
)
.addValidator(Validators.nonNull())
.add()
.appendInherited(
new KeyedCodec<>("FlipType", new EnumCodec<>(BlockFlipType.class)),
(var0x, var1) -> var0x.flipType = var1,
var0x -> var0x.flipType,
(var0x, var1) -> var0x.flipType = var1.flipType
)
.add()
.<Rotation>appendInherited(
new KeyedCodec<>("RotationYawPlacementOffset", new EnumCodec<>(Rotation.class)),
(var0x, var1) -> var0x.rotationYawPlacementOffset = var1,
var0x -> var0x.rotationYawPlacementOffset,
(var0x, var1) -> var0x.rotationYawPlacementOffset = var1.rotationYawPlacementOffset
)
.addValidator(Validators.nonNull())
.add()
.<RotatedMountPointsArray>appendInherited(
new KeyedCodec<>("Seats", RotatedMountPointsArray.CODEC),
(var0x, var1) -> var0x.seats = var1,
var0x -> var0x.seats,
(var0x, var1) -> var0x.seats = var1.seats
)
.metadata(new UIEditorSectionStart("Behaviour"))
.documentation("The details of the seats on this block.")
.add()
.<RotatedMountPointsArray>appendInherited(
new KeyedCodec<>("Beds", RotatedMountPointsArray.CODEC),
(var0x, var1) -> var0x.beds = var1,
var0x -> var0x.beds,
(var0x, var1) -> var0x.beds = var1.beds
)
.documentation("The details of the beds for this block.")
.add()
.<BlockMovementSettings>appendInherited(
new KeyedCodec<>("MovementSettings", BlockMovementSettings.CODEC),
(var0x, var1) -> var0x.movementSettings = var1,
var0x -> var0x.movementSettings,
(var0x, var1) -> var0x.movementSettings = var1.movementSettings
)
.addValidator(Validators.nonNull())
.add()
.appendInherited(
new KeyedCodec<>("Flags", BlockFlags.CODEC), (var0x, var1) -> var0x.flags = var1, var0x -> var0x.flags, (var0x, var1) -> var0x.flags = var1.flags
)
.add()
.appendInherited(
new KeyedCodec<>("Bench", Bench.CODEC), (var0x, var1) -> var0x.bench = var1, var0x -> var0x.bench, (var0x, var1) -> var0x.bench = var1.bench
)
.add()
.appendInherited(
new KeyedCodec<>("Gathering", BlockGathering.CODEC),
(var0x, var1) -> var0x.gathering = var1,
var0x -> var0x.gathering,
(var0x, var1) -> var0x.gathering = var1.gathering
)
.add()
.appendInherited(
new KeyedCodec<>("PlacementSettings", BlockPlacementSettings.CODEC),
(var0x, var1) -> var0x.placementSettings = var1,
var0x -> var0x.placementSettings,
(var0x, var1) -> var0x.placementSettings = var1.placementSettings
)
.add()
.appendInherited(
new KeyedCodec<>("Farming", FarmingData.CODEC),
(var0x, var1) -> var0x.farming = var1,
var0x -> var0x.farming,
(var0x, var1) -> var0x.farming = var1.farming
)
.add()
.<FallingBlockSettings>appendInherited(
new KeyedCodec<>("FallingBlockSettings", FallingBlockSettings.CODEC),
(var0x, var1) -> var0x.fallingBlockSettings = var1,
var0x -> var0x.fallingBlockSettings,
(var0x, var1) -> var0x.fallingBlockSettings = var1.fallingBlockSettings
)
.documentation("Settings for blocks that can become falling block entities.")
.add()
.appendInherited(
new KeyedCodec<>("IsDoor", Codec.BOOLEAN), (var0x, var1) -> var0x.isDoor = var1, var0x -> var0x.isDoor, (var0x, var1) -> var0x.isDoor = var1.isDoor
)
.add()
.appendInherited(
new KeyedCodec<>("AllowsMultipleUsers", Codec.BOOLEAN),
(var0x, var1) -> var0x.allowsMultipleUsers = var1,
var0x -> var0x.allowsMultipleUsers,
(var0x, var1) -> var0x.allowsMultipleUsers = var1.allowsMultipleUsers
)
.add()
.<String>appendInherited(
new KeyedCodec<>("HitboxType", Codec.STRING),
(var0x, var1) -> var0x.hitboxType = var1,
var0x -> var0x.hitboxType,
(var0x, var1) -> var0x.hitboxType = var1.hitboxType
)
.addValidator(BlockBoundingBoxes.VALIDATOR_CACHE.getValidator())
.add()
.<String>appendInherited(
new KeyedCodec<>("InteractionHitboxType", Codec.STRING),
(var0x, var1) -> var0x.interactionHitboxType = var1,
var0x -> var0x.interactionHitboxType,
(var0x, var1) -> var0x.interactionHitboxType = var1.interactionHitboxType
)
.addValidator(BlockBoundingBoxes.VALIDATOR_CACHE.getValidator())
.add()
.<String>appendInherited(
new KeyedCodec<>("InteractionHint", Codec.STRING),
(var0x, var1) -> var0x.interactionHint = var1,
var0x -> var0x.interactionHint,
(var0x, var1) -> var0x.interactionHint = var1.interactionHint
)
.documentation(
"This property allows to specify custom text that will be displayed underneath the crosshair when the player aims at this block. The value of this property should be a reference to a translation. *{key}* will be replaced with the interaction input binding."
)
.add()
.appendInherited(
new KeyedCodec<>("DamageToEntities", Codec.INTEGER),
(var0x, var1) -> var0x.damageToEntities = var1,
var0x -> var0x.damageToEntities,
(var0x, var1) -> var0x.damageToEntities = var1.damageToEntities
)
.add()
.<Map<InteractionType, String>>appendInherited(
new KeyedCodec<>("Interactions", new EnumMapCodec<>(InteractionType.class, RootInteraction.CHILD_ASSET_CODEC).allowNullValues()),
(var0x, var1) -> var0x.interactions = mergeInteractions(var0x.interactions, var1),
var0x -> var0x.interactions,
(var0x, var1) -> var0x.interactions = var1.interactions
)
.documentation(
"A null value removes the inherited interaction for that slot, so a block state can drop its parent's interaction entirely (e.g. a one-time class="kw">switch becoming inert once turned on)."
)
.addValidator(RootInteraction.VALIDATOR_CACHE.getMapValueValidator())
.metadata(new UIEditorSectionStart("Interactions"))
.add()
.<String>appendInherited(
new KeyedCodec<>("BlockSoundSetId", Codec.STRING),
(var0x, var1) -> var0x.blockSoundSetId = var1,
var0x -> var0x.blockSoundSetId,
(var0x, var1) -> var0x.blockSoundSetId = var1.blockSoundSetId
)
.documentation("Sets the **BlockSoundSet** that will be used for this block for various events e.g. placement, breaking")
.addValidator(BlockSoundSet.VALIDATOR_CACHE.getValidator())
.metadata(new UIEditorSectionStart("Sounds"))
.add()
.<String>appendInherited(
new KeyedCodec<>("PhysicalMaterialId", Codec.STRING),
(var0x, var1) -> var0x.physicalMaterialId = var1,
var0x -> var0x.physicalMaterialId,
(var0x, var1) -> var0x.physicalMaterialId = var1.physicalMaterialId
)
.documentation("Sets the PhysicalMaterial of the block. Currently used primarily for acoustic properties.")
.addValidator(PhysicalMaterial.VALIDATOR_CACHE.getValidator())
.add()
.<Float>appendInherited(
new KeyedCodec<>("SoundOcclusionOpacity", Codec.FLOAT),
(var0x, var1) -> var0x.soundOcclusionOpacity = var1,
var0x -> var0x.soundOcclusionOpacity,
(var0x, var1) -> var0x.soundOcclusionOpacity = var1.soundOcclusionOpacity
)
.documentation(
"Scales per-source audio occlusion attenuation for this block. Multiplied with PhysicalMaterial AttenuationPerBlock. Set to 0, the material applies no attenuation. Set to 1 it applies the full specified attenuation. Can be set to values higher than 1 to increase attenuation until no sound penetrates."
)
.add()
.<String>appendInherited(
new KeyedCodec<>("AmbientSoundEventId", Codec.STRING),
(var0x, var1) -> var0x.ambientSoundEventId = var1,
var0x -> var0x.ambientSoundEventId,
(var0x, var1) -> var0x.ambientSoundEventId = var1.ambientSoundEventId
)
.addValidator(SoundEvent.VALIDATOR_CACHE.getValidator())
.addValidator(SoundEventValidators.MONO)
.addValidator(SoundEventValidators.LOOPING)
.documentation("A looping ambient sound event that emits from this block when placed in the world or held in-hand.")
.add()
.<ConditionalBlockSound[]>appendInherited(
new KeyedCodec<>("ConditionalSounds", new ArrayCodec<>(ConditionalBlockSound.CODEC, ConditionalBlockSound[]::new)),
(var0x, var1) -> var0x.conditionalSounds = var1,
var0x -> var0x.conditionalSounds,
(var0x, var1) -> var0x.conditionalSounds = var1.conditionalSounds
)
.documentation(
"An array of conditional ambient sounds. Each entry references a looping sound event and an AmbienceFX whose conditions determine when the sound plays from this block."
)
.add()
.<String>appendInherited(
new KeyedCodec<>("InteractionSoundEventId", Codec.STRING),
(var0x, var1) -> var0x.interactionSoundEventId = var1,
var0x -> var0x.interactionSoundEventId,
(var0x, var1) -> var0x.interactionSoundEventId = var1.interactionSoundEventId
)
.addValidator(SoundEvent.VALIDATOR_CACHE.getValidator())
.addValidator(SoundEventValidators.MONO)
.addValidator(SoundEventValidators.ONESHOT)
.documentation("A oneshot sound event that plays upon interaction with this block.")
.add()
.<Boolean>appendInherited(
new KeyedCodec<>("Looping", Codec.BOOLEAN),
(var0x, var1) -> var0x.isLooping = var1,
var0x -> var0x.isLooping,
(var0x, var1) -> var0x.isLooping = var1.isLooping
)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MODELS))
.add()
.<SupportDropType>appendInherited(
new KeyedCodec<>("SupportDropType", SupportDropType.CODEC),
(var0x, var1) -> var0x.supportDropType = var1,
var0x -> var0x.supportDropType,
(var0x, var1) -> var0x.supportDropType = var1.supportDropType
)
.metadata(new UIEditorSectionStart("Support"))
.add()
.<Integer>appendInherited(
new KeyedCodec<>("MaxSupportDistance", Codec.INTEGER),
(var0x, var1) -> var0x.maxSupportDistance = var1,
var0x -> var0x.maxSupportDistance,
(var0x, var1) -> var0x.maxSupportDistance = var1.maxSupportDistance
)
.addValidator(Validators.range(0, 14))
.add()
.<BlockSupportsRequiredForType>appendInherited(
new KeyedCodec<>("SupportsRequiredFor", new EnumCodec<>(BlockSupportsRequiredForType.class)),
(var0x, var1) -> var0x.blockSupportsRequiredFor = var1,
var0x -> var0x.blockSupportsRequiredFor,
(var0x, var1) -> var0x.blockSupportsRequiredFor = var1.blockSupportsRequiredFor
)
.addValidator(Validators.nonNull())
.add()
.<Map<BlockFace, RequiredBlockFaceSupport[]>>appendInherited(
new KeyedCodec<>(
"Support",
new MergedEnumMapCodec<>(
BlockFace.class,
MergedBlockFaces.class,
MergedBlockFaces::getComponents,
ArrayUtil::combine,
new ArrayCodec<>(RequiredBlockFaceSupport.CODEC, RequiredBlockFaceSupport[]::new)
)
),
(var0x, var1) -> var0x.support = var1,
var0x -> var0x.support,
(var0x, var1) -> var0x.support = var1.support
)
.addValidator(RequiredBlockFaceSupportValidator.INSTANCE)
.documentation(
"A set of \"Required Support\" conditions. If met, the block won't fall off from block physics checks.\n*If this field is empty the block is automatically considered supported.*\n"
)
.add()
.appendInherited(
new KeyedCodec<>(
"Supporting",
new MergedEnumMapCodec<>(
BlockFace.class,
MergedBlockFaces.class,
MergedBlockFaces::getComponents,
ArrayUtil::combine,
new ArrayCodec<>(BlockFaceSupport.CODEC, BlockFaceSupport[]::new)
)
),
(var0x, var1) -> var0x.supporting = var1,
var0x -> var0x.supporting,
(var0x, var1) -> var0x.supporting = var1.supporting
)
.add()
.documentation("The counter-party to \"Support\". This block offers supporting faces which can match the face requirements of adjacent/nearby blocks.")
.<Boolean>appendInherited(
new KeyedCodec<>("IgnoreSupportWhenPlaced", Codec.BOOLEAN),
(var0x, var1) -> var0x.ignoreSupportWhenPlaced = var1,
var0x -> var0x.ignoreSupportWhenPlaced,
(var0x, var1) -> var0x.ignoreSupportWhenPlaced = var1.ignoreSupportWhenPlaced
)
.documentation("Whether when this block is placed by a player that the support requirements should be ignored.")
.add()
.<String[]>append(
new KeyedCodec<>("Aliases", new ArrayCodec<>(Codec.STRING, String[]::new)), (var0x, var1) -> var0x.aliases = var1, var0x -> var0x.aliases
)
.documentation("Specifies the alternatives names (aliases) for a block type for use in command matching")
.add()
.<Color[]>append(new KeyedCodec<>("Tint", ProtocolCodecs.COLOR_ARRAY), (var0x, var1) -> {
var0x.tintUp = var1;
var0x.tintDown = var1;
var0x.tintNorth = var1;
var0x.tintSouth = var1;
var0x.tintWest = var1;
var0x.tintEast = var1;
}, var0x -> null)
.metadata(new UIEditorSectionStart("Tint"))
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MAP_GEOMETRY))
.add()
.<Color[]>appendInherited(
new KeyedCodec<>("TintUp", ProtocolCodecs.COLOR_ARRAY),
(var0x, var1) -> var0x.tintUp = var1,
var0x -> var0x.tintUp,
(var0x, var1) -> var0x.tintUp = var1.tintUp
)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MAP_GEOMETRY))
.add()
.<Color[]>appendInherited(
new KeyedCodec<>("TintDown", ProtocolCodecs.COLOR_ARRAY),
(var0x, var1) -> var0x.tintDown = var1,
var0x -> var0x.tintDown,
(var0x, var1) -> var0x.tintDown = var1.tintDown
)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MAP_GEOMETRY))
.add()
.<Color[]>appendInherited(
new KeyedCodec<>("TintNorth", ProtocolCodecs.COLOR_ARRAY),
(var0x, var1) -> var0x.tintNorth = var1,
var0x -> var0x.tintNorth,
(var0x, var1) -> var0x.tintNorth = var1.tintNorth
)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MAP_GEOMETRY))
.add()
.<Color[]>appendInherited(
new KeyedCodec<>("TintSouth", ProtocolCodecs.COLOR_ARRAY),
(var0x, var1) -> var0x.tintSouth = var1,
var0x -> var0x.tintSouth,
(var0x, var1) -> var0x.tintSouth = var1.tintSouth
)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MAP_GEOMETRY))
.add()
.<Color[]>appendInherited(
new KeyedCodec<>("TintWest", ProtocolCodecs.COLOR_ARRAY),
(var0x, var1) -> var0x.tintWest = var1,
var0x -> var0x.tintWest,
(var0x, var1) -> var0x.tintWest = var1.tintWest
)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MAP_GEOMETRY))
.add()
.<Color[]>appendInherited(
new KeyedCodec<>("TintEast", ProtocolCodecs.COLOR_ARRAY),
(var0x, var1) -> var0x.tintEast = var1,
var0x -> var0x.tintEast,
(var0x, var1) -> var0x.tintEast = var1.tintEast
)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MAP_GEOMETRY))
.add()
.<Integer>append(new KeyedCodec<>("BiomeTint", Codec.INTEGER), (var0x, var1) -> {
var0x.biomeTintUp = var1;
var0x.biomeTintDown = var1;
var0x.biomeTintNorth = var1;
var0x.biomeTintSouth = var1;
var0x.biomeTintWest = var1;
var0x.biomeTintEast = var1;
}, var0x -> null)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MAP_GEOMETRY))
.add()
.<Integer>appendInherited(
new KeyedCodec<>("BiomeTintUp", Codec.INTEGER),
(var0x, var1) -> var0x.biomeTintUp = var1,
var0x -> var0x.biomeTintUp,
(var0x, var1) -> var0x.biomeTintUp = var1.biomeTintUp
)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MAP_GEOMETRY))
.add()
.<Integer>appendInherited(
new KeyedCodec<>("BiomeTintDown", Codec.INTEGER),
(var0x, var1) -> var0x.biomeTintDown = var1,
var0x -> var0x.biomeTintDown,
(var0x, var1) -> var0x.biomeTintDown = var1.biomeTintDown
)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MAP_GEOMETRY))
.add()
.<Integer>appendInherited(
new KeyedCodec<>("BiomeTintNorth", Codec.INTEGER),
(var0x, var1) -> var0x.biomeTintNorth = var1,
var0x -> var0x.biomeTintNorth,
(var0x, var1) -> var0x.biomeTintNorth = var1.biomeTintNorth
)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MAP_GEOMETRY))
.add()
.<Integer>appendInherited(
new KeyedCodec<>("BiomeTintSouth", Codec.INTEGER),
(var0x, var1) -> var0x.biomeTintSouth = var1,
var0x -> var0x.biomeTintSouth,
(var0x, var1) -> var0x.biomeTintSouth = var1.biomeTintSouth
)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MAP_GEOMETRY))
.add()
.<Integer>appendInherited(
new KeyedCodec<>("BiomeTintWest", Codec.INTEGER),
(var0x, var1) -> var0x.biomeTintWest = var1,
var0x -> var0x.biomeTintWest,
(var0x, var1) -> var0x.biomeTintWest = var1.biomeTintWest
)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MAP_GEOMETRY))
.add()
.<Integer>appendInherited(
new KeyedCodec<>("BiomeTintEast", Codec.INTEGER),
(var0x, var1) -> var0x.biomeTintEast = var1,
var0x -> var0x.biomeTintEast,
(var0x, var1) -> var0x.biomeTintEast = var1.biomeTintEast
)
.metadata(new UIRebuildCaches(UIRebuildCaches.ClientCache.MAP_GEOMETRY))
.add()
.<StateData>appendInherited(new KeyedCodec<>("State", StateData.CODEC), (var0x, var1) -> {
var1.copyFrom(var0x.state);
var0x.state = var1;
}, var0x -> var0x.state, (var0x, var1) -> var0x.state = var1.state)
.metadata(new UIEditorSectionStart("State"))
.metadata(UIDefaultCollapsedState.UNCOLLAPSED)
.add()
.<Holder<ChunkStore>>appendInherited(
new KeyedCodec<>("BlockEntity", new StoredCodec<>(ChunkStore.HOLDER_CODEC_KEY)),
(var0x, var1) -> var0x.blockEntity = var1,
var0x -> var0x.blockEntity,
(var0x, var1) -> var0x.blockEntity = var1.blockEntity
)
.metadata(new UIEditorSectionStart("Components"))
.metadata(UIDefaultCollapsedState.UNCOLLAPSED)
.add()
.appendInherited(
new KeyedCodec<>("Rail", ProtocolCodecs.RAIL_CONFIG_CODEC),
(var0x, var1) -> var0x.railConfig = var1,
var0x -> var0x.railConfig,
(var0x, var1) -> var0x.railConfig = var1.railConfig
)
.add()
.<ExplosionConfig>appendInherited(
new KeyedCodec<>("ExplosionConfig", ExplosionConfig.CODEC),
(var0x, var1) -> var0x.explosionConfig = var1,
var0x -> var0x.explosionConfig,
(var0x, var1) -> var0x.explosionConfig = var1.explosionConfig
)
.documentation("The explosion config associated with this block.")
.add()
.appendInherited(
new KeyedCodec<>("ExplosionReactionState", Codec.STRING),
(var0x, var1) -> var0x.explosionReactionState = var1,
var0x -> var0x.explosionReactionState,
(var0x, var1) -> var0x.explosionReactionState = var1.explosionReactionState
)
.add()
.afterDecode(BlockType::processConfig)
.build();
class="kw">public class="kw">static class="kw">final String[] EMPTY_ALIAS_LIST = new String[0];
class="kw">public class="kw">static class="kw">final ValidatorCache<String> VALIDATOR_CACHE = new ValidatorCache<>(new AssetKeyValidator<>(BlockType::getAssetStore));
class="kw">public class="kw">static class="kw">final String UNKNOWN_TEXTURE = "BlockTextures/Unknown.png";
class="kw">public class="kw">static class="kw">final ModelTexture[] UNKNOWN_CUSTOM_MODEL_TEXTURE = new ModelTexture[]{new ModelTexture("BlockTextures/Unknown.png", 1.0F)};
class="kw">public class="kw">static class="kw">final BlockTextures[] UNKNOWN_BLOCK_TEXTURES = new BlockTextures[]{
new BlockTextures(
"BlockTextures/Unknown.png",
"BlockTextures/Unknown.png",
"BlockTextures/Unknown.png",
"BlockTextures/Unknown.png",
"BlockTextures/Unknown.png",
"BlockTextures/Unknown.png",
1.0F
)
};
class="kw">public class="kw">static class="kw">final Map<BlockFace, RequiredBlockFaceSupport[]> REQUIRED_BOTTOM_FACE_SUPPORT = Map.of(
BlockFace.DOWN, new RequiredBlockFaceSupport[]{new RequiredBlockFaceSupport("Full")}
);
class="kw">public class="kw">static class="kw">final BlockFaceSupport[] BLOCK_FACE_SUPPORT_ALL_ARRAY = new BlockFaceSupport[]{BlockFaceSupport.ALL};
class="kw">public class="kw">static class="kw">final Map<BlockFace, BlockFaceSupport[]> ALL_SUPPORTING_FACES;
class="kw">public class="kw">static class="kw">final ShaderType[] DEFAULT_SHADER_EFFECTS;
class="kw">public class="kw">static class="kw">final BlockType DEFAULT_BLOCK_TYPE;
class="kw">public class="kw">static class="kw">final AbstractSectionPalette.KeyMemorySerializer KEY_MEMORY_SERIALIZER;
class="kw">public class="kw">static class="kw">final AbstractSectionPalette.KeyMemoryDeserializer KEY_MEMORY_DESERIALIZER;
class="kw">public class="kw">static class="kw">final String EMPTY_KEY = "Empty";
class="kw">public class="kw">static class="kw">final String UNKNOWN_KEY = "Unknown";
class="kw">public class="kw">static class="kw">final String DEBUG_CUBE_KEY = "Debug_Cube";
class="kw">public class="kw">static class="kw">final String DEBUG_MODEL_KEY = "Debug_Model";
class="kw">public class="kw">static class="kw">final int EMPTY_ID = 0;
class="kw">public class="kw">static class="kw">final BlockType EMPTY;
class="kw">public class="kw">static class="kw">final int UNKNOWN_ID = 1;
class="kw">public class="kw">static class="kw">final BlockType UNKNOWN;
class="kw">public class="kw">static class="kw">final int DEBUG_CUBE_ID = 2;
class="kw">public class="kw">static class="kw">final BlockType DEBUG_CUBE;
class="kw">public class="kw">static class="kw">final int DEBUG_MODEL_ID = 3;
class="kw">public class="kw">static class="kw">final BlockType DEBUG_MODEL;
class="kw">public class="kw">static class="kw">final String TECHNICAL_BLOCK_GROUP = "@Tech";
class="kw">private class="kw">static AssetStore<String, BlockType, BlockTypeAssetMap<String, BlockType>> ASSET_STORE;
class="kw">protected AssetExtraInfo.Data data;
class="kw">protected String id;
class="kw">protected boolean unknown;
class="kw">protected String group;
class="kw">protected String blockListAssetId;
class="kw">protected String prefabListAssetId;
class="kw">protected String blockSoundSetId = "EMPTY";
class="kw">protected class="kw">transient int blockSoundSetIndex = 0;
class="kw">protected String physicalMaterialId = "EMPTY";
class="kw">protected class="kw">transient int physicalMaterialIndex = 0;
class="kw">protected float soundOcclusionOpacity = 1.0F;
class="kw">protected ModelParticle[] particles;
class="kw">protected String blockParticleSetId;
class="kw">protected String blockBreakingDecalId;
class="kw">protected Color particleColor;
class="kw">protected Color textureComputedColor;
class="kw">protected TickProcedure tickProcedure;
class="kw">private RandomTickProcedure randomTickProcedure;
class="kw">protected ShaderType[] effect;
class="kw">protected BlockTypeTextures[] textures;
class="kw">protected String textureSideMask;
@Nonnull
class="kw">protected ShadingMode cubeShadingMode = ShadingMode.Standard;
@Nullable
class="kw">protected String customModel;
@Nullable
class="kw">protected CustomModelTexture[] customModelTexture;
class="kw">protected float customModelScale = 1.0F;
class="kw">protected String customModelAnimation;
class="kw">protected float customModelAnimationSpeed = 1.0F;
@Nonnull
class="kw">protected DrawType drawType = DrawType.Cube;
@Nonnull
class="kw">protected BlockMaterial material = BlockMaterial.Empty;
@Nonnull
class="kw">protected Opacity opacity = Opacity.Solid;
class="kw">protected boolean requiresAlphaBlending;
class="kw">private class="kw">volatile Boolean uniformTextures;
class="kw">protected Color[] tintUp;
class="kw">protected Color[] tintDown;
class="kw">protected Color[] tintNorth;
class="kw">protected Color[] tintSouth;
class="kw">protected Color[] tintWest;
class="kw">protected Color[] tintEast;
class="kw">protected int biomeTintUp;
class="kw">protected int biomeTintDown;
class="kw">protected int biomeTintNorth;
class="kw">protected int biomeTintSouth;
class="kw">protected int biomeTintWest;
class="kw">protected int biomeTintEast;
@Nonnull
class="kw">protected BlockSupportsRequiredForType blockSupportsRequiredFor = BlockSupportsRequiredForType.All;
@Nonnull
class="kw">protected RandomRotation randomRotation = RandomRotation.None;
@Nonnull
class="kw">protected VariantRotation variantRotation = VariantRotation.None;
class="kw">protected BlockFlipType flipType = BlockFlipType.SYMMETRIC;
@Nonnull
class="kw">protected Rotation rotationYawPlacementOffset = Rotation.None;
@Nullable
class="kw">protected RotatedMountPointsArray seats;
@Nullable
class="kw">protected RotatedMountPointsArray beds;
class="kw">protected String transitionTexture;
class="kw">protected String[] transitionToGroups;
class="kw">protected String transitionToTag;
class="kw">protected String hitboxType = "Full";
class="kw">protected class="kw">transient int hitboxTypeIndex = 0;
@Nullable
class="kw">protected String interactionHitboxType;
class="kw">protected class="kw">transient int interactionHitboxTypeIndex = Integer.MIN_VALUE;
class="kw">protected ColorLight light;
class="kw">protected BlockMovementSettings movementSettings = new BlockMovementSettings();
class="kw">protected BlockFlags flags = new BlockFlags();
class="kw">protected String interactionHint;
class="kw">protected boolean isTrigger;
@Deprecated
class="kw">protected boolean isDoor;
class="kw">protected int damageToEntities;
class="kw">protected boolean allowsMultipleUsers = true;
@Nullable
class="kw">protected ConnectedBlockRuleSet connectedBlockRuleSet;
class="kw">protected Bench bench;
@Nullable
class="kw">protected BlockGathering gathering;
class="kw">protected BlockPlacementSettings placementSettings;
class="kw">protected StateData state;
class="kw">protected String ambientSoundEventId;
class="kw">protected class="kw">transient int ambientSoundEventIndex;
class="kw">protected ConditionalBlockSound[] conditionalSounds;
class="kw">protected String interactionSoundEventId;
class="kw">protected class="kw">transient int interactionSoundEventIndex;
class="kw">protected boolean isLooping;
class="kw">protected Holder<ChunkStore> blockEntity;
class="kw">protected FarmingData farming;
@Nullable
class="kw">protected FallingBlockSettings fallingBlockSettings;
class="kw">protected SupportDropType supportDropType = SupportDropType.BREAK;
class="kw">protected int maxSupportDistance;
@Nullable
class="kw">protected Map<BlockFace, RequiredBlockFaceSupport[]> support;
@Nullable
class="kw">protected class="kw">transient Map<BlockFace, RequiredBlockFaceSupport[]>[] rotatedSupport;
@Nullable
class="kw">protected Map<BlockFace, BlockFaceSupport[]> supporting;
@Nullable
class="kw">protected class="kw">transient Map<BlockFace, BlockFaceSupport[]>[] rotatedSupporting;
class="kw">protected boolean ignoreSupportWhenPlaced;
class="kw">protected Map<InteractionType, String> interactions = Collections.emptyMap();
@Nullable
class="kw">protected RailConfig railConfig;
@Nullable
class="kw">protected RailConfig[] rotatedRailConfig;
@Nullable
class="kw">protected String explosionReactionState;
@Nullable
class="kw">protected ExplosionConfig explosionConfig;
class="kw">protected String[] aliases = EMPTY_ALIAS_LIST;
@Nullable
class="kw">private class="kw">transient String defaultStateKey;
@Nullable
class="kw">private class="kw">transient SoftReference<com.hypixel.hytale.protocol.BlockType> cachedPacket;
@Nullable
class="kw">public class="kw">static BlockType fromString(@Nonnull String var0) {
class="kw">return getAssetMap().getAsset(var0);
}
class="kw">public class="kw">static AssetStore<String, BlockType, BlockTypeAssetMap<String, BlockType>> getAssetStore() {
if (ASSET_STORE == null) {
ASSET_STORE = AssetRegistry.getAssetStore(BlockType.class);
}
class="kw">return ASSET_STORE;
}
class="kw">public class="kw">static BlockTypeAssetMap<String, BlockType> getAssetMap() {
class="kw">return (BlockTypeAssetMap<String, BlockType>)getAssetStore().getAssetMap();
}
class="kw">public class="kw">static boolean blocksLineOfSight(int var0) {
if (var0 != 0 && var0 != 1) {
BlockType var1 = getAssetMap().getAsset(var0);
if (var1 == null) {
class="kw">return false;
}
BlockGathering var2 = var1.getGathering();
class="kw">return var2 == null || !var2.isSoft();
} else {
class="kw">return false;
}
}
class="kw">public BlockType() {
}
class="kw">public BlockType(String var1) {
this.id = var1;
}
class="kw">public BlockType(@Nonnull BlockType var1) {
this.data = var1.data;
this.id = var1.id;
this.unknown = var1.unknown;
this.group = var1.group;
this.blockSoundSetId = var1.blockSoundSetId;
this.blockSoundSetIndex = var1.blockSoundSetIndex;
this.physicalMaterialId = var1.physicalMaterialId;
this.physicalMaterialIndex = var1.physicalMaterialIndex;
this.soundOcclusionOpacity = var1.soundOcclusionOpacity;
this.particles = var1.particles;
this.blockParticleSetId = var1.blockParticleSetId;
this.blockBreakingDecalId = var1.blockBreakingDecalId;
this.particleColor = var1.particleColor;
this.textureComputedColor = var1.textureComputedColor;
this.tickProcedure = var1.tickProcedure;
this.randomTickProcedure = var1.randomTickProcedure;
this.effect = var1.effect;
this.textures = var1.textures;
this.textureSideMask = var1.textureSideMask;
this.customModelTexture = var1.customModelTexture;
this.drawType = var1.drawType;
this.material = var1.material;
this.opacity = var1.opacity;
this.requiresAlphaBlending = var1.requiresAlphaBlending;
this.customModel = var1.customModel;
this.customModelScale = var1.customModelScale;
this.customModelAnimation = var1.customModelAnimation;
this.customModelAnimationSpeed = var1.customModelAnimationSpeed;
this.tintUp = var1.tintUp;
this.tintDown = var1.tintDown;
this.tintNorth = var1.tintNorth;
this.tintSouth = var1.tintSouth;
this.tintWest = var1.tintWest;
this.tintEast = var1.tintEast;
this.biomeTintUp = var1.biomeTintUp;
this.biomeTintDown = var1.biomeTintDown;
this.biomeTintNorth = var1.biomeTintNorth;
this.biomeTintSouth = var1.biomeTintSouth;
this.biomeTintWest = var1.biomeTintWest;
this.biomeTintEast = var1.biomeTintEast;
this.randomRotation = var1.randomRotation;
this.variantRotation = var1.variantRotation;
this.flipType = var1.flipType;
this.rotationYawPlacementOffset = var1.rotationYawPlacementOffset;
this.seats = var1.seats;
this.beds = var1.beds;
this.transitionTexture = var1.transitionTexture;
this.transitionToGroups = var1.transitionToGroups;
this.transitionToTag = var1.transitionToTag;
this.hitboxType = var1.hitboxType;
this.hitboxTypeIndex = var1.hitboxTypeIndex;
this.interactionHitboxType = var1.interactionHitboxType;
this.interactionHitboxTypeIndex = var1.interactionHitboxTypeIndex;
this.light = var1.light;
this.movementSettings = var1.movementSettings;
this.flags = var1.flags;
this.interactionHint = var1.interactionHint;
this.isTrigger = var1.isTrigger;
this.damageToEntities = var1.damageToEntities;
this.bench = var1.bench;
this.gathering = var1.gathering;
this.placementSettings = var1.placementSettings;
this.state = var1.state;
this.blockEntity = var1.blockEntity;
this.farming = var1.farming;
this.fallingBlockSettings = var1.fallingBlockSettings;
this.supportDropType = var1.supportDropType;
this.maxSupportDistance = var1.maxSupportDistance;
this.support = var1.support;
this.supporting = var1.supporting;
this.cubeShadingMode = var1.cubeShadingMode;
this.allowsMultipleUsers = var1.allowsMultipleUsers;
this.interactions = var1.interactions;
this.ambientSoundEventId = var1.ambientSoundEventId;
this.ambientSoundEventIndex = var1.ambientSoundEventIndex;
this.conditionalSounds = var1.conditionalSounds;
this.interactionSoundEventId = var1.interactionSoundEventId;
this.interactionSoundEventIndex = var1.interactionSoundEventIndex;
this.isLooping = var1.isLooping;
this.isDoor = var1.isDoor;
this.blockSupportsRequiredFor = var1.blockSupportsRequiredFor;
this.connectedBlockRuleSet = var1.connectedBlockRuleSet;
this.railConfig = var1.railConfig;
this.ignoreSupportWhenPlaced = var1.ignoreSupportWhenPlaced;
this.explosionReactionState = var1.explosionReactionState;
this.explosionConfig = var1.explosionConfig;
}
@Nonnull
class="kw">public com.hypixel.hytale.protocol.BlockType toPacket() {
com.hypixel.hytale.protocol.BlockType var1 = this.cachedPacket == null ? null : this.cachedPacket.get();
if (var1 != null) {
class="kw">return var1;
}
BlockTypeAssetMap var2 = getAssetMap();
com.hypixel.hytale.protocol.BlockType var3 = new com.hypixel.hytale.protocol.BlockType();
var3.name = this.id;
Item var4 = this.getItem();
if (var4 != null) {
var3.item = var4.getId();
}
var3.unknown = this.unknown;
if (this.group != null) {
var3.group = getAssetMap().getGroupId(this.group);
}
var3.blockSoundSetIndex = this.blockSoundSetIndex;
var3.physicalMaterialIndex = this.physicalMaterialIndex;
var3.soundOcclusionOpacity = this.soundOcclusionOpacity;
var3.blockParticleSetId = this.blockParticleSetId;
var3.blockBreakingDecalId = this.blockBreakingDecalId;
var3.particleColor = this.particleColor;
var3.textureComputedColor = this.textureComputedColor;
if (this.support != null) {
Object2ObjectOpenHashMap var5 = new Object2ObjectOpenHashMap();
for (Entry var7 : this.support.entrySet()) {
RequiredBlockFaceSupport[] var8 = var7.getValue();
com.hypixel.hytale.protocol.RequiredBlockFaceSupport[] var9 = new com.hypixel.hytale.protocol.RequiredBlockFaceSupport[var8.length];
for (int var10 = 0; var10 < var8.length; var10++) {
var9[var10] = var8[var10].toPacket();
}
var5.put(var7.getKey().toProtocolBlockNeighbor(), var9);
}
var3.support = var5;
}
if (this.supporting != null) {
Object2ObjectOpenHashMap var11 = new Object2ObjectOpenHashMap();
for (Entry var27 : this.supporting.entrySet()) {
BlockFaceSupport[] var33 = var27.getValue();
com.hypixel.hytale.protocol.BlockFaceSupport[] var36 = new com.hypixel.hytale.protocol.BlockFaceSupport[var33.length];
for (int var39 = 0; var39 < var33.length; var39++) {
var36[var39] = var33[var39].toPacket();
}
var11.put(var27.getKey().toProtocolBlockNeighbor(), var36);
}
var3.supporting = var11;
}
var3.blockSupportsRequiredFor = class="kw">switch (this.blockSupportsRequiredFor) {
case Any -> com.hypixel.hytale.protocol.BlockSupportsRequiredForType.Any;
case All -> com.hypixel.hytale.protocol.BlockSupportsRequiredForType.All;
};
var3.maxSupportDistance = this.maxSupportDistance;
if (this.effect != null && this.effect.length > 0) {
var3.shaderEffect = this.effect;
} else {
var3.shaderEffect = DEFAULT_SHADER_EFFECTS;
}
if (this.textures != null && this.textures.length > 0) {
float var12 = 0.0F;
for (BlockTypeTextures var37 : this.textures) {
var12 += var37.getWeight();
}
BlockTextures[] var20 = new BlockTextures[this.textures.length];
for (int var29 = 0; var29 < this.textures.length; var29++) {
var20[var29] = this.textures[var29].toPacket(var12);
}
var3.cubeTextures = var20;
} else {
var3.cubeTextures = UNKNOWN_BLOCK_TEXTURES;
}
var3.cubeSideMaskTexture = this.textureSideMask;
var3.cubeShadingMode = this.cubeShadingMode;
if (this.customModelTexture != null && this.customModelTexture.length > 0) {
int var13 = 0;
for (CustomModelTexture var38 : this.customModelTexture) {
var13 += var38.getWeight();
}
ModelTexture[] var22 = new ModelTexture[this.customModelTexture.length];
for (int var31 = 0; var31 < this.customModelTexture.length; var31++) {
var22[var31] = this.customModelTexture[var31].toPacket(var13);
}
var3.modelTexture = var22;
} else {
var3.modelTexture = UNKNOWN_CUSTOM_MODEL_TEXTURE;
}
var3.drawType = this.drawType;
var3.requiresAlphaBlending = this.requiresAlphaBlending;
if (this.customModel != null) {
var3.model = this.customModel;
}
var3.modelScale = this.customModelScale;
if (this.customModelAnimation != null) {
var3.modelAnimation = this.customModelAnimation;
}
var3.modelAnimationSpeed = this.customModelAnimationSpeed;
var3.tint = new Tint();
if (this.tintUp != null && this.tintUp.length > 0) {
var3.tint.top = ColorParseUtil.colorToARGBInt(this.tintUp[0]);
} else {
var3.tint.top = -1;
}
if (this.tintDown != null && this.tintDown.length > 0) {
var3.tint.bottom = ColorParseUtil.colorToARGBInt(this.tintDown[0]);
} else {
var3.tint.bottom = -1;
}
if (this.tintNorth != null && this.tintNorth.length > 0) {
var3.tint.back = ColorParseUtil.colorToARGBInt(this.tintNorth[0]);
} else {
var3.tint.back = -1;
}
if (this.tintSouth != null && this.tintSouth.length > 0) {
var3.tint.front = ColorParseUtil.colorToARGBInt(this.tintSouth[0]);
} else {
var3.tint.front = -1;
}
if (this.tintWest != null && this.tintWest.length > 0) {
var3.tint.left = ColorParseUtil.colorToARGBInt(this.tintWest[0]);
} else {
var3.tint.left = -1;
}
if (this.tintEast != null && this.tintEast.length > 0) {
var3.tint.right = ColorParseUtil.colorToARGBInt(this.tintEast[0]);
} else {
var3.tint.right = -1;
}
var3.biomeTint = new Tint(this.biomeTintUp, this.biomeTintDown, this.biomeTintSouth, this.biomeTintNorth, this.biomeTintWest, this.biomeTintEast);
var3.variantRotation = this.variantRotation.toPacket();
var3.randomRotation = this.randomRotation;
var3.rotationYawPlacementOffset = this.rotationYawPlacementOffset.toPacket();
var3.opacity = this.opacity;
if (this.transitionTexture != null) {
var3.transitionTexture = this.transitionTexture;
}
if (this.transitionToGroups != null && this.transitionToGroups.length > 0) {
int[] var14 = new int[this.transitionToGroups.length];
for (int var23 = 0; var23 < this.transitionToGroups.length; var23++) {
var14[var23] = var2.getGroupId(this.transitionToGroups[var23]);
}
var3.transitionToGroups = var14;
}
if (this.transitionToTag != null) {
var3.transitionToTag = AssetRegistry.getOrCreateTagIndex(this.transitionToTag);
} else {
var3.transitionToTag = Integer.MIN_VALUE;
}
var3.material = this.material;
var3.hitbox = this.hitboxTypeIndex;
var3.interactionHitbox = this.interactionHitboxTypeIndex;
var3.light = this.light;
var3.movementSettings = this.movementSettings.toPacket();
var3.interactionHint = this.interactionHint;
if (this.gathering != null) {
var3.gathering = this.gathering.toPacket();
}
if (this.placementSettings != null) {
var3.placementSettings = this.placementSettings.toPacket();
}
var3.looping = this.isLooping;
var3.ambientSoundEventIndex = this.ambientSoundEventIndex;
if (this.conditionalSounds != null && this.conditionalSounds.length > 0) {
var3.conditionalSounds = new com.hypixel.hytale.protocol.ConditionalBlockSound[this.conditionalSounds.length];
for (int var15 = 0; var15 < this.conditionalSounds.length; var15++) {
var3.conditionalSounds[var15] = this.conditionalSounds[var15].toPacket();
}
}
if (this.particles != null && this.particles.length > 0) {
var3.particles = new com.hypixel.hytale.protocol.ModelParticle[this.particles.length];
for (int var16 = 0; var16 < this.particles.length; var16++) {
var3.particles[var16] = this.particles[var16].toPacket();
}
}
Object2IntOpenHashMap var17 = new Object2IntOpenHashMap();
for (Entry var32 : this.interactions.entrySet()) {
var17.put(var32.getKey(), RootInteraction.getRootInteractionIdOrUnknown(var32.getValue()));
}
var3.interactions = var17;
if (this.state != null) {
var3.states = this.state.toPacket(this);
String var25 = this.getBlockKeyForState("class="kw">default");
if (var25 != null) {
var3.states.put("class="kw">default", getAssetMap().getIndex(var25));
}
}
if (this.data != null) {
IntSet var26 = this.data.getExpandedTagIndexes();
if (var26 != null) {
var3.tagIndexes = var26.toIntArray();
}
}
var3.rail = this.railConfig;
var3.ignoreSupportWhenPlaced = this.ignoreSupportWhenPlaced;
if (this.bench != null) {
var3.bench = this.bench.toPacket();
}
if (this.connectedBlockRuleSet != null) {
var3.connectedBlockRuleSet = this.connectedBlockRuleSet.toPacket(var2);
}
this.cachedPacket = new SoftReference<>(var3);
class="kw">return var3;
}
class="kw">public String getId() {
class="kw">return this.id;
}
class="kw">public AssetExtraInfo.Data getData() {
class="kw">return this.data;
}
@Nullable
class="kw">public Item getItem() {
if (this.data == null) {
class="kw">return null;
}
String var1 = this.data.getContainerKey(Item.class);
class="kw">return var1 == null ? null : Item.getAssetMap().getAsset(var1);
}
class="kw">public boolean isState() {
class="kw">return this.getStateForBlock(this.id) != null;
}
@Nullable
class="kw">public BlockType getBlockForState(@Nonnull String var1) {
String var2 = this.getBlockKeyForState(var1);
class="kw">return var2 == null ? null : getAssetMap().getAsset(var2);
}
@Nullable
class="kw">public String getBlockKeyForState(@Nonnull String var1) {
String var2;
if (var1.equals("class="kw">default")) {
var2 = this.getDefaultStateKey();
} else {
var2 = this.state != null ? this.state.getBlockForState(var1) : null;
}
class="kw">return var2;
}
@Nullable
class="kw">public String getDefaultStateKey() {
if (this.data == null) {
class="kw">return null;
}
if (this.defaultStateKey == null) {
this.defaultStateKey = this.data.getContainerKey(BlockType.class);
}
class="kw">return this.defaultStateKey;
}
@Nullable
class="kw">public String getStateForBlock(@Nonnull BlockType var1) {
class="kw">return this.getStateForBlock(var1.getId());
}
@Nullable
class="kw">public String getStateForBlock(@Nonnull String var1) {
class="kw">return this.state != null ? this.state.getStateForBlock(var1) : null;
}
@Nullable
class="kw">public String getCurrentInteractionState() {
class="kw">return this.state != null ? this.getStateForBlock(this) : null;
}
class="kw">public boolean isUnknown() {
class="kw">return this.unknown;
}
class="kw">public String getGroup() {
class="kw">return this.group;
}
class="kw">public String getBlockSoundSetId() {
class="kw">return this.blockSoundSetId;
}
class="kw">public int getBlockSoundSetIndex() {
class="kw">return this.blockSoundSetIndex;
}
class="kw">public ModelParticle[] getParticles() {
class="kw">return this.particles;
}
class="kw">public String getBlockParticleSetId() {
class="kw">return this.blockParticleSetId;
}
class="kw">public String getBlockBreakingDecalId() {
class="kw">return this.blockBreakingDecalId;
}
class="kw">public Color getParticleColor() {
class="kw">return this.particleColor;
}
class="kw">public Color getTextureComputedColor() {
class="kw">return this.textureComputedColor;
}
class="kw">public TickProcedure getTickProcedure() {
class="kw">return this.tickProcedure;
}
class="kw">public RandomTickProcedure getRandomTickProcedure() {
class="kw">return this.randomTickProcedure;
}
class="kw">public ShaderType[] getEffect() {
class="kw">return this.effect;
}
class="kw">public BlockTypeTextures[] getTextures() {
class="kw">return this.textures;
}
class="kw">public boolean hasUniformTextures() {
if (this.uniformTextures == null) {
this.uniformTextures = this.computeHasUniformTextures();
}
class="kw">return this.uniformTextures;
}
class="kw">private boolean computeHasUniformTextures() {
if (this.drawType != DrawType.Cube && this.drawType != DrawType.CubeWithModel && this.drawType != DrawType.GizmoCube) {
class="kw">return false;
}
if (this.textures != null && this.textures.length != 0) {
for (BlockTypeTextures var4 : this.textures) {
if (!var4.isUniform()) {
class="kw">return false;
}
}
class="kw">return true;
} else {
class="kw">return false;
}
}
class="kw">public String getTextureSideMask() {
class="kw">return this.textureSideMask;
}
@Nullable
class="kw">public CustomModelTexture[] getCustomModelTexture() {
class="kw">return this.customModelTexture;
}
class="kw">public DrawType getDrawType() {
class="kw">return this.drawType;
}
class="kw">public boolean isCubeDrawType() {
class="kw">return this.drawType == DrawType.Cube || this.drawType == DrawType.CubeWithModel || this.drawType == DrawType.GizmoCube;
}
class="kw">public BlockMaterial getMaterial() {
class="kw">return this.material;
}
class="kw">public Opacity getOpacity() {
class="kw">return this.opacity;
}
@Nullable
class="kw">public String getCustomModel() {
class="kw">return this.customModel;
}
class="kw">public float getCustomModelScale() {
class="kw">return this.customModelScale;
}
class="kw">public String getCustomModelAnimation() {
class="kw">return this.customModelAnimation;
}
class="kw">public float getCustomModelAnimationSpeed() {
class="kw">return this.customModelAnimationSpeed;
}
class="kw">public Color[] getTintUp() {
class="kw">return this.tintUp;
}
class="kw">public Color[] getTintDown() {
class="kw">return this.tintDown;
}
class="kw">public Color[] getTintNorth() {
class="kw">return this.tintNorth;
}
class="kw">public Color[] getTintSouth() {
class="kw">return this.tintSouth;
}
class="kw">public Color[] getTintWest() {
class="kw">return this.tintWest;
}
class="kw">public Color[] getTintEast() {
class="kw">return this.tintEast;
}
class="kw">public int getBiomeTintUp() {
class="kw">return this.biomeTintUp;
}
class="kw">public int getBiomeTintDown() {
class="kw">return this.biomeTintDown;
}
class="kw">public int getBiomeTintNorth() {
class="kw">return this.biomeTintNorth;
}
class="kw">public int getBiomeTintSouth() {
class="kw">return this.biomeTintSouth;
}
class="kw">public int getBiomeTintWest() {
class="kw">return this.biomeTintWest;
}
class="kw">public int getBiomeTintEast() {
class="kw">return this.biomeTintEast;
}
@Nullable
class="kw">public ConnectedBlockRuleSet getConnectedBlockRuleSet() {
class="kw">return this.connectedBlockRuleSet;
}
class="kw">public BlockSupportsRequiredForType getBlockSupportsRequiredFor() {
class="kw">return this.blockSupportsRequiredFor;
}
class="kw">public RandomRotation getRandomRotation() {
class="kw">return this.randomRotation;
}
@Nonnull
class="kw">public VariantRotation getVariantRotation() {
class="kw">return this.variantRotation;
}
class="kw">public BlockFlipType getFlipType() {
class="kw">return this.flipType;
}
class="kw">public Rotation getRotationYawPlacementOffset() {
class="kw">return this.rotationYawPlacementOffset;
}
@Nullable
class="kw">public RotatedMountPointsArray getSeats() {
class="kw">return this.seats;
}
@Nullable
class="kw">public RotatedMountPointsArray getBeds() {
class="kw">return this.beds;
}
class="kw">public String getTransitionTexture() {
class="kw">return this.transitionTexture;
}
class="kw">public String[] getTransitionToGroups() {
class="kw">return this.transitionToGroups;
}
class="kw">public String getBlockListAssetId() {
class="kw">return this.blockListAssetId;
}
class="kw">public String getPrefabListAssetId() {
class="kw">return this.prefabListAssetId;
}
class="kw">public String getHitboxType() {
class="kw">return this.hitboxType;
}
class="kw">public int getHitboxTypeIndex() {
class="kw">return this.hitboxTypeIndex;
}
@Nullable
class="kw">public String getInteractionHitboxType() {
class="kw">return this.interactionHitboxType;
}
class="kw">public int getInteractionHitboxTypeIndex() {
class="kw">return this.interactionHitboxTypeIndex;
}
class="kw">public ColorLight getLight() {
class="kw">return this.light;
}
class="kw">public BlockMovementSettings getMovementSettings() {
class="kw">return this.movementSettings;
}
class="kw">public BlockFlags getFlags() {
class="kw">return this.flags;
}
class="kw">public String getInteractionHint() {
class="kw">return this.interactionHint;
}
class="kw">public boolean isTrigger() {
class="kw">return this.isTrigger;
}
class="kw">public int getDamageToEntities() {
class="kw">return this.damageToEntities;
}
class="kw">public Bench getBench() {
class="kw">return this.bench;
}
@Nullable
class="kw">public BlockGathering getGathering() {
class="kw">return this.gathering;
}
class="kw">public BlockPlacementSettings getPlacementSettings() {
class="kw">return this.placementSettings;
}
class="kw">public StateData getState() {
class="kw">return this.state;
}
class="kw">public Holder<ChunkStore> getBlockEntity() {
class="kw">return this.blockEntity;
}
class="kw">public void setBlockEntity(@Nullable Holder<ChunkStore> var1) {
this.blockEntity = var1;
}
class="kw">public String getAmbientSoundEventId() {
class="kw">return this.ambientSoundEventId;
}
class="kw">public int getAmbientSoundEventIndex() {
class="kw">return this.ambientSoundEventIndex;
}
class="kw">public String getInteractionSoundEventId() {
class="kw">return this.interactionSoundEventId;
}
class="kw">public int getInteractionSoundEventIndex() {
class="kw">return this.interactionSoundEventIndex;
}
class="kw">public boolean isLooping() {
class="kw">return this.isLooping;
}
class="kw">public FarmingData getFarming() {
class="kw">return this.farming;
}
@Nullable
class="kw">public FallingBlockSettings getFallingBlockSettings() {
class="kw">return this.fallingBlockSettings;
}
class="kw">public SupportDropType getSupportDropType() {
class="kw">return this.supportDropType;
}
class="kw">public int getMaxSupportDistance() {
class="kw">return this.maxSupportDistance;
}
class="kw">public boolean isFullySupportive() {
class="kw">return this.supporting == ALL_SUPPORTING_FACES;
}
@Nullable
class="kw">public Map<BlockFace, RequiredBlockFaceSupport[]> getSupport(int var1) {
if (this.support != null && var1 != 0) {
if (this.rotatedSupport == null) {
this.rotatedSupport = new Map[RotationTuple.VALUES.length];
}
Map var2 = this.rotatedSupport[var1];
if (var2 == null) {
RotationTuple var3 = RotationTuple.get(var1);
Map var4 = new EnumMap<>(BlockFace.class);
for (Entry var6 : this.support.entrySet()) {
BlockFace var7 = var6.getKey();
RequiredBlockFaceSupport[] var8 = var6.getValue();
BlockFace var9 = BlockFace.rotate(var7, var3.yaw(), var3.pitch(), var3.roll());
for (RequiredBlockFaceSupport var13 : var8) {
if (var13.isRotated()) {
RequiredBlockFaceSupport var14 = RequiredBlockFaceSupport.rotate(var13, var3.yaw(), var3.pitch(), var3.roll());
var4.computeIfAbsent(var9, var0 -> new ObjectArrayList()).add(var14);
} else {
var4.computeIfAbsent(var7, var0 -> new ObjectArrayList()).add(var13);
}
}
}
var2 = new EnumMap<>(BlockFace.class);
for (Entry var16 : var4.entrySet()) {
var2.put(var16.getKey(), var16.getValue().toArray(RequiredBlockFaceSupport[]::new));
}
this.rotatedSupport[var1] = var2;
}
class="kw">return var2;
} else {
class="kw">return this.support;
}
}
@Nullable
class="kw">public Map<BlockFace, BlockFaceSupport[]> getSupporting(int var1) {
if (this.supporting != null && var1 != 0) {
if (this.rotatedSupporting == null) {
this.rotatedSupporting = new Map[RotationTuple.VALUES.length];
}
Map var2 = this.rotatedSupporting[var1];
if (var2 == null) {
RotationTuple var3 = RotationTuple.get(var1);
if (this.isFullySupportive()) {
var2 = ALL_SUPPORTING_FACES;
} else {
Map var4 = new EnumMap<>(BlockFace.class);
for (Entry var6 : this.supporting.entrySet()) {
BlockFace var7 = var6.getKey();
BlockFaceSupport[] var8 = var6.getValue();
BlockFace var9 = BlockFace.rotate(var7, var3.yaw(), var3.pitch(), var3.roll());
for (BlockFaceSupport var13 : var8) {
BlockFaceSupport var14 = BlockFaceSupport.rotate(var13, var3.yaw(), var3.pitch(), var3.roll());
var4.computeIfAbsent(var9, var0 -> new ObjectArrayList()).add(var14);
}
}
var2 = new EnumMap<>(BlockFace.class);
for (Entry var16 : var4.entrySet()) {
var2.put(var16.getKey(), var16.getValue().toArray(BlockFaceSupport[]::new));
}
}
this.rotatedSupporting[var1] = var2;
}
class="kw">return var2;
} else {
class="kw">return this.supporting;
}
}
class="kw">public boolean hasSupport() {
class="kw">return this.support != null && !this.support.isEmpty() || this.maxSupportDistance > 0;
}
class="kw">public boolean isAllowsMultipleUsers() {
class="kw">return this.allowsMultipleUsers;
}
class="kw">public Map<InteractionType, String> getInteractions() {
class="kw">return this.interactions;
}
@Nullable
class="kw">public RailConfig getRailConfig(int var1) {
if (this.railConfig != null && var1 != 0) {
if (this.rotatedRailConfig == null) {
this.rotatedRailConfig = new RailConfig[RotationTuple.VALUES.length];
}
RailConfig var2 = this.rotatedRailConfig[var1];
if (var2 == null) {
RotationTuple var3 = RotationTuple.get(var1);
var2 = this.railConfig.clone();
for (RailPoint var7 : var2.points) {
Vector3f var8 = new Vector3f(var7.point.x() - 0.5F, var7.point.y() - 0.5F, var7.point.z() - 0.5F);
var8 = Rotation.rotate(var8, var3.yaw(), var3.pitch(), var3.roll());
var7.point = new Vector3f(var8.x + 0.5F, var8.y + 0.5F, var8.z + 0.5F);
var7.normal = Rotation.rotate(var7.normal, var3.yaw(), var3.pitch(), var3.roll());
}
this.rotatedRailConfig[var1] = var2;
}
class="kw">return var2;
} else {
class="kw">return this.railConfig;
}
}
@Nullable
class="kw">public ExplosionConfig getExplosionConfig() {
class="kw">return this.explosionConfig;
}
@Deprecated
class="kw">public boolean isDoor() {
class="kw">return this.isDoor;
}
class="kw">public boolean shouldIgnoreSupportWhenPlaced() {
class="kw">return this.ignoreSupportWhenPlaced;
}
class="kw">public boolean canBePlacedAsDeco() {
class="kw">return this.ignoreSupportWhenPlaced || this.gathering != null && this.gathering.shouldUseDefaultDropWhenPlaced();
}
class="kw">protected void processConfig() {
if (this.interactionHint == null) {
if (this.bench != null || this.isDoor) {
this.interactionHint = "server.interactionHints.open";
} else if (this.gathering != null && this.gathering.isHarvestable()) {
this.interactionHint = "server.interactionHints.gather";
} else if (this.seats != null && this.seats.size() > 0) {
this.interactionHint = "server.interactionHints.sit";
} else {
this.interactionHint = "server.interactionHints.generic";
}
}
if (this.ambientSoundEventId != null) {
this.ambientSoundEventIndex = SoundEvent.getAssetMap().getIndex(this.ambientSoundEventId);
}
if (this.interactionSoundEventId != null) {
this.interactionSoundEventIndex = SoundEvent.getAssetMap().getIndex(this.interactionSoundEventId);
}
if (this.support == null && this.material == BlockMaterial.Empty && !"@Tech".equals(this.group)) {
this.support = REQUIRED_BOTTOM_FACE_SUPPORT;
}
if (this.supporting == null
&& (this.drawType == DrawType.Cube || this.drawType == DrawType.CubeWithModel || this.drawType == DrawType.GizmoCube)
&& this.material == BlockMaterial.Solid) {
this.supporting = ALL_SUPPORTING_FACES;
} else if (this.supporting == null) {
this.supporting = Collections.emptyMap();
}
this.hitboxTypeIndex = this.hitboxType.equals("Full") ? 0 : BlockBoundingBoxes.getAssetMap().getIndex(this.hitboxType);
if (this.hitboxTypeIndex == Integer.MIN_VALUE) {
HytaleLogger.getLogger().at(Level.WARNING).log("Unknown hitbox '%s' for block '%s', using class="kw">default", this.hitboxType, this.getId());
this.hitboxTypeIndex = 0;
}
if (this.interactionHitboxType != null) {
this.interactionHitboxTypeIndex = this.interactionHitboxType.equals("Full")
? 0
: BlockBoundingBoxes.getAssetMap().getIndex(this.interactionHitboxType);
if (this.interactionHitboxTypeIndex == Integer.MIN_VALUE) {
HytaleLogger.getLogger()
.at(Level.WARNING)
.log("Unknown interaction hitbox '%s' for block '%s', using collision hitbox", this.interactionHitboxType, this.getId());
this.interactionHitboxTypeIndex = this.hitboxTypeIndex;
}
}
this.blockSoundSetIndex = this.blockSoundSetId.equals("EMPTY") ? 0 : BlockSoundSet.getAssetMap().getIndex(this.blockSoundSetId);
if (this.blockSoundSetIndex == Integer.MIN_VALUE) {
HytaleLogger.getLogger().at(Level.WARNING).log("Unknown block sound set '%s' for block '%s', using empty", this.blockSoundSetId, this.getId());
this.blockSoundSetIndex = 0;
}
this.physicalMaterialIndex = this.physicalMaterialId.equals("EMPTY") ? 0 : PhysicalMaterial.getAssetMap().getIndex(this.physicalMaterialId);
if (this.physicalMaterialIndex == Integer.MIN_VALUE) {
HytaleLogger.getLogger().at(Level.WARNING).log("Unknown physical material '%s' for block '%s', using empty", this.physicalMaterialId, this.getId());
this.physicalMaterialIndex = 0;
}
for (InteractionType var2 : this.interactions.keySet()) {
if (InteractionTypeUtils.isCollisionType(var2)) {
this.isTrigger = true;
break;
}
}
if (this.bench != null && !this.interactions.containsKey(InteractionType.Use)) {
Map var3 = this.interactions.isEmpty() ? new EnumMap<>(InteractionType.class) : new EnumMap<>(this.interactions);
RootInteraction var4 = this.bench.getRootInteraction();
if (var4 != null) {
var3.put(InteractionType.Use, var4.getId());
}
this.interactions = Collections.unmodifiableMap(var3);
}
}
@Nonnull
class="kw">private class="kw">static Map<InteractionType, String> mergeInteractions(@Nonnull Map<InteractionType, String> var0, @Nonnull Map<InteractionType, String> var1) {
Map var2 = new EnumMap<>(InteractionType.class);
var2.putAll(var0);
for (Entry var4 : var1.entrySet()) {
if (var4.getValue() == null) {
var2.remove(var4.getKey());
} else {
var2.put(var4.getKey(), var4.getValue());
}
}
class="kw">return Collections.unmodifiableMap(var2);
}
@Nonnull
class="kw">public class="kw">static BlockType getUnknownFor(String var0) {
class="kw">return UNKNOWN.clone(var0);
}
class="kw">public void getBlockCenter(int var1, @Nonnull Vector3d var2) {
BlockBoundingBoxes var3 = BlockBoundingBoxes.getAssetMap().getAsset(this.hitboxTypeIndex);
if (var3 == null) {
throw new IllegalStateException("Unknown hitbox: " + this.hitboxType);
}
BlockBoundingBoxes.RotatedVariantBoxes var4 = var3.get(var1);
Box var5 = var4.getBoundingBox();
var2.set(var5.middleX(), var5.middleY(), var5.middleZ());
}
@Nullable
class="kw">public String getExplosionReactionState() {
class="kw">return this.explosionReactionState;
}
@Nonnull
@Override
class="kw">public String toString() {
class="kw">return "BlockType{id="
+ this.id
+ ", unknown="
+ this.unknown
+ ", group='"
+ this.group
+ "', blockSoundSetId='"
+ this.blockSoundSetId
+ "', blockSoundSetIndex="
+ this.blockSoundSetIndex
+ ", particles="
+ Arrays.toString(this.particles)
+ ", blockParticleSetId='"
+ this.blockParticleSetId
+ "', blockBreakingDecalId='"
+ this.blockBreakingDecalId
+ "', particleColor="
+ this.particleColor
+ ", textureComputedColor="
+ this.textureComputedColor
+ ", effect="
+ Arrays.toString(this.effect)
+ ", textures="
+ Arrays.toString(this.textures)
+ ", textureSideMask='"
+ this.textureSideMask
+ "', cubeShadingMode="
+ this.cubeShadingMode
+ ", customModel='"
+ this.customModel
+ "', customModelTexture="
+ Arrays.toString(this.customModelTexture)
+ ", customModelScale="
+ this.customModelScale
+ ", customModelAnimation='"
+ this.customModelAnimation
+ "', customModelAnimationSpeed="
+ this.customModelAnimationSpeed
+ ", drawType="
+ this.drawType
+ ", material="
+ this.material
+ ", opacity="
+ this.opacity
+ ", requiresAlphaBlending="
+ this.requiresAlphaBlending
+ ", tickProcedure"
+ this.tickProcedure
+ ", tintUp="
+ Arrays.toString(this.tintUp)
+ ", tintDown="
+ Arrays.toString(this.tintDown)
+ ", tintNorth="
+ Arrays.toString(this.tintNorth)
+ ", tintSouth="
+ Arrays.toString(this.tintSouth)
+ ", tintWest="
+ Arrays.toString(this.tintWest)
+ ", tintEast="
+ Arrays.toString(this.tintEast)
+ ", biomeTintUp="
+ this.biomeTintUp
+ ", biomeTintDown="
+ this.biomeTintDown
+ ", biomeTintNorth="
+ this.biomeTintNorth
+ ", biomeTintSouth="
+ this.biomeTintSouth
+ ", biomeTintWest="
+ this.biomeTintWest
+ ", biomeTintEast="
+ this.biomeTintEast
+ ", randomRotation="
+ this.randomRotation
+ ", variantRotation="
+ this.variantRotation
+ ", flipType="
+ this.flipType
+ ", rotationYawPlacementOffset="
+ this.rotationYawPlacementOffset
+ ", transitionTexture='"
+ this.transitionTexture
+ "', transitionToGroups="
+ Arrays.toString(this.transitionToGroups)
+ ", hitboxType='"
+ this.hitboxType
+ "', hitboxTypeIndex="
+ this.hitboxTypeIndex
+ ", interactionHitboxType='"
+ this.interactionHitboxType
+ "', interactionHitboxTypeIndex="
+ this.interactionHitboxTypeIndex
+ ", light="
+ this.light
+ ", movementSettings="
+ this.movementSettings
+ ", flags="
+ this.flags
+ ", interactionHint='"
+ this.interactionHint
+ "', isTrigger="
+ this.isTrigger
+ ", damageToEntities="
+ this.damageToEntities
+ ", allowsMultipleUsers="
+ this.allowsMultipleUsers
+ ", bench="
+ this.bench
+ ", gathering="
+ this.gathering
+ ", placementSettings="
+ this.placementSettings
+ ", state="
+ this.state
+ ", ambientSoundEventId='"
+ this.ambientSoundEventId
+ "', ambientSoundEventIndex="
+ this.ambientSoundEventIndex
+ ", conditionalSounds="
+ Arrays.toString(this.conditionalSounds)
+ ", interactionSoundEventId='"
+ this.interactionSoundEventId
+ "', interactionSoundEventIndex="
+ this.interactionSoundEventIndex
+ ", isLooping="
+ this.isLooping
+ ", farming="
+ this.farming
+ ", fallingBlockSettings="
+ this.fallingBlockSettings
+ ", supportDropType="
+ this.supportDropType
+ ", maxSupportDistance="
+ this.maxSupportDistance
+ ", support="
+ this.support
+ ", supporting="
+ this.supporting
+ ", interactions="
+ this.interactions
+ ", railConfig="
+ this.railConfig
+ ", explosionReactionState="
+ this.explosionReactionState
+ "}";
}
@Nonnull
class="kw">public BlockType clone(String var1) {
if (this.id != null && this.id.equals(var1)) {
class="kw">return this;
}
BlockType var2 = new BlockType(this);
var2.id = var1;
var2.cachedPacket = null;
class="kw">return var2;
}
class="kw">public class="kw">static int getBlockIdOrUnknown(@Nonnull String var0, String var1, Object... var2) {
class="kw">return getBlockIdOrUnknown(getAssetMap(), var0, var1, var2);
}
class="kw">public class="kw">static int getBlockIdOrUnknown(@Nonnull BlockTypeAssetMap<String, BlockType> var0, @Nonnull String var1, String var2, Object... var3) {
int var4 = var0.getIndex(var1);
if (var4 == Integer.MIN_VALUE) {
HytaleLogger.getLogger().at(Level.WARNING).logVarargs(var2, var3);
AssetRegistry.getAssetStore(BlockType.class)
.loadAssets("Hytale:Hytale", Collections.singletonList(getUnknownFor(var1)), AssetUpdateQuery.DEFAULT_NO_REBUILD);
int var5 = var0.getIndex(var1);
if (var5 == Integer.MIN_VALUE) {
throw new IllegalArgumentException("Unknown key! " + var1);
}
var4 = var5;
}
class="kw">return var4;
}
class="kw">static {
StateData.addDefinitions();
EnumMap var0 = new EnumMap<>(BlockFace.class);
for (BlockFace var4 : BlockFace.VALUES) {
var0.put(var4, BLOCK_FACE_SUPPORT_ALL_ARRAY);
}
ALL_SUPPORTING_FACES = Collections.unmodifiableMap(var0);
DEFAULT_SHADER_EFFECTS = new ShaderType[]{ShaderType.None};
DEFAULT_BLOCK_TYPE = new BlockType();
KEY_MEMORY_SERIALIZER = new AbstractSectionPalette.KeyMemorySerializer() {
@Override
class="kw">public int serialize(MemorySegment var1, int var2, int var3) {
String var4 = BlockType.getAssetMap().getAssetOrDefault(var3, BlockType.UNKNOWN).getId();
class="kw">return MemorySegmentUtil.writeUTF(var1, var2, var4);
}
@Override
class="kw">public int keySize(int var1) {
String var2 = BlockType.getAssetMap().getAssetOrDefault(var1, BlockType.UNKNOWN).getId();
class="kw">return MemorySegmentUtil.utf8Size(var2);
}
};
KEY_MEMORY_DESERIALIZER = new AbstractSectionPalette.KeyMemoryDeserializer() {
@Override
class="kw">public int deserialize(MemorySegment var1, int var2) {
String var3 = MemorySegmentUtil.readUTF(var1, var2);
class="kw">return BlockType.getBlockIdOrUnknown(var3, "Failed to find block '%s' in chunk section!", var3);
}
@Override
class="kw">public int keySize(MemorySegment var1, int var2) {
class="kw">return MemorySegmentUtil.utf8Size(var1, var2);
}
};
EMPTY = new BlockType("Empty") {
{
this.drawType = DrawType.Empty;
this.material = BlockMaterial.Empty;
this.opacity = Opacity.Transparent;
this.group = "Air";
this.support = Collections.emptyMap();
this.processConfig();
}
};
UNKNOWN = new BlockType("Unknown") {
{
this.unknown = true;
this.drawType = DrawType.Cube;
this.material = BlockMaterial.Solid;
this.processConfig();
}
};
DEBUG_CUBE = new BlockType("Debug_Cube") {
{
this.drawType = DrawType.Cube;
this.material = BlockMaterial.Solid;
this.variantRotation = VariantRotation.Debug;
this.textures = new BlockTypeTextures[]{
new BlockTypeTextures(
"BlockTextures/_Debug/Up.png",
"BlockTextures/_Debug/Down.png",
"BlockTextures/_Debug/North.png",
"BlockTextures/_Debug/South.png",
"BlockTextures/_Debug/East.png",
"BlockTextures/_Debug/West.png",
1
)
};
this.processConfig();
}
};
DEBUG_MODEL = new BlockType("Debug_Model") {
{
this.drawType = DrawType.Model;
this.material = BlockMaterial.Empty;
this.variantRotation = VariantRotation.Debug;
this.customModel = "Blocks/_Debug/Model.blockymodel";
this.customModelTexture = new CustomModelTexture[]{new CustomModelTexture("Blocks/_Debug/Texture.png", 1)};
this.processConfig();
}
};
}
}