-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve performance of chunk saving #64
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.dimdev.jeid.mixin.core.world; | ||
|
||
import com.google.common.collect.*; | ||
import java.util.*; | ||
import net.minecraft.block.properties.*; | ||
import net.minecraft.block.state.BlockStateContainer.*; | ||
import org.spongepowered.asm.mixin.*; | ||
import org.spongepowered.asm.mixin.injection.*; | ||
import org.spongepowered.asm.mixin.injection.callback.*; | ||
|
||
@Mixin(StateImplementation.class) | ||
public class MixinStateImplementation { | ||
|
||
private int hashCodeValue; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use |
||
|
||
@Shadow | ||
private ImmutableMap<IProperty<?>, Comparable<?>> properties; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should have |
||
|
||
@Inject( | ||
method = "<init>", | ||
at = @At("RETURN") | ||
) | ||
private void initHashCode(CallbackInfo ci) { | ||
hashCodeValue = Objects.hash(this, properties); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using |
||
} | ||
|
||
/** | ||
* @author hohserg | ||
* @reason it should just return value. kinda have no sense to @Inject | ||
*/ | ||
@Overwrite | ||
public int hashCode() { | ||
return hashCodeValue; | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid using wildcard imports