huh
This commit is contained in:
parent
3409da13de
commit
b06faea26e
|
@ -162,7 +162,7 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
|
|||
* OpenGL sky list 2
|
||||
*/
|
||||
private int glSkyList2 = -1;
|
||||
private int cloudTickCounter;
|
||||
public int cloudTickCounter;
|
||||
private final Map<Integer, DestroyBlockProgress> damagedBlocks = Maps.newHashMap();
|
||||
private final Map<BlockPos, ISound> mapSoundPositions = Maps.newHashMap();
|
||||
private final EaglerTextureAtlasSprite[] destroyBlockIcons = new EaglerTextureAtlasSprite[10];
|
||||
|
@ -926,12 +926,13 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
|
|||
RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation3 = new RenderGlobal.ContainerLocalRenderInformation(
|
||||
renderchunk, (EnumFacing) null, 0);
|
||||
Set set1 = this.getVisibleFacings(blockpos1);
|
||||
if (set1.size() == 1) {
|
||||
Vector3f vector3f = this.getViewVector(viewEntity, partialTicks);
|
||||
EnumFacing enumfacing = EnumFacing.getFacingFromVector(vector3f.x, vector3f.y, vector3f.z)
|
||||
.getOpposite();
|
||||
set1.remove(enumfacing);
|
||||
}
|
||||
// if (set1.size() == 1) {
|
||||
// Vector3f vector3f = this.getViewVector(viewEntity, partialTicks);
|
||||
// EnumFacing enumfacing = EnumFacing.getFacingFromVector(vector3f.x,
|
||||
// vector3f.y, vector3f.z)
|
||||
// .getOpposite();
|
||||
// set1.remove(enumfacing);
|
||||
// }
|
||||
|
||||
if (set1.isEmpty()) {
|
||||
flag2 = true;
|
||||
|
|
|
@ -90,7 +90,9 @@ public class CompiledChunk {
|
|||
}
|
||||
|
||||
public boolean isVisible(EnumFacing enumfacing, EnumFacing enumfacing1) {
|
||||
return this.setVisibility.isVisible(enumfacing, enumfacing1);
|
||||
// boolean visible = this.setVisibility.isVisible(enumfacing, enumfacing1);
|
||||
return setVisibility.vfix$anyPathToFace(enumfacing1);
|
||||
// return visible;
|
||||
}
|
||||
|
||||
public void setVisibility(SetVisibility visibility) {
|
||||
|
|
|
@ -38,6 +38,8 @@ public class SetVisibility {
|
|||
private static final int COUNT_FACES = EnumFacing._VALUES.length;
|
||||
private final BitSet bitSet;
|
||||
|
||||
private long bitField = 0;
|
||||
|
||||
public SetVisibility() {
|
||||
this.bitSet = new BitSet(COUNT_FACES * COUNT_FACES);
|
||||
}
|
||||
|
@ -52,19 +54,44 @@ public class SetVisibility {
|
|||
|
||||
}
|
||||
|
||||
public void setVisible(EnumFacing facing, EnumFacing facing2, boolean parFlag) {
|
||||
this.bitSet.set(facing.ordinal() + facing2.ordinal() * COUNT_FACES, parFlag);
|
||||
this.bitSet.set(facing2.ordinal() + facing.ordinal() * COUNT_FACES, parFlag);
|
||||
public void setVisible(EnumFacing fromFace, EnumFacing toFace, boolean isVisible) {
|
||||
long shiftBy;
|
||||
|
||||
shiftBy = fromFace.ordinal() + toFace.ordinal() * COUNT_FACES;
|
||||
this.bitField = (this.bitField & ~(1L << shiftBy)) | ((isVisible ? 1L : 0L) << shiftBy);
|
||||
|
||||
shiftBy = toFace.ordinal() + fromFace.ordinal() * COUNT_FACES;
|
||||
this.bitField = (this.bitField & ~(1L << shiftBy)) | ((isVisible ? 1L : 0L) << shiftBy);
|
||||
}
|
||||
|
||||
// public void setVisible(EnumFacing facing, EnumFacing facing2, boolean
|
||||
// parFlag) {
|
||||
// this.bitSet.set(facing.ordinal() + facing2.ordinal() * COUNT_FACES, parFlag);
|
||||
// this.bitSet.set(facing2.ordinal() + facing.ordinal() * COUNT_FACES, parFlag);
|
||||
// }
|
||||
|
||||
public void setAllVisible(boolean visible) {
|
||||
this.bitSet.set(0, this.bitSet.size(), visible);
|
||||
this.bitField = visible ? 0xFFFFFFFFFL : 0L;
|
||||
}
|
||||
|
||||
public boolean isVisible(EnumFacing facing, EnumFacing facing2) {
|
||||
return this.bitSet.get(facing.ordinal() + facing2.ordinal() * COUNT_FACES);
|
||||
// public void setAllVisible(boolean visible) {
|
||||
// this.bitSet.set(0, this.bitSet.size(), visible);
|
||||
// }
|
||||
|
||||
public boolean isVisible(EnumFacing fromFace, EnumFacing toFace) {
|
||||
boolean ret = ((1L << (fromFace.ordinal() + toFace.ordinal() * COUNT_FACES)) & this.bitField) != 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
public boolean vfix$anyPathToFace(EnumFacing targetFace) {
|
||||
long mask = 0b111111 << (targetFace.ordinal() * COUNT_FACES);
|
||||
return (mask & this.bitField) > 0;
|
||||
}
|
||||
|
||||
// public boolean isVisible(EnumFacing facing, EnumFacing facing2) {
|
||||
// return this.bitSet.get(facing.ordinal() + facing2.ordinal() * COUNT_FACES);
|
||||
// }
|
||||
|
||||
public String toString() {
|
||||
StringBuilder stringbuilder = new StringBuilder();
|
||||
stringbuilder.append(' ');
|
||||
|
|
Loading…
Reference in New Issue