crazypants.enderio.base.paint.YetaUtil类的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(88)

本文整理了Java中crazypants.enderio.base.paint.YetaUtil类的一些代码示例,展示了YetaUtil类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YetaUtil类的具体详情如下:
包路径:crazypants.enderio.base.paint.YetaUtil
类名称:YetaUtil

YetaUtil介绍

暂无

代码示例

代码示例来源:origin: SleepyTrousers/EnderIO

public static void onClientTick() {
 EntityPlayer player = EnderIO.proxy.getClientPlayer();
 if (player == null) {
  return;
 }
 boolean checkResult = shouldHeldItemHideFacades(player);
 toggled = lastCheckResult.isHideFacades() != checkResult;
 lastCheckResult.setHideFacades(checkResult);
 lastCheckResult.setDisplayMode(getDisplayMode(player));
}

代码示例来源:origin: SleepyTrousers/EnderIO

public static boolean isSolidFacadeRendered(@Nonnull IConduitBundle bundle, EntityPlayer player) {
 return bundle.hasFacade() && !isFacadeHidden(bundle, player);
}

代码示例来源:origin: SleepyTrousers/EnderIO

@Override
protected void updateEntityClient() {
 YetaUtil.refresh(this);
 if (isActive()) {
  doHoover();
 }
}

代码示例来源:origin: SleepyTrousers/EnderIO

public static boolean isFacadeHidden(@Nonnull IPaintableTileEntity bundle, EntityPlayer player) {
 if (bundle.getPaintSource() == null) {
  return false;
 }
 if (player == null || player.world.isRemote) {
  return shouldHeldItemHideFacadesClient();
 }
 return shouldHeldItemHideFacades(player);
}

代码示例来源:origin: SleepyTrousers/EnderIO

NNList<RaytraceResult> hits = new NNList<RaytraceResult>();
if (YetaUtil.isSolidFacadeRendered(bundle, player)) {
 setBlockBounds(0, 0, 0, 1, 1, 1);
 RayTraceResult hitPos = super.collisionRayTrace(bs, world, pos, origin, direction);
 ConduitDisplayMode mode = YetaUtil.getDisplayMode(player);
 for (CollidableComponent component : new ArrayList<CollidableComponent>(bundle.getCollidableComponents())) {
  if (mode.isAll() || component.conduitType == null || YetaUtil.renderConduit(player, component.conduitType)) {
   setBlockBounds(component.bound.minX, component.bound.minY, component.bound.minZ, component.bound.maxX, component.bound.maxY, component.bound.maxZ);
   RayTraceResult hitPos = super.collisionRayTrace(bs, world, pos, origin, direction);
 if (bundle.getConduits().isEmpty() && !YetaUtil.isFacadeHidden(bundle, player)) {
  setBlockBounds(0, 0, 0, 1, 1, 1);
  RayTraceResult hitPos = super.collisionRayTrace(bs, world, pos, origin, direction);

代码示例来源:origin: SleepyTrousers/EnderIO

public static boolean renderConduit(EntityPlayer player, @Nonnull IConduit con) {
 return renderConduit(player, con.getBaseConduitType());
}

代码示例来源:origin: SleepyTrousers/EnderIO

@Override
protected boolean shouldRender(@Nonnull TileSoulBinder te, @Nonnull IBlockState blockState, int renderPass) {
 return te.isWorking() && (te.getPaintSource() == null || YetaUtil.shouldHeldItemHideFacadesClient());
}

代码示例来源:origin: SleepyTrousers/EnderIO

public static boolean renderConduit(EntityPlayer player, @Nullable Class<? extends IConduit> conduitType) {
 if (player == null || player.world.isRemote) {
  return lastCheckResult.renderConduit(conduitType);
 }
 return getDisplayMode(player).renderConduit(conduitType);
}

代码示例来源:origin: SleepyTrousers/EnderIO

@SideOnly(Side.CLIENT)
@Override
public boolean addHitEffects(@Nonnull IBlockState state, @Nonnull World world, @Nonnull RayTraceResult target, @Nonnull ParticleManager effectRenderer) {
 TileConduitBundle cb = getTileEntity(world, target.getBlockPos());
 if (cb == null) {
  return false;
 }
 TextureAtlasSprite tex = null;
 if (YetaUtil.isSolidFacadeRendered(cb, Minecraft.getMinecraft().player)) {
  IBlockState paintSource = cb.getPaintSource();
  if (paintSource != null) {
   tex = RenderUtil.getTexture(paintSource);
  }
 } else if (target.hitInfo instanceof CollidableComponent) {
  CollidableComponent cc = (CollidableComponent) target.hitInfo;
  IConduit con = cb.getConduit(cc.conduitType);
  if (con != null && con instanceof IClientConduit.WithDefaultRendering) {
   tex = ((IClientConduit.WithDefaultRendering) con).getTextureForState(cc).getCroppedSprite();
  }
 }
 if (tex == null) {
  tex = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getTexture(ModObject.block_machine_base.getBlockNN().getDefaultState());
 }
 lastHitIcon = tex;
 addBlockHitEffects(world, effectRenderer, target.hitVec.x, target.hitVec.y, target.hitVec.z, target.sideHit, tex);
 return true;
}

代码示例来源:origin: SleepyTrousers/EnderIO

@Override
protected void onClientTick() {
 if (!Minecraft.getMinecraft().isGamePaused()) {
  ++clientTickCount;
  YetaUtil.onClientTick();
 }
}

代码示例来源:origin: SleepyTrousers/EnderIO

} else if (block instanceof IBlockPaintableBlock && !player.isSneaking() && !YetaUtil.shouldHeldItemHideFacades(player)) {
 IBlockState paintSource = ((IBlockPaintableBlock) block).getPaintSource(blockState, world, pos);
 if (paintSource != null) {

代码示例来源:origin: SleepyTrousers/EnderIO

if (!YetaUtil.renderConduit(player, type)) {
 return false;
 boolean droppedUnconected = false;
 for (IConduit con : cons) {
  if (con.getConduitConnections().isEmpty() && con.getExternalConnections().isEmpty() && YetaUtil.renderConduit(player, con)) {
   te.removeConduit(con);
   drop.addAll(con.getDrops());
   if (con != null && YetaUtil.renderConduit(player, con)) {
    te.removeConduit(con);
    drop.addAll(con.getDrops());

代码示例来源:origin: SleepyTrousers/EnderIO

@Override
 public @Nonnull IBakedModel handleItemState(@Nonnull IBakedModel originalModel, @Nonnull ItemStack stack, @Nullable World world,
   @Nullable EntityLivingBase entity) {
  if (Prep.isInvalid(stack)) {
   return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel();
  }
  if (!YetaUtil.shouldHeldItemHideFacadesClient()) {
   IBlockState paintSource = PaintUtil.getSourceBlock(stack);
   if (paintSource != null) {
    ItemQuadCollector quads = new ItemQuadCollector();
    quads.addItemBlockState(paintSource, Prep.getEmpty());
    quads.addBlockState(ModObject.block_machine_base.getBlockNN().getDefaultState().withProperty(EnumRenderPart.SUB, EnumRenderPart.PAINT_OVERLAY),
      Prep.getEmpty());
    return new CollectedItemQuadBakedBlockModel(originalModel, quads);
   }
  }
  return originalModel;
 }
};

代码示例来源:origin: SleepyTrousers/EnderIO

if (!YetaUtil.isSolidFacadeRendered(con, player)) {

代码示例来源:origin: SleepyTrousers/EnderIO

@Override
public void doUpdate() {
 if (world.isRemote) {
  YetaUtil.refresh(this);
  return;
 }
 if (!registered) {
  WirelessChargerController.instance.registerCharger(this);
  registered = true;
  disableTicking();
 }
}

代码示例来源:origin: SleepyTrousers/EnderIO

@SideOnly(Side.CLIENT)
public static FacadeRenderState getRequiredFacadeRenderState(@Nonnull IConduitBundle bundle, @Nonnull EntityPlayer player) {
 if (!bundle.hasFacade()) {
  return FacadeRenderState.NONE;
 }
 if (YetaUtil.isFacadeHidden(bundle, player)) {
  return FacadeRenderState.WIRE_FRAME;
 }
 return FacadeRenderState.FULL;
}

代码示例来源:origin: SleepyTrousers/EnderIO

protected @Nonnull NNList<RenderPair> getDynamicRenderersForConduitBundle(IConduitBundle b, EntityPlayerSP player) {
 NNList<RenderPair> result = null;
 for (IConduitRenderer conduitRenderer : dynamicCnduitRenderers) {
  for (IClientConduit conduit : b.getClientConduits()) {
   if (conduit instanceof IClientConduit.WithDefaultRendering && conduitRenderer != null && conduitRenderer.isRendererForConduit(conduit)
     && YetaUtil.renderConduit(player, conduit)) {
    if (result == null) {
     result = new NNList<>();
    }
    result.add(new RenderPair(conduitRenderer, (IClientConduit.WithDefaultRendering) conduit));
   }
  }
 }
 return result != null ? result : NNList.emptyList();
}

代码示例来源:origin: SleepyTrousers/EnderIO

if (block instanceof IBlockPaintableBlock && (!(block instanceof IWrenchHideablePaint) || !YetaUtil.shouldHeldItemHideFacadesClient())) {
 IBlockState paintSource = ((IBlockPaintableBlock) block).getPaintSource(block, stack);
 if (paintSource != null && paintSource != Blocks.AIR.getDefaultState()) {

代码示例来源:origin: SleepyTrousers/EnderIO

if (!YetaUtil.isSolidFacadeRendered(this, player) || facadeEquals(facadeID, facadeType1)) {
 return false;

代码示例来源:origin: SleepyTrousers/EnderIO

protected void updateEntityClient() {
 // check if the block on the client needs to update its texture
 if (isActive() != lastActive) {
  ticksSinceActiveChanged++;
  if (lastActive ? ticksSinceActiveChanged > 20 : ticksSinceActiveChanged > 4) {
   ticksSinceActiveChanged = 0;
   lastActive = isActive();
   updateBlock();
  }
 } else {
  ticksSinceActiveChanged = 0;
 }
 if (hasSound()) {
  updateSound();
 }
 YetaUtil.refresh(this);
}

相关文章