-
Notifications
You must be signed in to change notification settings - Fork 7
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
e7f899a
commit 61bd9f5
Showing
36 changed files
with
431 additions
and
35 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
37 changes: 37 additions & 0 deletions
37
...java/generations/gg/generations/core/generationscore/client/render/rarecandy/Texture.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 generations.gg.generations.core.generationscore.client.render.rarecandy; | ||
|
||
import com.mojang.blaze3d.platform.NativeImage; | ||
import gg.generations.rarecandy.pokeutils.reader.TextureReference; | ||
import gg.generations.rarecandy.renderer.loading.ITexture; | ||
import it.unimi.dsi.fastutil.io.FastByteArrayInputStream; | ||
import it.unimi.dsi.fastutil.io.FastByteArrayOutputStream; | ||
import net.minecraft.client.renderer.texture.DynamicTexture; | ||
import org.lwjgl.opengl.GL11C; | ||
import org.lwjgl.opengl.GL13C; | ||
|
||
import javax.imageio.ImageIO; | ||
import java.awt.image.BufferedImage; | ||
import java.io.IOException; | ||
|
||
public class Texture extends DynamicTexture implements ITexture { | ||
public Texture(TextureReference pixels) { | ||
super(getFromBuffered(pixels.data())); | ||
} | ||
|
||
private static NativeImage getFromBuffered(BufferedImage image) { | ||
try (FastByteArrayOutputStream outputStream = new FastByteArrayOutputStream()) { | ||
ImageIO.write(image, "PNG", outputStream); | ||
return NativeImage.read(new FastByteArrayInputStream(outputStream.array)); | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
@Override | ||
public void bind(int slot) { | ||
assert slot >= 0 && slot <= 31; | ||
|
||
GL13C.glActiveTexture('蓀' + slot); | ||
bind(); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...n/java/generations/gg/generations/core/generationscore/mixin/BlockEntityTypeAccessor.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,14 @@ | ||
package generations.gg.generations.core.generationscore.mixin; | ||
|
||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.entity.BlockEntityType; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
|
||
import java.util.Set; | ||
|
||
@Mixin(BlockEntityType.class) | ||
public interface BlockEntityTypeAccessor { | ||
@Accessor("validBlocks") | ||
Set<Block> getBlocks(); | ||
} |
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/generations/gg/generations/core/generationscore/world/level/block/BenchBlock.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 generations.gg.generations.core.generationscore.world.level.block; | ||
|
||
import generations.gg.generations.core.generationscore.world.level.block.entities.GenerationsBlockEntities; | ||
import generations.gg.generations.core.generationscore.world.level.block.entities.GenerationsBlockEntityModels; | ||
import generations.gg.generations.core.generationscore.world.level.block.entities.generic.GenericModelProvidingBlockEntity; | ||
import generations.gg.generations.core.generationscore.world.level.block.generic.GenericRotatableModelBlock; | ||
import net.minecraft.world.level.block.state.BlockBehaviour; | ||
|
||
public class BenchBlock extends GenericRotatableModelBlock<GenericModelProvidingBlockEntity> { | ||
public BenchBlock(BlockBehaviour.Properties properties) { | ||
super(properties, GenerationsBlockEntities.GENERIC_MODEL_PROVIDING, GenerationsBlockEntityModels.BENCH, 1, 0, 0); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...ain/java/generations/gg/generations/core/generationscore/world/level/block/BushBlock.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 generations.gg.generations.core.generationscore.world.level.block; | ||
|
||
import generations.gg.generations.core.generationscore.world.level.block.entities.GenerationsBlockEntities; | ||
import generations.gg.generations.core.generationscore.world.level.block.entities.GenerationsBlockEntityModels; | ||
import generations.gg.generations.core.generationscore.world.level.block.entities.generic.GenericModelProvidingBlockEntity; | ||
import generations.gg.generations.core.generationscore.world.level.block.generic.GenericRotatableModelBlock; | ||
import net.minecraft.world.level.block.state.BlockBehaviour; | ||
|
||
public class BushBlock extends GenericRotatableModelBlock<GenericModelProvidingBlockEntity> { | ||
public BushBlock(BlockBehaviour.Properties properties) { | ||
super(properties, GenerationsBlockEntities.GENERIC_MODEL_PROVIDING, GenerationsBlockEntityModels.BUSH, 0, 1, 0); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...ain/java/generations/gg/generations/core/generationscore/world/level/block/DeskBlock.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 generations.gg.generations.core.generationscore.world.level.block; | ||
|
||
import generations.gg.generations.core.generationscore.world.level.block.entities.GenerationsBlockEntities; | ||
import generations.gg.generations.core.generationscore.world.level.block.entities.GenerationsBlockEntityModels; | ||
import generations.gg.generations.core.generationscore.world.level.block.entities.generic.GenericModelProvidingBlockEntity; | ||
import generations.gg.generations.core.generationscore.world.level.block.generic.GenericRotatableModelBlock; | ||
import net.minecraft.world.level.block.state.BlockBehaviour; | ||
|
||
public class DeskBlock extends GenericRotatableModelBlock<GenericModelProvidingBlockEntity> { | ||
public DeskBlock(BlockBehaviour.Properties properties) { | ||
super(properties, GenerationsBlockEntities.GENERIC_MODEL_PROVIDING, GenerationsBlockEntityModels.DESK, 2, 1, 0); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...n/java/generations/gg/generations/core/generationscore/world/level/block/FridgeBlock.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 generations.gg.generations.core.generationscore.world.level.block; | ||
|
||
import generations.gg.generations.core.generationscore.world.level.block.entities.GenerationsBlockEntities; | ||
import generations.gg.generations.core.generationscore.world.level.block.entities.GenerationsBlockEntityModels; | ||
import generations.gg.generations.core.generationscore.world.level.block.entities.generic.GenericModelProvidingBlockEntity; | ||
import generations.gg.generations.core.generationscore.world.level.block.generic.GenericRotatableModelBlock; | ||
import net.minecraft.world.level.block.state.BlockBehaviour; | ||
|
||
public class FridgeBlock extends GenericRotatableModelBlock<GenericModelProvidingBlockEntity> { | ||
public FridgeBlock(BlockBehaviour.Properties properties) { | ||
super(properties, GenerationsBlockEntities.GENERIC_MODEL_PROVIDING, GenerationsBlockEntityModels.FRIDGE, 0, 1, 0); | ||
} | ||
} |
Oops, something went wrong.