mirror of
https://github.com/Eaglercraft-Archive/Eaglercraftx-1.8.8-src.git
synced 2025-06-28 02:48:14 -05:00
Update #48 - Added some features from OptiFine
This commit is contained in:
44
sources/main/java/net/optifine/model/ListQuadsOverlay.java
Normal file
44
sources/main/java/net/optifine/model/ListQuadsOverlay.java
Normal file
@ -0,0 +1,44 @@
|
||||
package net.optifine.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
||||
public class ListQuadsOverlay {
|
||||
private List<BakedQuad> listQuads = new ArrayList();
|
||||
private List<IBlockState> listBlockStates = new ArrayList();
|
||||
private List<BakedQuad> listQuadsSingle = Arrays.<BakedQuad>asList(new BakedQuad[1]);
|
||||
|
||||
public void addQuad(BakedQuad quad, IBlockState blockState) {
|
||||
if (quad != null) {
|
||||
this.listQuads.add(quad);
|
||||
this.listBlockStates.add(blockState);
|
||||
}
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return this.listQuads.size();
|
||||
}
|
||||
|
||||
public BakedQuad getQuad(int index) {
|
||||
return (BakedQuad) this.listQuads.get(index);
|
||||
}
|
||||
|
||||
public IBlockState getBlockState(int index) {
|
||||
return index >= 0 && index < this.listBlockStates.size() ? (IBlockState) this.listBlockStates.get(index)
|
||||
: Blocks.air.getDefaultState();
|
||||
}
|
||||
|
||||
public List<BakedQuad> getListQuadsSingle(BakedQuad quad) {
|
||||
this.listQuadsSingle.set(0, quad);
|
||||
return this.listQuadsSingle;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
this.listQuads.clear();
|
||||
this.listBlockStates.clear();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user