https://wiki.escapetomars.dev:443/index.php?title=Old_Optimizations&feed=atom&action=history
Old Optimizations - Revision history
2024-03-29T14:19:46Z
Revision history for this page on the wiki
MediaWiki 1.41.0
https://wiki.escapetomars.dev:443/index.php?title=Old_Optimizations&diff=51&oldid=prev
Kademlia: Created page with "* Detect chickens on hoppers and disable constant falling * Entity: this.onGround = this.C && d8 < 0.0D; // kade edit this is shit * Skip BoundingBox checks with lastInLavaRes..."
2020-03-03T19:35:50Z
<p>Created page with "* Detect chickens on hoppers and disable constant falling * Entity: this.onGround = this.C && d8 < 0.0D; // kade edit this is shit * Skip BoundingBox checks with lastInLavaRes..."</p>
<p><b>New page</b></p><div>* Detect chickens on hoppers and disable constant falling<br />
* Entity: this.onGround = this.C && d8 < 0.0D; // kade edit this is shit<br />
* Skip BoundingBox checks with lastInLavaResult && !blockPositionChanged<br />
* Skip BoundingBox checks with lastInBlockResult blockPositionChanged<br />
* EntityCreature - lastFindPath AI stuff <br />
* EntityEnderman - antiBunker code + PathfinderGoalHurtByTarget - buker code public void e() {<br /><br />
* EntityExperienceOrb - disable Mending enchantment<br />
* lastClimableBlockResult<br />
* lastFrictionFactor, blockPositionChanged<br />
* lastList, lastCollided<br />
* Entityplayer - tick container Update Delay / this.activeContainer.b();<br />
* EntityTrackerEntry - track - velocityChanged ( rocketboots mass spam fix)<br />
<br />
<source><br />
if (!cancelled) { // todo1.13<br />
if (this.tracker instanceof EntityPlayer) { // kade edit rocketboots mass-spam fix<br />
Player player = (Player) this.tracker.getBukkitEntity();<br />
org.bukkit.inventory.ItemStack boots = player.getInventory().getBoots();<br />
if(boots != null && boots.getType() == org.bukkit.Material.GOLDEN_BOOTS){<br />
if (this.tracker instanceof EntityPlayer) {<br />
((EntityPlayer) this.tracker).playerConnection.sendPacket(new PacketPlayOutEntityVelocity(this.tracker));<br />
}<br />
cancelled = true; // fake cancelled to not broadcast two lines below<br />
}<br />
}<br />
}<br />
<br />
if (!cancelled) { <br />
this.broadcastIncludingSelf(new PacketPlayOutEntityVelocity(this.tracker));<br />
}<br />
</source><br />
* ItemSkullPlayer fixMobHeadTag<br />// Mob-Head-Tag-Fixer kade, allow stacking and remove unneeded signature<br /> if(fixMobHeadTag(nbttagcompound)) return true; //kade<br />
* Packet Spamming<br /><source><br />
NetworkManager - protected void a(ChannelHandlerContext channelhandlercontext, Packet<?> packet) throws Exception {<br />
<br />
<br />
// kade edit: This prevents packet-spamming to lag the server todo1.13 <br />
public int lastPacketPlayInBlockPlace = 0; //kade <br />
private long packetCount = 0;<br />
private long lastPacketTick = MinecraftServer.currentTick;<br />
protected void a(ChannelHandlerContext channelhandlercontext, Packet<?> packet) throws Exception {<br />
ServerConnection.packetCount++; // kade<br />
packetCount++; //kade<br />
<br />
if(MinecraftServer.currentTick > lastPacketTick + 40){ //kade<br />
lastPacketTick = MinecraftServer.currentTick;<br />
packetCount = 0;<br />
}<br />
<br />
<br />
// if(packet instanceof PacketPlayInCustomPayload) {<br />
// PacketPlayInCustomPayload pp = (PacketPlayInCustomPayload) packet;<br />
// System.out.println(pp);<br />
// System.out.println(pp.a());<br />
// }<br />
<br />
if (packetCount > 1000){ //kade<br />
close(new ChatMessage("disconnect.spam", new Object[0]));<br />
OutputHelper.error("Kicking player for packetSpam");<br />
return;<br />
}<br />
<br />
if (packet instanceof PacketPlayInBlockPlace) { // kade<br />
lastPacketPlayInBlockPlace = 40;<br />
}<br />
if (lastPacketPlayInBlockPlace > 0) lastPacketPlayInBlockPlace--; // kade<br />
<br />
if (this.channel.isOpen()) {<br />
try {<br />
a(packet, this.m);<br />
} catch (CancelledPacketHandleException cancelledpackethandleexception) {<br />
;<br />
}<br />
<br />
++this.q;<br />
}<br />
<br />
}<br />
<br />
</source><br />
* PlayerConnection - horse running<br /><source><br />
double movedWronglyThreshold = org.spigotmc.SpigotConfig.movedWronglyThreshold; //kade<br />
if(!(entity instanceof EntityPlayer)){ //kade edit fixes buggy stairs-running with horses<br />
movedWronglyThreshold *= 1.5f;<br />
}<br />
<br />
if (d10 > movedWronglyThreshold) { // Spigot<br />
flag1 = true;<br />
PlayerConnection.LOGGER.warn("{} moved wrongly!", entity.getDisplayName().getString());<br />
}<br />
<br />
</source><br />
* Limit Elytra speed to prevent mass chunk loading<br />// if(distance > 1.30d){<br />// this.player.motX *= 0.75d;<br />
* Possibly limit enchantment levels again if bugged as in 1.9<br />int level = getEnchantmentLevel(Enchantments.LURE, itemstack);<br /> if(level > 3) level = 3; // kade fix max fortune, luck, loot bonus 3 // 1.9<br />
* Limit PathfinderGoalMeleeAttack lookups lastLocalPathEntityLookup (zombie hordes lag / villager targeting farm lag)<br />
*</div>
Kademlia