-
Notifications
You must be signed in to change notification settings - Fork 23
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
33 changed files
with
455 additions
and
60 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
Submodule forge
updated
43 files
Empty file.
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
32 changes: 32 additions & 0 deletions
32
src/main/java/xyz/bluspring/kilt/forgeinjects/data/loot/BlockLootSubProviderInject.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 xyz.bluspring.kilt.forgeinjects.data.loot; | ||
|
||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation; | ||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; | ||
import net.minecraft.core.DefaultedRegistry; | ||
import net.minecraft.core.registries.BuiltInRegistries; | ||
import net.minecraft.data.loot.BlockLootSubProvider; | ||
import net.minecraft.world.level.block.Block; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import xyz.bluspring.kilt.injections.data.loot.BlockLootSubProviderInjection; | ||
|
||
import java.util.Iterator; | ||
|
||
@Mixin(BlockLootSubProvider.class) | ||
public abstract class BlockLootSubProviderInject implements BlockLootSubProviderInjection { | ||
@Override | ||
public Iterable<Block> getKnownBlocks() { | ||
return BuiltInRegistries.BLOCK; | ||
} | ||
|
||
@WrapOperation(method = "generate(Ljava/util/function/BiConsumer;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/core/DefaultedRegistry;iterator()Ljava/util/Iterator;")) | ||
private Iterator<Block> kilt$useGetKnownBlocks(DefaultedRegistry<Block> instance, Operation<Iterator<Block>> original) { | ||
var knownBlocks = this.getKnownBlocks(); | ||
|
||
// fallback to a modded one if needed. | ||
if (knownBlocks == BuiltInRegistries.BLOCK) | ||
return original.call(instance); | ||
|
||
return knownBlocks.iterator(); | ||
} | ||
} |
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
12 changes: 12 additions & 0 deletions
12
src/main/java/xyz/bluspring/kilt/forgeinjects/world/item/UseAnimInject.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,12 @@ | ||
package xyz.bluspring.kilt.forgeinjects.world.item; | ||
|
||
import net.minecraft.world.item.UseAnim; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import xyz.bluspring.kilt.helpers.mixin.CreateStatic; | ||
import xyz.bluspring.kilt.injections.world.item.UseAnimInjection; | ||
|
||
@Mixin(UseAnim.class) | ||
public abstract class UseAnimInject implements UseAnimInjection { | ||
@CreateStatic | ||
private static UseAnim CUSTOM = UseAnimInjection.CUSTOM; | ||
} |
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
13 changes: 13 additions & 0 deletions
13
...in/java/xyz/bluspring/kilt/injections/client/resources/sounds/SoundInstanceInjection.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,13 @@ | ||
package xyz.bluspring.kilt.injections.client.resources.sounds; | ||
|
||
import net.minecraft.client.resources.sounds.Sound; | ||
import net.minecraft.client.sounds.AudioStream; | ||
import net.minecraft.client.sounds.SoundBufferLibrary; | ||
|
||
import java.util.concurrent.CompletableFuture; | ||
|
||
public interface SoundInstanceInjection { | ||
default CompletableFuture<AudioStream> getStream(SoundBufferLibrary soundBuffers, Sound sound, boolean looping) { | ||
throw new IllegalStateException(); | ||
} | ||
} |
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
9 changes: 9 additions & 0 deletions
9
src/main/java/xyz/bluspring/kilt/injections/data/loot/BlockLootSubProviderInjection.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,9 @@ | ||
package xyz.bluspring.kilt.injections.data.loot; | ||
|
||
import net.minecraft.world.level.block.Block; | ||
|
||
public interface BlockLootSubProviderInjection { | ||
default Iterable<Block> getKnownBlocks() { | ||
throw new IllegalStateException(); | ||
} | ||
} |
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.