-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
285 additions
and
293 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
54 changes: 27 additions & 27 deletions
54
...ain/java/net/gensokyoreimagined/nitori/mixin/logic/recipe_manager/RecipeManagerMixin.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 |
---|---|---|
@@ -1,29 +1,29 @@ | ||
package net.gensokyoreimagined.nitori.mixin.logic.recipe_manager; | ||
|
||
import net.minecraft.world.Container; | ||
import net.minecraft.world.item.crafting.Recipe; | ||
import net.minecraft.world.item.crafting.RecipeHolder; | ||
import net.minecraft.world.item.crafting.RecipeManager; | ||
import net.minecraft.world.item.crafting.RecipeType; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Overwrite; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
import java.util.List; | ||
import java.util.Map; | ||
@Mixin(RecipeManager.class) | ||
public abstract class RecipeManagerMixin { | ||
|
||
@Shadow protected abstract <C extends Container, T extends Recipe<C>> Collection<RecipeHolder<T>> byType(RecipeType<T> type); | ||
|
||
/** | ||
* @author QPCrummer & Leaf Patch #0023 | ||
* @reason Optimize RecipeManager List Creation | ||
*/ | ||
@Overwrite | ||
public <C extends Container, T extends Recipe<C>> List<RecipeHolder<T>> getAllRecipesFor(RecipeType<T> type) { | ||
return new ArrayList<>(this.byType(type)); | ||
} | ||
} | ||
//import net.minecraft.world.Container; | ||
//import net.minecraft.world.item.crafting.Recipe; | ||
//import net.minecraft.world.item.crafting.RecipeHolder; | ||
//import net.minecraft.world.item.crafting.RecipeManager; | ||
//import net.minecraft.world.item.crafting.RecipeType; | ||
//import org.spongepowered.asm.mixin.Mixin; | ||
//import org.spongepowered.asm.mixin.Overwrite; | ||
//import org.spongepowered.asm.mixin.Shadow; | ||
// | ||
//import java.util.ArrayList; | ||
//import java.util.Collection; | ||
//import java.util.List; | ||
//import java.util.Map; | ||
//@Mixin(RecipeManager.class) | ||
//public abstract class RecipeManagerMixin { | ||
// | ||
// @Shadow protected abstract <C extends Container, T extends Recipe<C>> Collection<RecipeHolder<T>> byType(RecipeType<T> type); | ||
// | ||
// /** | ||
// * @author QPCrummer & Leaf Patch #0023 | ||
// * @reason Optimize RecipeManager List Creation | ||
// */ | ||
// @Overwrite | ||
// public <C extends Container, T extends Recipe<C>> List<RecipeHolder<T>> getAllRecipesFor(RecipeType<T> type) { | ||
// return new ArrayList<>(this.byType(type)); | ||
// } | ||
//} |
36 changes: 18 additions & 18 deletions
36
...t/gensokyoreimagined/nitori/mixin/math/random/creation/ServerPlayerEntityRandomMixin.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 |
---|---|---|
@@ -1,20 +1,20 @@ | ||
package net.gensokyoreimagined.nitori.mixin.math.random.creation; | ||
|
||
import net.minecraft.server.level.ServerPlayer; | ||
import net.minecraft.server.level.ServerLevel; | ||
import net.minecraft.util.RandomSource; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(ServerPlayer.class) | ||
public abstract class ServerPlayerEntityRandomMixin { | ||
|
||
@Shadow public abstract ServerLevel serverLevel(); | ||
|
||
@Redirect(method = "fudgeSpawnLocation", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/RandomSource;create()Lnet/minecraft/util/RandomSource;")) | ||
private RandomSource redirectCreatedRandom() { | ||
return serverLevel().random; | ||
} | ||
} | ||
//import net.minecraft.server.level.ServerPlayer; | ||
//import net.minecraft.server.level.ServerLevel; | ||
//import net.minecraft.util.RandomSource; | ||
//import org.spongepowered.asm.mixin.Mixin; | ||
//import org.spongepowered.asm.mixin.Shadow; | ||
//import org.spongepowered.asm.mixin.injection.At; | ||
//import org.spongepowered.asm.mixin.injection.Redirect; | ||
// | ||
//@Mixin(ServerPlayer.class) | ||
//public abstract class ServerPlayerEntityRandomMixin { | ||
// | ||
// @Shadow public abstract ServerLevel serverLevel(); | ||
// | ||
// @Redirect(method = "fudgeSpawnLocation", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/RandomSource;create()Lnet/minecraft/util/RandomSource;")) | ||
// private RandomSource redirectCreatedRandom() { | ||
// return serverLevel().random; | ||
// } | ||
//} |
22 changes: 11 additions & 11 deletions
22
.../java/net/gensokyoreimagined/nitori/mixin/util/accessors/ClientEntityManagerAccessor.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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
package net.gensokyoreimagined.nitori.mixin.util.accessors; | ||
|
||
import net.minecraft.world.level.entity.EntityAccess; | ||
import net.minecraft.world.level.entity.EntitySectionStorage; | ||
import net.minecraft.world.level.entity.TransientEntitySectionManager; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
|
||
@Mixin(TransientEntitySectionManager.class) | ||
public interface ClientEntityManagerAccessor<T extends EntityAccess> { | ||
@Accessor | ||
EntitySectionStorage<T> getSectionStorage(); | ||
} | ||
//import net.minecraft.world.level.entity.EntityAccess; | ||
//import net.minecraft.world.level.entity.EntitySectionStorage; | ||
//import net.minecraft.world.level.entity.TransientEntitySectionManager; | ||
//import org.spongepowered.asm.mixin.Mixin; | ||
//import org.spongepowered.asm.mixin.gen.Accessor; | ||
// | ||
//@Mixin(TransientEntitySectionManager.class) | ||
//public interface ClientEntityManagerAccessor<T extends EntityAccess> { | ||
// @Accessor | ||
// EntitySectionStorage<T> getSectionStorage(); | ||
//} |
22 changes: 11 additions & 11 deletions
22
.../java/net/gensokyoreimagined/nitori/mixin/util/accessors/ServerEntityManagerAccessor.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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
package net.gensokyoreimagined.nitori.mixin.util.accessors; | ||
|
||
import net.minecraft.world.level.entity.EntityAccess; | ||
import net.minecraft.world.level.entity.EntitySectionStorage; | ||
import net.minecraft.world.level.entity.PersistentEntitySectionManager; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
|
||
@Mixin(PersistentEntitySectionManager.class) | ||
public interface ServerEntityManagerAccessor<T extends EntityAccess> { | ||
@Accessor | ||
EntitySectionStorage<T> getSectionStorage(); | ||
} | ||
//import net.minecraft.world.level.entity.EntityAccess; | ||
//import net.minecraft.world.level.entity.EntitySectionStorage; | ||
//import net.minecraft.world.level.entity.PersistentEntitySectionManager; | ||
//import org.spongepowered.asm.mixin.Mixin; | ||
//import org.spongepowered.asm.mixin.gen.Accessor; | ||
// | ||
//@Mixin(PersistentEntitySectionManager.class) | ||
//public interface ServerEntityManagerAccessor<T extends EntityAccess> { | ||
// @Accessor | ||
// EntitySectionStorage<T> getSectionStorage(); | ||
//} |
Oops, something went wrong.