-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hide stacktraces until current ones be fixed (#142)
Added a bit of debug to Chemical Thrower. I'll remove it once I have some time to test Fix Progressive Automation duplication bug, closes #143 Fix WorldEdit Forge unexpected cast... workaround until AsyncWorldEdit isn't out and FAWE is broken Update Mixin
- Loading branch information
Showing
11 changed files
with
114 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/java/net/heyzeer0/mgh/mixins/ie/MixinItemChemthrower.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package net.heyzeer0.mgh.mixins.ie; | ||
|
||
import blusunrize.immersiveengineering.common.items.ItemChemthrower; | ||
import net.heyzeer0.mgh.MagiHandlers; | ||
import net.heyzeer0.mgh.api.forge.IForgeEntity; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.world.World; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
/** | ||
* Created by Frani on 17/03/2018. | ||
*/ | ||
@Mixin(value = ItemChemthrower.class, remap = false) | ||
public abstract class MixinItemChemthrower { | ||
|
||
@Redirect(method = "onUsingTick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;spawnEntityInWorld(Lnet/minecraft/entity/Entity;)Z")) | ||
private boolean redirectSpawnEntity(World world, Entity entity) { | ||
boolean r = world.spawnEntityInWorld(entity); | ||
MagiHandlers.log("chemtrower entity owner: " + ((IForgeEntity) entity).getMHOwner().getCommandSenderName()); | ||
return r; | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/net/heyzeer0/mgh/mixins/progressiveauto/MixinOreHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package net.heyzeer0.mgh.mixins.progressiveauto; | ||
|
||
import net.minecraft.item.ItemStack; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Pseudo; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
/** | ||
* Created by Frani on 17/03/2018. | ||
*/ | ||
@Pseudo | ||
@Mixin(targets = "com/vanhal/progressiveautomation/util/OreHelper", remap = false) | ||
public abstract class MixinOreHelper { | ||
|
||
@Inject(method = "ItemOreMatch", at = @At(value = "RETURN", ordinal = 0), cancellable = true) | ||
private static void onReturn(ItemStack stackA, ItemStack stackB, CallbackInfoReturnable<Boolean> cir) { | ||
if (!ItemStack.areItemStackTagsEqual(stackA, stackB)) cir.setReturnValue(false); | ||
} | ||
|
||
@Inject(method = "ItemOreMatch", at = @At(value = "RETURN", ordinal = 3), cancellable = true) | ||
private static void onReturn2(ItemStack stackA, ItemStack stackB, CallbackInfoReturnable<Boolean> cir) { | ||
if (!ItemStack.areItemStackTagsEqual(stackA, stackB)) cir.setReturnValue(false); | ||
} | ||
|
||
|
||
} |
37 changes: 37 additions & 0 deletions
37
src/main/java/net/heyzeer0/mgh/mixins/worldedit/MixinForgeWorld.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package net.heyzeer0.mgh.mixins.worldedit; | ||
|
||
import com.google.common.collect.Sets; | ||
import com.sk89q.worldedit.forge.ForgeWorld; | ||
import org.bukkit.craftbukkit.v1_7_R4.util.LongHashSet; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
import java.lang.reflect.Field; | ||
import java.util.Set; | ||
|
||
/** | ||
* Created by Frani on 17/03/2018. | ||
*/ | ||
@Mixin(value = ForgeWorld.class, remap = false) | ||
public abstract class MixinForgeWorld { | ||
|
||
private LongHashSet longHashSet; | ||
|
||
@Redirect(method = "regenerate", at = @At(value = "INVOKE", target = "Ljava/lang/reflect/Field;get(Ljava/lang/Object;)Ljava/lang/Object;", ordinal = 0)) | ||
private Object redirectGet(Field instance, Object otherObj) { | ||
try { | ||
longHashSet = (LongHashSet) instance.get(otherObj); | ||
return Sets.newHashSet(longHashSet.toArray()); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
return null; | ||
} | ||
|
||
@Redirect(method = "regenerate", at = @At(value = "INVOKE", target = "Ljava/util/Set;remove(Ljava/lang/Object;)Z")) | ||
private boolean redirectRemove(Set set, Object obj) { | ||
return longHashSet.remove((Long) obj); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"required": true, | ||
"package": "net.heyzeer0.mgh.mixins.worldedit", | ||
"mixins": [ | ||
"MixinForgeWorld" | ||
], | ||
"server": [], | ||
"client": [], | ||
"compatibilityLevel": "JAVA_8", | ||
"refmap": "mixin.magihandlers.refmap.json" | ||
} |