Skip to content

Commit

Permalink
Fixed #258
Browse files Browse the repository at this point in the history
  • Loading branch information
MineDragonCZ committed Jul 3, 2023
1 parent afb83bd commit f22fec6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/tauri/dev/jsg/item/props/DecorPropItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,22 @@ public boolean renderHighlight(IBlockState state) {
return false;
}
},
true,
new PropModel(ElementEnum.DECOR_ANCIENT_OBELISK, new Vector3f(0, 0, 0), 1)
);

public final int id;
public final JSGBlock abstractBlock;
public final String name;
public final PropModel[] models;
public boolean globalRender = false;
public final PropModelRenderFunction runnableWhileRendering;

PropVariants(int id, String name, @Nullable PropModelRenderFunction runnableWhileRendering, PropAbstractBlock abstractBlock, boolean globalRender, PropModel... models) {
this(id, name, runnableWhileRendering, abstractBlock, models);
this.globalRender = globalRender;
}

PropVariants(int id, String name, @Nullable PropModelRenderFunction runnableWhileRendering, PropAbstractBlock abstractBlock, PropModel... models) {
this.id = id;
this.abstractBlock = abstractBlock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,12 @@ public void render(@Nonnull DecorPropTile te, double x, double y, double z, floa
GlStateManager.popMatrix();
GlStateManager.popMatrix();
}

@Override
public boolean isGlobalRenderer(DecorPropTile te){
IBlockState bs = te.getWorld().getBlockState(te.getPos());
int meta = bs.getValue(JSGProps.PROP_VARIANT);
DecorPropItem.PropVariants propVariant = DecorPropItem.PropVariants.byId(meta);
return (propVariant != null && propVariant.globalRender);
}
}

0 comments on commit f22fec6

Please sign in to comment.