generated from TropheusJ/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 34
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
297 changed files
with
10,302 additions
and
7,027 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
20 changes: 0 additions & 20 deletions
20
...abricators_of_create/porting_lib/mixin/accessors/client/accessor/ModelBakeryAccessor.java
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
...tors_of_create/porting_lib/mixin/accessors/common/accessor/PotionBrewing$MixAccessor.java
This file was deleted.
Oops, something went wrong.
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
19 changes: 18 additions & 1 deletion
19
...o/github/fabricators_of_create/porting_lib/block/CustomDataPacketHandlingBlockEntity.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,8 +1,25 @@ | ||
package io.github.fabricators_of_create.porting_lib.block; | ||
|
||
import net.minecraft.core.HolderLookup; | ||
import net.minecraft.nbt.CompoundTag; | ||
import net.minecraft.network.Connection; | ||
import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
|
||
public interface CustomDataPacketHandlingBlockEntity { | ||
void onDataPacket(Connection connection, ClientboundBlockEntityDataPacket packet); | ||
/** | ||
* Called when you receive a {@link ClientboundBlockEntityDataPacket} packet for the location this | ||
* BlockEntity is currently in. On the client, the Connection will always | ||
* be the remote server. On the server, it will be whomever is responsible for | ||
* sending the packet. | ||
* | ||
* @param net The Connection the packet originated from | ||
* @param pkt The data packet | ||
*/ | ||
default void onDataPacket(Connection net, ClientboundBlockEntityDataPacket pkt, HolderLookup.Provider lookupProvider) { | ||
CompoundTag compoundtag = pkt.getTag(); | ||
if (!compoundtag.isEmpty()) { | ||
((BlockEntity) this).loadWithComponents(compoundtag, lookupProvider); | ||
} | ||
} | ||
} |
27 changes: 16 additions & 11 deletions
27
.../base/src/main/java/io/github/fabricators_of_create/porting_lib/block/CustomExpBlock.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,23 +1,28 @@ | ||
package io.github.fabricators_of_create.porting_lib.block; | ||
|
||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.util.RandomSource; | ||
import net.minecraft.world.level.LevelReader; | ||
import net.minecraft.world.entity.Entity; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.item.enchantment.EnchantmentEffectComponents; | ||
import net.minecraft.world.level.LevelAccessor; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
|
||
import org.jetbrains.annotations.Nullable; | ||
|
||
public interface CustomExpBlock { | ||
/** | ||
* Gathers how much experience this block drops when broken. | ||
* Returns how many experience points this block drops when broken, before application of {@linkplain EnchantmentEffectComponents#BLOCK_EXPERIENCE enchantments}. | ||
* | ||
* @param state The current state | ||
* @param level The level | ||
* @param randomSource Random source to use for experience randomness | ||
* @param pos Block position | ||
* @param fortuneLevel fortune enchantment level of tool being used | ||
* @param silkTouchLevel silk touch enchantment level of tool being used | ||
* @return Amount of XP from breaking this block. | ||
* @param state The state of the block being broken | ||
* @param level The level | ||
* @param pos The position of the block being broken | ||
* @param blockEntity The block entity, if any | ||
* @param breaker The entity who broke the block, if known | ||
* @param tool The item stack used to break the block. May be empty | ||
* @return The amount of experience points dropped by this block | ||
*/ | ||
default int getExpDrop(BlockState state, LevelReader level, RandomSource randomSource, BlockPos pos, int fortuneLevel, int silkTouchLevel) { | ||
default int getExpDrop(BlockState state, LevelAccessor level, BlockPos pos, @Nullable BlockEntity blockEntity, @Nullable Entity breaker, ItemStack tool) { | ||
return 0; | ||
} | ||
} |
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: 10 additions & 2 deletions
12
...io/github/fabricators_of_create/porting_lib/block/CustomUpdateTagHandlingBlockEntity.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,10 +1,18 @@ | ||
package io.github.fabricators_of_create.porting_lib.block; | ||
|
||
import net.minecraft.core.HolderLookup; | ||
import net.minecraft.nbt.CompoundTag; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
|
||
public interface CustomUpdateTagHandlingBlockEntity { | ||
default void handleUpdateTag(CompoundTag tag) { | ||
((BlockEntity) this).load(tag); | ||
/** | ||
* Called when the chunk's BE update tag, gotten from {@link BlockEntity#getUpdateTag(HolderLookup.Provider)}, is received on the client. | ||
* <p> | ||
* Used to handle this tag in a special way. By default this simply calls {@link BlockEntity#loadWithComponents(CompoundTag, HolderLookup.Provider)}. | ||
* | ||
* @param tag The {@link CompoundTag} sent from {@link BlockEntity#getUpdateTag(HolderLookup.Provider)} | ||
*/ | ||
default void handleUpdateTag(CompoundTag tag, HolderLookup.Provider lookupProvider) { | ||
((BlockEntity) this).loadWithComponents(tag, lookupProvider); | ||
} | ||
} |
35 changes: 0 additions & 35 deletions
35
...main/java/io/github/fabricators_of_create/porting_lib/event/client/ClientWorldEvents.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.