CylinderBreakShape class
Пакет: com.hypixel.hytale.server.core.modules.interaction.breakshape
Файл: com/hypixel/hytale/server/core/modules/interaction/breakshape/CylinderBreakShape.java
extends: BreakShape
Поля (11)
| Модификаторы | Тип | Имя |
|---|---|---|
|
com.hypixel.hytale.protocol.CylinderBreakShape |
var1 |
|
double |
var10 |
|
double |
var12 |
|
double |
var17 |
|
double |
var19 |
|
int |
var2 |
|
int |
var3 |
|
int |
var4 |
|
int |
var5 |
|
double |
var6 |
|
double |
var8 |
Методы (5)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
|
|
for for(int var14 = 0; var14 < this.depth; var14++) |
|
|
for for(int var15 = var2; var15 <= var3; var15++) |
|
|
for for(int var16 = var4; var16 <= var5; var16++) |
|
|
if if(var17 * var17 + var19 * var19 <= 1.0) |
public |
com.hypixel.hytale.protocol.BreakShape |
toPacketcom.hypixel.hytale.protocol.BreakShape toPacket() |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.modules.interaction.breakshape;
class="kw">import com.hypixel.hytale.codec.builder.BuilderCodec;
class="kw">import com.hypixel.hytale.function.consumer.TriIntConsumer;
class="kw">import javax.annotation.Nonnull;
class="kw">public class CylinderBreakShape class="kw">extends BreakShape {
@Nonnull
class="kw">public class="kw">static class="kw">final BuilderCodec<CylinderBreakShape> CODEC = BuilderCodec.builder(CylinderBreakShape.class, CylinderBreakShape::new, BreakShape.BASE_CODEC)
.documentation("Breaks an elliptical disc of blocks in the user's view plane, extruded into the surface.")
.afterDecode(BreakShape::validateShape)
.build();
class="kw">public CylinderBreakShape() {
}
@Override
class="kw">public void forEachLocalOffset(@Nonnull TriIntConsumer var1) {
int var2 = lowBound(this.width, this.centered);
int var3 = var2 + this.width - 1;
int var4 = lowBound(this.height, this.centered);
int var5 = var4 + this.height - 1;
double var6 = this.width / 2.0;
double var8 = this.height / 2.0;
double var10 = (var2 + var3) / 2.0;
double var12 = (var4 + var5) / 2.0;
for (int var14 = 0; var14 < this.depth; var14++) {
for (int var15 = var2; var15 <= var3; var15++) {
for (int var16 = var4; var16 <= var5; var16++) {
double var17 = var6 > 0.0 ? (var15 - var10) / var6 : 0.0;
double var19 = var8 > 0.0 ? (var16 - var12) / var8 : 0.0;
if (var17 * var17 + var19 * var19 <= 1.0) {
var1.accept(var15, var16, var14);
}
}
}
}
}
class="kw">public com.hypixel.hytale.protocol.BreakShape toPacket() {
com.hypixel.hytale.protocol.CylinderBreakShape var1 = new com.hypixel.hytale.protocol.CylinderBreakShape();
var1.width = this.width;
var1.height = this.height;
var1.depth = this.depth;
var1.centered = this.centered;
var1.offset = this.getOffset();
var1.orientation = this.getOrientation();
class="kw">return var1;
}
}