StaticRotatorProp class
Пакет: com.hypixel.hytale.builtin.hytalegenerator.props
Файл: com/hypixel/hytale/builtin/hytalegenerator/props/StaticRotatorProp.java
extends: Prop
Поля (1)
| Модификаторы | Тип | Имя |
|---|---|---|
|
boolean |
var2 |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.builtin.hytalegenerator.props;
class="kw">import com.hypixel.hytale.builtin.hytalegenerator.bounds.Bounds3i;
class="kw">import com.hypixel.hytale.builtin.hytalegenerator.engine.entityfunnel.EntityFunnel;
class="kw">import com.hypixel.hytale.builtin.hytalegenerator.engine.entityfunnel.RotationEntityFunnel;
class="kw">import com.hypixel.hytale.builtin.hytalegenerator.material.MaterialCache;
class="kw">import com.hypixel.hytale.builtin.hytalegenerator.voxelspace.NullSpace;
class="kw">import com.hypixel.hytale.builtin.hytalegenerator.voxelspace.RotationVoxelSpace;
class="kw">import com.hypixel.hytale.math.vector.Vector3iUtil;
class="kw">import com.hypixel.hytale.server.core.asset.type.blocktype.config.RotationTuple;
class="kw">import javax.annotation.Nonnull;
class="kw">public class StaticRotatorProp class="kw">extends Prop {
@Nonnull
class="kw">private class="kw">final Prop prop;
@Nonnull
class="kw">private class="kw">final RotationVoxelSpace readRotationVoxelSpace;
@Nonnull
class="kw">private class="kw">final RotationVoxelSpace writeRotationVoxelSpace;
@Nonnull
class="kw">private class="kw">final RotationEntityFunnel rotationEntityFunnel;
@Nonnull
class="kw">private class="kw">final Bounds3i readBounds;
@Nonnull
class="kw">private class="kw">final Bounds3i writeBounds;
@Nonnull
class="kw">private class="kw">final Prop.Context rChildContext;
class="kw">public StaticRotatorProp(@Nonnull Prop var1, @Nonnull RotationTuple var2, @Nonnull MaterialCache var3) {
this.prop = var1;
this.readRotationVoxelSpace = new RotationVoxelSpace(var2, var3);
this.writeRotationVoxelSpace = new RotationVoxelSpace(var2, var3);
this.rotationEntityFunnel = new RotationEntityFunnel(var2);
this.readBounds = var1.getReadBounds_voxelGrid().clone();
this.writeBounds = var1.getWriteBounds_voxelGrid().clone();
this.readBounds.applyRotationAroundVoxel(var2, Vector3iUtil.ZERO);
this.writeBounds.applyRotationAroundVoxel(var2, Vector3iUtil.ZERO);
this.rChildContext = new Prop.Context();
}
@Override
class="kw">public boolean generate(@Nonnull Prop.Context var1) {
this.readRotationVoxelSpace.setSource(var1.materialReadSpace, var1.position);
this.writeRotationVoxelSpace.setSource(var1.materialWriteSpace, var1.position);
this.rotationEntityFunnel.setSource(var1.entityWriteBuffer, var1.position);
this.rChildContext.assign(var1);
this.rChildContext.materialReadSpace = this.readRotationVoxelSpace;
this.rChildContext.materialWriteSpace = this.writeRotationVoxelSpace;
this.rChildContext.entityWriteBuffer = this.rotationEntityFunnel;
boolean var2 = this.prop.generate(this.rChildContext);
this.rChildContext.clearReferences();
this.readRotationVoxelSpace.setSource(NullSpace.instance(), Vector3iUtil.ZERO);
this.writeRotationVoxelSpace.setSource(NullSpace.instance(), Vector3iUtil.ZERO);
this.rotationEntityFunnel.setSource(EntityFunnel.NULL, Vector3iUtil.ZERO);
class="kw">return var2;
}
@Nonnull
@Override
class="kw">public Bounds3i getReadBounds_voxelGrid() {
class="kw">return this.readBounds;
}
@Nonnull
@Override
class="kw">public Bounds3i getWriteBounds_voxelGrid() {
class="kw">return this.writeBounds;
}
}