@Override public int hashCode() { return 31 * dim ^ blockPos.hashCode(); }
/** * Constructs a new block swapper with the provided world, starting * coordinates, target block, and target metadata. * @param world The world to swap blocks in. * @param coords The central coordinates to swap blocks around. * @param state The target blockstate to swap dirt and grass to. */ public BlockSwapper(World world, BlockPos coords, IBlockState state) { this.world = world; stateToSet = state; rand = new Random(coords.hashCode()); startCoords = coords; }
@Override public int hashCode() { return 31 * handler.hashCode() ^ world.hashCode() ^ pos.hashCode(); }
@Override public void render(TileAnimatedTorch te, double x, double y, double z, float partialTicks, int destroyStage, float unused) { Minecraft mc = Minecraft.getMinecraft(); GlStateManager.pushMatrix(); GlStateManager.translate(x, y, z); boolean hasWorld = te != null && te.getWorld() != null; int wtime = !hasWorld ? 0 : ClientTickHandler.ticksInGame; if(wtime != 0) wtime += new Random(te.getPos().hashCode()).nextInt(360); float time = wtime == 0 ? 0 : wtime + partialTicks; float xt = 0.5F + (float) Math.cos(time * 0.05F) * 0.025F; float yt = 0.1F + (float) (Math.sin(time * 0.04F) + 1F) * 0.05F; float zt = 0.5F + (float) Math.sin(time * 0.05F) * 0.025F; GlStateManager.translate(xt, yt, zt); GlStateManager.scale(2F, 2F, 2F); GlStateManager.rotate(90F, 1F, 0F, 0F); float rotation = (float) te.rotation; if(te.rotating) rotation += te.anglePerTick * partialTicks; GlStateManager.rotate(rotation, 0F, 0F, 1F); mc.getRenderItem().renderItem(new ItemStack(Blocks.REDSTONE_TORCH), ItemCameraTransforms.TransformType.GROUND); GlStateManager.popMatrix(); }
public static void breakGrass(World world, ItemStack stack, int stackDmg, BlockPos srcPos) { EnumHornType type = EnumHornType.getTypeForMeta(stackDmg); Random rand = new Random(srcPos.hashCode()); int range = 12 - stackDmg * 3; int rangeY = 3 + stackDmg * 4;
if(ConfigHandler.elfPortalParticlesEnabled) { double worldTime = ticks; worldTime += new Random(pos.hashCode()).nextInt(1000); worldTime /= 5;
@Override public void onAvatarUpdate(IAvatarTile tile, ItemStack stack) { TileEntity te = (TileEntity) tile; World world = te.getWorld(); if(tile.getCurrentMana() >= COST && tile.getElapsedFunctionalTicks() % 200 == 0 && tile.isEnabled()) { doHighlight(world, te.getPos(), 18, te.getPos().hashCode()); tile.recieveMana(-COST); } }
@Override public void render(@Nullable TileHourglass hourglass, double d0, double d1, double d2, float ticks, int digProgress, float unused) { GlStateManager.pushMatrix(); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.color(1F, 1F, 1F, 1F); GlStateManager.translate(d0, d1, d2); Minecraft.getMinecraft().renderEngine.bindTexture(texture); boolean hasWorld = hourglass != null && hourglass.getWorld() != null; int wtime = !hasWorld ? 0 : ClientTickHandler.ticksInGame; if(wtime != 0) wtime += new Random(hourglass.getPos().hashCode()).nextInt(360); float time = wtime == 0 ? 0 : wtime + ticks; float x = 0.5F + (float) Math.cos(time * 0.05F) * 0.025F; float y = 0.55F + (float) (Math.sin(time * 0.04F) + 1F) * 0.05F; float z = 0.5F + (float) Math.sin(time * 0.05F) * 0.025F; ItemStack stack = hasWorld ? hourglass.getItemHandler().getStackInSlot(0) : ItemStack.EMPTY; float activeFraction = stack.isEmpty() ? 0 : hourglass.lastFraction + (hourglass.timeFraction - hourglass.lastFraction) * ticks; float fract1 = stack.isEmpty() ? 0 : activeFraction; float fract2 = stack.isEmpty() ? 0 : 1F - activeFraction; GlStateManager.translate(x, y, z); float rot = hasWorld && hourglass.flip ? 180F : 1F; if(hasWorld && hourglass.flipTicks > 0) rot += (hourglass.flipTicks - ticks) * (180F / 4F); GlStateManager.rotate(rot, 0F, 0F, 1F); GlStateManager.scale(1F, -1F, -1F); model.render(fract1, fract2, hasWorld && hourglass.flip, hasWorld ? hourglass.getColor() : 0); GlStateManager.scale(1F, -1F, -1F); GlStateManager.popMatrix(); }
@Override public void render(@Nullable TileTeruTeruBozu tileentity, double d0, double d1, double d2, float f, int digProgress, float unused) { GlStateManager.pushMatrix(); GlStateManager.enableRescaleNormal(); GlStateManager.enableBlend(); GlStateManager.disableCull(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.color(1F, 1F, 1F, 1F); GlStateManager.translate(d0, d1, d2); Minecraft.getMinecraft().renderEngine.bindTexture(ClientProxy.dootDoot ? textureHalloween : texture); GlStateManager.rotate(180F, 1F, 0F, 0F); double time = Botania.proxy.getWorldElapsedTicks() + f; boolean hasWorld = tileentity != null && tileentity.getWorld() != null; if(hasWorld) time += new Random(tileentity.getPos().hashCode()).nextInt(1000); GlStateManager.translate(0.5F, -1.25F + (hasWorld ? (float) Math.sin(time * 0.01F) * 0.05F : 0F), -0.5F); if(hasWorld) { GlStateManager.rotate((float) (time * 0.3), 0F, 1F, 0F); GlStateManager.rotate(4F * (float) Math.sin(time * 0.05F), 0F, 0F, 1F); float s = 0.75F; GlStateManager.scale(s, s, s); } model.render(); GlStateManager.color(1F, 1F, 1F); GlStateManager.enableRescaleNormal(); GlStateManager.enableCull(); GlStateManager.popMatrix(); }
@Override public void render(@Nonnull TileEntity tile, double d0, double d1, double d2, float t, int digProgress, float unused) { if(ConfigHandler.staticFloaters) return; if (tile != null) if (!tile.getWorld().isBlockLoaded(tile.getPos(), false)) return; BlockRendererDispatcher brd = Minecraft.getMinecraft().getBlockRendererDispatcher(); GlStateManager.pushMatrix(); GlStateManager.color(1F, 1F, 1F, 1F); GlStateManager.translate(d0, d1, d2); double worldTime = ClientTickHandler.ticksInGame + t; if(tile.getWorld() != null) worldTime += new Random(tile.getPos().hashCode()).nextInt(1000); GlStateManager.translate(0.5F, 0, 0.5F); GlStateManager.rotate(-((float) worldTime * 0.5F), 0F, 1F, 0F); GlStateManager.translate(-0.5, (float) Math.sin(worldTime * 0.05F) * 0.1F, 0.5); GlStateManager.rotate(4F * (float) Math.sin(worldTime * 0.04F), 1F, 0F, 0F); Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); IBlockState state = tile.getWorld().getBlockState(tile.getPos()); state = state.getBlock().getExtendedState(state, tile.getWorld(), tile.getPos()); IBakedModel model = brd.getBlockModelShapes().getModelManager().getModel(new ModelResourceLocation("botania:floatingSpecialFlower", "inventory")); brd.getBlockModelRenderer().renderModelBrightness(model, state, 1.0F, true); GlStateManager.popMatrix(); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + dimension; result = prime * result + icon.hashCode(); result = prime * result + location.hashCode(); result = prime * result + name.hashCode(); return result; }
@Override public int hashCode() { int result = pos.hashCode(); result = 31 * result + getDimension(); return result; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + fromDir.hashCode(); result = prime * result + ((location == null) ? 0 : location.hashCode()); return result; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((conDir == null) ? 0 : conDir.hashCode()); result = prime * result + ((conduitLoc == null) ? 0 : conduitLoc.hashCode()); return result; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((pos == null) ? 0 : pos.hashCode()); result = prime * result + ((direction == null) ? 0 : direction.hashCode()); return result; }
@Override public int hashCode() { return name.hashCode() + tag.hashCode() + location.hashCode(); //lol }
worldTime += renderingItem ? 0 : new Random(pylon.getPos().hashCode()).nextInt(360);
tessellator.getBuffer().begin(GL11.GL_LINES, DefaultVertexFormats.POSITION); double len = (double) -ClientTickHandler.ticksInGame / 100F + new Random(dir.ordinal() ^ tile.getPos().hashCode()).nextInt(10000); double add = vecMag.mag(); double rand = Math.random() - 0.5;
Color color = Color.getHSBColor((float) ((time * 5 + new Random(spreader.getPos().hashCode()).nextInt(10000)) % 360) / 360F, 0.4F, 0.9F); GlStateManager.color(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F);
public static void addMarker(ItemStack stack, EntityPlayer player) { if(stack.getItem() == Items.FILLED_MAP) { MapData data = ((ItemMap) Items.FILLED_MAP).getMapData(stack, player.world); if(data != null) data.addTargetDecoration(stack, player.getPosition(), "Pin" + player.getPosition().hashCode(), Type.TARGET_X); } }