-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 优化 NBT 原始类型的复制。 - 优化 EnderIO 的能量网络优化的性能开销。 - 新增几个内部兼容。
- Loading branch information
1 parent
5824650
commit 2a10492
Showing
25 changed files
with
307 additions
and
188 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
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
37 changes: 37 additions & 0 deletions
37
src/main/java/github/kasuminova/stellarcore/mixin/appeng/MixinCraftingGridCache.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 github.kasuminova.stellarcore.mixin.appeng; | ||
|
||
import appeng.me.cache.CraftingGridCache; | ||
import github.kasuminova.stellarcore.common.config.StellarCoreConfig; | ||
import github.kasuminova.stellarcore.common.itemstack.ItemStackCapInitializer; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@SuppressWarnings("MethodMayBeStatic") | ||
@Mixin(value = CraftingGridCache.class, remap = false) | ||
public class MixinCraftingGridCache { | ||
|
||
/** | ||
* Prevents a large number of ItemStacks from loading. | ||
*/ | ||
@Inject(method = "onUpdateTick", at = @At("HEAD")) | ||
private void injectOnUpdateTickStart(final CallbackInfo ci) { | ||
if (!StellarCoreConfig.PERFORMANCE.vanilla.asyncItemStackCapabilityInit) { | ||
return; | ||
} | ||
ItemStackCapInitializer.setShouldAddTask(false); | ||
} | ||
|
||
/** | ||
* Prevents a large number of ItemStacks from loading. | ||
*/ | ||
@Inject(method = "onUpdateTick", at = @At("RETURN")) | ||
private void injectOnUpdateTickEnd(final CallbackInfo ci) { | ||
if (!StellarCoreConfig.PERFORMANCE.vanilla.asyncItemStackCapabilityInit) { | ||
return; | ||
} | ||
ItemStackCapInitializer.setShouldAddTask(true); | ||
} | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
...main/java/github/kasuminova/stellarcore/mixin/draconicevolution/MixinTileEnergyPylon.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,32 @@ | ||
package github.kasuminova.stellarcore.mixin.draconicevolution; | ||
|
||
import com.brandon3055.draconicevolution.blocks.tileentity.TileEnergyPylon; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.ChunkPos; | ||
import net.minecraft.world.World; | ||
import net.minecraft.world.chunk.Chunk; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@SuppressWarnings("MethodMayBeStatic") | ||
@Mixin(TileEnergyPylon.class) | ||
public class MixinTileEnergyPylon { | ||
|
||
/** | ||
* Prevent chunk load. | ||
*/ | ||
@Redirect( | ||
method = "getCore", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/minecraft/world/World;getChunk(Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/world/chunk/Chunk;" | ||
), | ||
remap = false | ||
) | ||
private Chunk redirectGetCore(final World instance, final BlockPos pos) { | ||
ChunkPos chunkPos = new ChunkPos(pos); | ||
return instance.getChunkProvider().getLoadedChunk(chunkPos.x, chunkPos.z); | ||
} | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
src/main/java/github/kasuminova/stellarcore/mixin/ebwizardry/MixinBlockImbuementAltar.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 github.kasuminova.stellarcore.mixin.ebwizardry; | ||
|
||
import com.llamalad7.mixinextras.sugar.Local; | ||
import electroblob.wizardry.block.BlockImbuementAltar; | ||
import github.kasuminova.stellarcore.common.config.StellarCoreConfig; | ||
import net.minecraft.block.state.IBlockState; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.EnumFacing; | ||
import net.minecraft.util.EnumHand; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.World; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@SuppressWarnings("MethodMayBeStatic") | ||
@Mixin(BlockImbuementAltar.class) | ||
public class MixinBlockImbuementAltar { | ||
|
||
@Inject(method = "onBlockActivated", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;copy()Lnet/minecraft/item/ItemStack;"), cancellable = true) | ||
private void injectOnBlockActivated(final World world, final BlockPos pos, final IBlockState block, final EntityPlayer player, | ||
final EnumHand hand, final EnumFacing side, | ||
final float hitX, final float hitY, final float hitZ, | ||
final CallbackInfoReturnable<Boolean> cir, | ||
@Local(name = "toInsert") final ItemStack toInsert) | ||
{ | ||
if (!StellarCoreConfig.BUG_FIXES.ebWizardry.blockImbuementAltar) { | ||
return; | ||
} | ||
if (toInsert.isEmpty()) { | ||
cir.setReturnValue(true); | ||
} | ||
} | ||
|
||
} |
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
Oops, something went wrong.