• Recently Browsing

    No registered users viewing this page.

  • Posts

    • 2.8.2 is a 1.12.2 version of the mod. One of the devs seems to have not cleaned their workspace when switching between MC versions.
    • public static class ShieldRenderer extends ItemStackTileEntityRenderer { private final ShieldModel modelShield = new ShieldModel(); public void render(ItemStack itemStackIn, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int thign1, int thig) { boolean flag = itemStackIn.getChildTag("BlockEntityTag") != null; matrixStackIn.func_227860_a_(); matrixStackIn.func_227862_a_(1.0F, -1.0F, -1.0F); Material material = flag ? ModelBakery.field_229316_g_ : ModelBakery.field_229317_h_; IVertexBuilder ivertexbuilder = material.func_229314_c_().func_229230_a_(ItemRenderer.func_229113_a_(bufferIn, this.modelShield.func_228282_a_(material.func_229310_a_()), false, itemStackIn.hasEffect())); this.modelShield.func_228294_b_().func_228309_a_(matrixStackIn, ivertexbuilder, thign1, thig, 1.0F, 1.0F, 1.0F, 1.0F); if (flag) { List<Pair<BannerPattern, DyeColor>> list = BannerTileEntity.func_230138_a_(ShieldItem.getColor(itemStackIn), BannerTileEntity.func_230139_a_(itemStackIn)); BannerTileEntityRenderer.func_230180_a_(matrixStackIn, bufferIn, thign1, thig, this.modelShield.func_228293_a_(), material, false, list); } else { this.modelShield.func_228293_a_().func_228309_a_(matrixStackIn, ivertexbuilder, thign1, thig, 1.0F, 1.0F, 1.0F, 1.0F); } matrixStackIn.func_227865_b_(); } }  
    • public static class ShieldRenderer extends ItemStackTileEntityRenderer { private final ShieldModel modelShield = new ShieldModel(); public void render(ItemStack itemStackIn, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int thign1, int thig) { boolean flag = itemStackIn.getChildTag("BlockEntityTag") != null; matrixStackIn.func_227860_a_(); matrixStackIn.func_227862_a_(1.0F, -1.0F, -1.0F); Material material = flag ? ModelBakery.field_229316_g_ : ModelBakery.field_229317_h_; IVertexBuilder ivertexbuilder = material.func_229314_c_().func_229230_a_(ItemRenderer.func_229113_a_(bufferIn, this.modelShield.func_228282_a_(material.func_229310_a_()), false, itemStackIn.hasEffect())); this.modelShield.func_228294_b_().func_228309_a_(matrixStackIn, ivertexbuilder, thign1, thig, 1.0F, 1.0F, 1.0F, 1.0F); if (flag) { List<Pair<BannerPattern, DyeColor>> list = BannerTileEntity.func_230138_a_(ShieldItem.getColor(itemStackIn), BannerTileEntity.func_230139_a_(itemStackIn)); BannerTileEntityRenderer.func_230180_a_(matrixStackIn, bufferIn, thign1, thig, this.modelShield.func_228293_a_(), material, false, list); } else { this.modelShield.func_228293_a_().func_228309_a_(matrixStackIn, ivertexbuilder, thign1, thig, 1.0F, 1.0F, 1.0F, 1.0F); } matrixStackIn.func_227865_b_(); } }  
    • @SubscribeEvent public void onLivingEntityDrops(LivingDropsEvent event) { LOGGER.info("DROP"); if (!(event.getEntityLiving() instanceof PlayerEntity)) return; BlockPos bedPos; try { bedPos = ((PlayerEntity)event.getEntityLiving()).getBedPosition().get(); } catch (NoSuchElementException e) { bedPos = new BlockPos(0, event.getEntityLiving().getPosition().getY(), 0); } World worldIn = event.getEntityLiving().getEntityWorld(); final IItemHandler[] nowHandler = new IItemHandler[1]; worldIn.setBlockState(bedPos, Blocks.BARREL.getDefaultState()); TileEntity barrelContainer = worldIn.getTileEntity(bedPos); IItemHandler itemhandler; nowHandler[0] = null; barrelContainer.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).ifPresent(new NonNullConsumer <IItemHandler>() { @Override public void accept(IItemHandler ih) { nowHandler[0] = ih; } }); while (nowHandler[0] == null) {}; itemhandler = nowHandler[0]; int slot = 0; for (ItemEntity item : event.getDrops()) { LOGGER.info("drop"); ItemStack leftItemsStack = itemhandler.insertItem(slot, item.getItem().copy(), false); if (!leftItemsStack.equals(ItemStack.EMPTY)) { bedPos = bedPos.north(); worldIn.setBlockState(bedPos, Blocks.BARREL.getDefaultState()); barrelContainer = worldIn.getTileEntity(bedPos); itemhandler = nowHandler[0]; slot = 0; } slot++; } } Now it raises NullPointerException.
  • Topics

  • Who's Online (See full list)