generated from neoforged/MDK
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
b34bc94
commit 9a17b95
Showing
19 changed files
with
166 additions
and
22 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
11 changes: 11 additions & 0 deletions
11
src/main/java/com/example/regilite/events/IBlockColor.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,11 @@ | ||
package com.example.regilite.events; | ||
|
||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.level.BlockAndTintGetter; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
public interface IBlockColor { | ||
int getColor(BlockState state, @Nullable BlockAndTintGetter getter, @Nullable BlockPos pos, int layer); | ||
} |
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,7 @@ | ||
package com.example.regilite.events; | ||
|
||
import net.minecraft.world.item.ItemStack; | ||
|
||
public interface IItemColor { | ||
int getColor(ItemStack stack, int layer); | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/com/example/regilite/events/IScreenConstructor.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,11 @@ | ||
package com.example.regilite.events; | ||
|
||
import net.minecraft.client.gui.screens.Screen; | ||
import net.minecraft.client.gui.screens.inventory.MenuAccess; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.world.entity.player.Inventory; | ||
import net.minecraft.world.inventory.AbstractContainerMenu; | ||
|
||
public interface IScreenConstructor<T extends AbstractContainerMenu, U extends Screen & MenuAccess<T>> { | ||
U create(T p_96215_, Inventory p_96216_, Component p_96217_); | ||
} |
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
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,18 @@ | ||
package com.example.examplemod; | ||
|
||
import com.example.examplemod.exampleclasses.ExampleMenu; | ||
import com.example.examplemod.exampleclasses.ExampleScreen; | ||
import com.example.regilite.registry.EnderDeferredMenu; | ||
import com.example.regilite.registry.EnderMenuRegistry; | ||
import net.neoforged.bus.api.IEventBus; | ||
|
||
public class Menus { | ||
|
||
private static final EnderMenuRegistry MENUS = EnderMenuRegistry.createRegistry(ExampleMod.MODID); | ||
|
||
public static final EnderDeferredMenu<ExampleMenu> EXAMPLE_MENU = MENUS.registerMenu("example", ExampleMenu::new, ExampleScreen::new); | ||
|
||
public static void register(IEventBus modbus) { | ||
MENUS.register(modbus); | ||
} | ||
} |
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: 19 additions & 1 deletion
20
src/test/java/com/example/examplemod/exampleclasses/ExampleBlockentity.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,12 +1,30 @@ | ||
package com.example.examplemod.exampleclasses; | ||
|
||
import com.example.examplemod.BlockEntities; | ||
import com.example.examplemod.Menus; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.world.MenuProvider; | ||
import net.minecraft.world.entity.player.Inventory; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.inventory.AbstractContainerMenu; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class ExampleBlockentity extends BlockEntity { | ||
public class ExampleBlockentity extends BlockEntity implements MenuProvider { | ||
public ExampleBlockentity(BlockPos p_155229_, BlockState p_155230_) { | ||
super(BlockEntities.EXAMPLE_BLOCKENTITY.get(), p_155229_, p_155230_); | ||
} | ||
|
||
@Override | ||
public Component getDisplayName() { | ||
return Component.translatable("test"); | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public AbstractContainerMenu createMenu(int p_39954_, Inventory p_39955_, Player p_39956_) { | ||
return new ExampleMenu(this, p_39954_, p_39955_); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/test/java/com/example/examplemod/exampleclasses/ExampleColors.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,4 +1,17 @@ | ||
package com.example.examplemod.exampleclasses; | ||
|
||
import com.example.examplemod.Blocks; | ||
import com.example.regilite.events.IBlockColor; | ||
import com.example.regilite.events.IItemColor; | ||
import net.minecraft.client.color.block.BlockColor; | ||
import net.minecraft.client.color.item.ItemColor; | ||
|
||
import java.util.function.Supplier; | ||
|
||
public class ExampleColors { | ||
|
||
public static IBlockColor BLOCK = (state, getter, pos, layer) -> 0; | ||
|
||
public static IItemColor ITEM = (stack, layer) -> 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
Oops, something went wrong.