mirror of
https://github.com/chylex/Hardcore-Ender-Expansion-2.git
synced 2025-09-15 14:32:09 +02:00
Compare commits
28 Commits
1.16
...
components
Author | SHA1 | Date | |
---|---|---|---|
b64005357e | |||
3279dde625 | |||
a9df51e315 | |||
322c005648 | |||
5211731e62 | |||
08d2fcb19c | |||
e9077c680f | |||
276df76979 | |||
14788dd9ad | |||
5b69abf29e | |||
dd6f4fa4d1 | |||
414b11aa0d | |||
14fbcac4e0 | |||
3e0aedc039 | |||
20c21f9afa | |||
f4fac58b32 | |||
f21a4fbf3f | |||
c9ad94bcb4 | |||
1a11754bad | |||
421cadb545 | |||
596042b255 | |||
f4bfd0f8e3 | |||
373087e33c | |||
a46524e518 | |||
ecd48ec345 | |||
8c21bcad67 | |||
7b54a8885a | |||
e587f212eb |
2
.idea/gradle.xml
generated
2
.idea/gradle.xml
generated
@@ -4,6 +4,8 @@
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="delegatedBuild" value="true" />
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="modules">
|
||||
|
1
.idea/misc.xml
generated
1
.idea/misc.xml
generated
@@ -14,7 +14,6 @@
|
||||
<item index="9" class="java.lang.String" itemvalue="net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.Name" />
|
||||
</list>
|
||||
</component>
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="FrameworkDetectionExcludesConfiguration">
|
||||
<file type="web" url="file://$PROJECT_DIR$" />
|
||||
</component>
|
||||
|
@@ -1,2 +1,3 @@
|
||||
# Hardcore Ender Expansion 2
|
||||
|
||||
Work in progress. PRs will not be accepted before release.
|
||||
|
20
build.gradle
20
build.gradle
@@ -1,8 +1,8 @@
|
||||
ext {
|
||||
mc_version = "1.16.4"
|
||||
forge_version = "35.1.2"
|
||||
mapping_version = "20201028-1.16.3"
|
||||
kotlin_mod_version = "1.6.2"
|
||||
mc_version = "1.15.2"
|
||||
forge_version = "31.2.45"
|
||||
mapping_version = "20200626-1.15.1"
|
||||
kotlin_mod_version = "1.6.1"
|
||||
}
|
||||
|
||||
buildscript {
|
||||
@@ -49,8 +49,16 @@ archivesBaseName = metaName.replaceAll("\\s", "")
|
||||
|
||||
idea {
|
||||
module {
|
||||
[".idea", ".settings", ".classpath", ".project", "gradle", "out", "run"].each {
|
||||
excludeDirs << file(it)
|
||||
[".idea", ".settings", ".gradle", "build", "gradle", "out", "run", "src/main/kotlin", "src/test/kotlin"].each {
|
||||
excludeDirs += file(it)
|
||||
}
|
||||
|
||||
["out", "src/main/kotlin", "src/test/kotlin"].each {
|
||||
excludeDirs += file("src/system/" + it)
|
||||
}
|
||||
|
||||
["src/main/kotlin", "src/test/kotlin"].each {
|
||||
excludeDirs += file("data/" + it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.datagen
|
||||
|
||||
import chylex.hee.HEE
|
||||
import chylex.hee.datagen.client.BlockItemModels
|
||||
import chylex.hee.datagen.client.BlockModels
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.datagen
|
||||
|
||||
import chylex.hee.HEE
|
||||
import chylex.hee.system.facades.Resource
|
||||
import net.minecraft.block.Block
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.datagen.client
|
||||
|
||||
import chylex.hee.datagen.client.util.block
|
||||
import chylex.hee.datagen.client.util.multi
|
||||
import chylex.hee.datagen.client.util.override
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.datagen.client
|
||||
|
||||
import chylex.hee.datagen.client.util.cauldron
|
||||
import chylex.hee.datagen.client.util.cross
|
||||
import chylex.hee.datagen.client.util.cube
|
||||
@@ -185,20 +186,26 @@ class BlockModels(generator: DataGenerator, modid: String, existingFileHelper: E
|
||||
}
|
||||
}
|
||||
|
||||
parent(ModBlocks.TABLE_BASE_TIER_1, Resource.Custom("block/table_tier_1")).then { Resource.Custom("block/transparent").let {
|
||||
parent(ModBlocks.TABLE_BASE_TIER_1, Resource.Custom("block/table_tier_1")).then {
|
||||
Resource.Custom("block/transparent").let {
|
||||
texture("overlay_top", it)
|
||||
texture("overlay_side", it)
|
||||
}}
|
||||
}
|
||||
}
|
||||
|
||||
parent(ModBlocks.TABLE_BASE_TIER_2, Resource.Custom("block/table_tier_2")).then { Resource.Custom("block/transparent").let {
|
||||
parent(ModBlocks.TABLE_BASE_TIER_2, Resource.Custom("block/table_tier_2")).then {
|
||||
Resource.Custom("block/transparent").let {
|
||||
texture("overlay_top", it)
|
||||
texture("overlay_side", it)
|
||||
}}
|
||||
}
|
||||
}
|
||||
|
||||
parent(ModBlocks.TABLE_BASE_TIER_3, Resource.Custom("block/table_tier_3")).then { Resource.Custom("block/transparent").let {
|
||||
parent(ModBlocks.TABLE_BASE_TIER_3, Resource.Custom("block/table_tier_3")).then {
|
||||
Resource.Custom("block/transparent").let {
|
||||
texture("overlay_top", it)
|
||||
texture("overlay_side", it)
|
||||
}}
|
||||
}
|
||||
}
|
||||
|
||||
table(ModBlocks.ACCUMULATION_TABLE_TIER_1)
|
||||
table(ModBlocks.ACCUMULATION_TABLE_TIER_2)
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.datagen.client
|
||||
|
||||
import chylex.hee.datagen.client.util.cube
|
||||
import chylex.hee.datagen.client.util.log
|
||||
import chylex.hee.datagen.client.util.pillar
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.datagen.client
|
||||
|
||||
import chylex.hee.datagen.client.util.layers
|
||||
import chylex.hee.datagen.client.util.multi
|
||||
import chylex.hee.datagen.client.util.override
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.datagen.client.util
|
||||
|
||||
import chylex.hee.datagen.Callback
|
||||
import chylex.hee.datagen.path
|
||||
import chylex.hee.datagen.r
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.datagen.client.util
|
||||
|
||||
import chylex.hee.datagen.r
|
||||
import chylex.hee.datagen.safeUnit
|
||||
import chylex.hee.system.migration.BlockLog
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.datagen.client.util
|
||||
|
||||
import chylex.hee.datagen.Callback
|
||||
import chylex.hee.datagen.path
|
||||
import chylex.hee.datagen.r
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.datagen.server
|
||||
|
||||
import chylex.hee.datagen.server.util.BlockLootTableProvider
|
||||
import chylex.hee.init.ModBlocks
|
||||
import chylex.hee.init.ModItems
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.datagen.server
|
||||
|
||||
import chylex.hee.datagen.server.util.add
|
||||
import chylex.hee.game.block.BlockWhitebarkSapling
|
||||
import chylex.hee.init.ModBlocks
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.datagen.server
|
||||
|
||||
import chylex.hee.init.ModItems
|
||||
import net.minecraft.data.DataGenerator
|
||||
import net.minecraft.data.ItemTagsProvider
|
||||
|
@@ -1,17 +1,18 @@
|
||||
package chylex.hee.datagen.server.util
|
||||
|
||||
import chylex.hee.system.migration.BlockFlowerPot
|
||||
import com.mojang.datafixers.util.Pair
|
||||
import net.minecraft.block.Block
|
||||
import net.minecraft.data.DataGenerator
|
||||
import net.minecraft.data.LootTableProvider
|
||||
import net.minecraft.data.loot.BlockLootTables
|
||||
import net.minecraft.loot.LootParameterSet
|
||||
import net.minecraft.loot.LootParameterSets
|
||||
import net.minecraft.loot.LootTable
|
||||
import net.minecraft.loot.LootTable.Builder
|
||||
import net.minecraft.loot.ValidationTracker
|
||||
import net.minecraft.util.IItemProvider
|
||||
import net.minecraft.util.ResourceLocation
|
||||
import net.minecraft.world.storage.loot.LootParameterSet
|
||||
import net.minecraft.world.storage.loot.LootParameterSets
|
||||
import net.minecraft.world.storage.loot.LootTable
|
||||
import net.minecraft.world.storage.loot.LootTable.Builder
|
||||
import net.minecraft.world.storage.loot.ValidationTracker
|
||||
import java.util.function.BiConsumer
|
||||
import java.util.function.Consumer
|
||||
import java.util.function.Supplier
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.datagen.server.util
|
||||
|
||||
import net.minecraft.tags.Tag
|
||||
|
||||
fun <T> Tag.Builder<T>.add(items: List<T>) {
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee
|
||||
|
||||
import chylex.hee.game.block.BlockBrewingStandCustom
|
||||
import chylex.hee.game.block.BlockEndPortalOverride
|
||||
import chylex.hee.game.block.BlockShulkerBoxOverride
|
||||
@@ -25,6 +26,7 @@ import chylex.hee.system.Debug
|
||||
import chylex.hee.system.forge.SubscribeAllEvents
|
||||
import chylex.hee.system.forge.SubscribeEvent
|
||||
import net.minecraft.block.Blocks
|
||||
import net.minecraft.world.dimension.DimensionType
|
||||
import net.minecraftforge.fml.DistExecutor
|
||||
import net.minecraftforge.fml.DistExecutor.SafeSupplier
|
||||
import net.minecraftforge.fml.ModLoadingContext
|
||||
|
@@ -1,17 +1,16 @@
|
||||
package chylex.hee.client
|
||||
|
||||
import chylex.hee.HEE
|
||||
import chylex.hee.system.facades.Resource
|
||||
import chylex.hee.system.migration.supply
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.minecraft.resources.IPackFinder
|
||||
import net.minecraft.resources.IPackNameDecorator
|
||||
import net.minecraft.resources.IResourcePack
|
||||
import net.minecraft.resources.ResourcePackInfo
|
||||
import net.minecraft.resources.ResourcePackInfo.IFactory
|
||||
import net.minecraft.resources.ResourcePackInfo.Priority
|
||||
import net.minecraft.resources.ResourcePackType
|
||||
import net.minecraftforge.fml.packs.ResourcePackLoader
|
||||
import java.util.function.Consumer
|
||||
|
||||
object VanillaResourceOverrides : IPackFinder {
|
||||
fun register() {
|
||||
@@ -21,11 +20,11 @@ object VanillaResourceOverrides : IPackFinder{
|
||||
}
|
||||
}
|
||||
|
||||
override fun findPacks(consumer: Consumer<ResourcePackInfo>, factory: IFactory) {
|
||||
override fun <T : ResourcePackInfo> addPackInfosToMap(map: MutableMap<String, T>, factory: IFactory<T>) {
|
||||
val delegate = ResourcePackLoader.getResourcePackFor(HEE.ID).get()
|
||||
val supplier = supply<IResourcePack>(Pack(delegate))
|
||||
|
||||
consumer.accept(ResourcePackInfo.createResourcePack("HEE 2", true /* isAlwaysEnabled */, supplier, factory, Priority.TOP, IPackNameDecorator.BUILTIN)!!)
|
||||
map[HEE.ID] = ResourcePackInfo.createResourcePack("HEE 2", true /* isAlwaysEnabled */, supplier, factory, Priority.TOP)!!
|
||||
}
|
||||
|
||||
private class Pack(delegate: IResourcePack) : IResourcePack by delegate {
|
||||
|
@@ -1,12 +1,13 @@
|
||||
package chylex.hee.client.gui
|
||||
|
||||
import chylex.hee.client.gui.base.GuiBaseChestContainer
|
||||
import chylex.hee.game.container.ContainerAmuletOfRecovery
|
||||
import chylex.hee.network.server.PacketServerContainerEvent
|
||||
import chylex.hee.system.forge.Side
|
||||
import chylex.hee.system.forge.Sided
|
||||
import net.minecraft.client.resources.I18n
|
||||
import net.minecraft.entity.player.PlayerInventory
|
||||
import net.minecraft.util.text.ITextComponent
|
||||
import net.minecraft.util.text.TranslationTextComponent
|
||||
import net.minecraftforge.fml.client.gui.widget.ExtendedButton
|
||||
|
||||
@Sided(Side.CLIENT)
|
||||
@@ -14,8 +15,8 @@ class GuiAmuletOfRecovery(container: ContainerAmuletOfRecovery, inventory: Playe
|
||||
override fun init() {
|
||||
super.init()
|
||||
|
||||
val moveAllTitle = TranslationTextComponent("gui.hee.amulet_of_recovery.move_all")
|
||||
val moveAllWidth = (font.getStringPropertyWidth(moveAllTitle) + 14).coerceAtMost(xSize / 2)
|
||||
val moveAllTitle = I18n.format("gui.hee.amulet_of_recovery.move_all")
|
||||
val moveAllWidth = (font.getStringWidth(moveAllTitle) + 14).coerceAtMost(xSize / 2)
|
||||
|
||||
addButton(ExtendedButton(guiLeft + xSize - moveAllWidth - 7, (height / 2) + 6, moveAllWidth, 11, moveAllTitle) {
|
||||
PacketServerContainerEvent(0).sendToServer()
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.gui
|
||||
|
||||
import chylex.hee.client.MC
|
||||
import chylex.hee.client.render.gl.GL
|
||||
import chylex.hee.game.block.entity.TileEntityBrewingStandCustom
|
||||
@@ -6,7 +7,6 @@ import chylex.hee.game.world.totalTime
|
||||
import chylex.hee.system.facades.Resource
|
||||
import chylex.hee.system.forge.Side
|
||||
import chylex.hee.system.forge.Sided
|
||||
import com.mojang.blaze3d.matrix.MatrixStack
|
||||
import net.minecraft.client.gui.screen.inventory.BrewingStandScreen
|
||||
import net.minecraft.entity.player.PlayerInventory
|
||||
import net.minecraft.inventory.container.BrewingStandContainer
|
||||
@@ -21,13 +21,13 @@ class GuiBrewingStandCustom(container: BrewingStandContainer, inventory: PlayerI
|
||||
|
||||
private var brewStartTime = MC.world!!.totalTime
|
||||
|
||||
override fun drawGuiContainerBackgroundLayer(matrix: MatrixStack, partialTicks: Float, mouseX: Int, mouseY: Int){
|
||||
override fun drawGuiContainerBackgroundLayer(partialTicks: Float, mouseX: Int, mouseY: Int) {
|
||||
val x = (width - xSize) / 2
|
||||
val y = (height - ySize) / 2
|
||||
|
||||
GL.color(1F, 1F, 1F, 1F)
|
||||
GL.bindTexture(TEX_BACKGROUND)
|
||||
blit(matrix, x, y, 0, 0, xSize, ySize)
|
||||
blit(x, y, 0, 0, xSize, ySize)
|
||||
|
||||
val worldTime = MC.world!!.totalTime
|
||||
val brewTime = container.func_216981_f() // RENAME getBrewTime
|
||||
@@ -36,13 +36,13 @@ class GuiBrewingStandCustom(container: BrewingStandContainer, inventory: PlayerI
|
||||
val brewProgress = (28F * (1F - (brewTime / 400F))).toInt()
|
||||
|
||||
if (brewProgress > 0) {
|
||||
blit(matrix, x + 97, y + 16, 176, 0, 9, brewProgress)
|
||||
blit(x + 97, y + 16, 176, 0, 9, brewProgress)
|
||||
}
|
||||
|
||||
val bubbleLength = BUBBLE_LENGTHS[((worldTime - brewStartTime).toInt() / 2) % 7]
|
||||
|
||||
if (bubbleLength > 0) {
|
||||
blit(matrix, x + 63, y + 43 - bubbleLength, 185, 29 - bubbleLength, 12, bubbleLength)
|
||||
blit(x + 63, y + 43 - bubbleLength, 185, 29 - bubbleLength, 12, bubbleLength)
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -50,14 +50,14 @@ class GuiBrewingStandCustom(container: BrewingStandContainer, inventory: PlayerI
|
||||
}
|
||||
|
||||
if (container.getSlot(TileEntityBrewingStandCustom.SLOT_MODIFIER).hasStack) {
|
||||
blit(matrix, x + 62, y + 45, 197, 0, 14, 2)
|
||||
blit(x + 62, y + 45, 197, 0, 14, 2)
|
||||
}
|
||||
|
||||
for(slotIndex in TileEntityBrewingStandCustom.SLOTS_POTIONS) {
|
||||
val slot = container.getSlot(slotIndex)
|
||||
|
||||
if (!slot.hasStack) {
|
||||
blit(matrix, x + slot.xPos, y + slot.yPos, 211, 0, 16, 16)
|
||||
blit(x + slot.xPos, y + slot.yPos, 211, 0, 16, 16)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.gui
|
||||
|
||||
import chylex.hee.client.gui.base.GuiBaseChestContainer
|
||||
import chylex.hee.game.block.entity.TileEntityLootChest
|
||||
import chylex.hee.game.container.ContainerLootChest
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.gui
|
||||
|
||||
import chylex.hee.client.gui.base.GuiBaseChestContainer
|
||||
import chylex.hee.game.container.ContainerPortalTokenStorage
|
||||
import chylex.hee.system.forge.Side
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.gui
|
||||
|
||||
import chylex.hee.client.gui.base.GuiBaseChestContainer
|
||||
import chylex.hee.game.container.ContainerShulkerBox
|
||||
import chylex.hee.system.forge.Side
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.gui
|
||||
|
||||
import chylex.hee.client.gui.base.GuiBaseCustomInventory
|
||||
import chylex.hee.game.container.ContainerTrinketPouch
|
||||
import chylex.hee.game.container.base.ContainerBaseCustomInventory
|
||||
@@ -7,7 +8,6 @@ import chylex.hee.system.color.IntColor.Companion.RGBA
|
||||
import chylex.hee.system.facades.Resource
|
||||
import chylex.hee.system.forge.Side
|
||||
import chylex.hee.system.forge.Sided
|
||||
import com.mojang.blaze3d.matrix.MatrixStack
|
||||
import net.minecraft.entity.player.PlayerInventory
|
||||
import net.minecraft.util.text.ITextComponent
|
||||
|
||||
@@ -24,19 +24,19 @@ class GuiTrinketPouch(container: ContainerTrinketPouch, inventory: PlayerInvento
|
||||
hiddenSlots = ContainerTrinketPouch.MAX_SLOTS - (container as ContainerBaseCustomInventory<*>).containerInventory.size
|
||||
}
|
||||
|
||||
override fun drawGuiContainerBackgroundLayer(matrix: MatrixStack, partialTicks: Float, mouseX: Int, mouseY: Int){
|
||||
super.drawGuiContainerBackgroundLayer(matrix, partialTicks, mouseX, mouseY)
|
||||
override fun drawGuiContainerBackgroundLayer(partialTicks: Float, mouseX: Int, mouseY: Int) {
|
||||
super.drawGuiContainerBackgroundLayer(partialTicks, mouseX, mouseY)
|
||||
|
||||
val middleSlot = ContainerTrinketPouch.MAX_SLOTS / 2
|
||||
|
||||
repeat(hiddenSlots) {
|
||||
renderSlotCover(matrix, middleSlot + ((ContainerTrinketPouch.MAX_SLOTS - it) / 2) * (if (it % 2 == 0) -1 else 1))
|
||||
renderSlotCover(middleSlot + ((ContainerTrinketPouch.MAX_SLOTS - it) / 2) * (if (it % 2 == 0) -1 else 1))
|
||||
}
|
||||
}
|
||||
|
||||
private fun renderSlotCover(matrix: MatrixStack, index: Int){
|
||||
private fun renderSlotCover(index: Int) {
|
||||
val x = guiLeft + 44 + (index * 18)
|
||||
val y = guiTop + 18
|
||||
fill(matrix, x, y, x + 16, y + 16, hiddenSlotColor)
|
||||
fill(x, y, x + 16, y + 16, hiddenSlotColor)
|
||||
}
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
package chylex.hee.client.gui.base
|
||||
|
||||
import chylex.hee.client.render.gl.GL
|
||||
import chylex.hee.game.inventory.size
|
||||
import chylex.hee.system.color.IntColor.Companion.RGB
|
||||
import chylex.hee.system.facades.Resource
|
||||
import chylex.hee.system.forge.Side
|
||||
import chylex.hee.system.forge.Sided
|
||||
import com.mojang.blaze3d.matrix.MatrixStack
|
||||
import net.minecraft.client.gui.screen.inventory.ContainerScreen
|
||||
import net.minecraft.entity.player.PlayerInventory
|
||||
import net.minecraft.inventory.container.ChestContainer
|
||||
@@ -24,25 +24,25 @@ abstract class GuiBaseChestContainer<T : ChestContainer>(container: T, inventory
|
||||
ySize = 114 + (containerRows * 18)
|
||||
}
|
||||
|
||||
override fun render(matrix: MatrixStack, mouseX: Int, mouseY: Int, partialTicks: Float){
|
||||
renderBackground(matrix)
|
||||
super.render(matrix, mouseX, mouseY, partialTicks)
|
||||
renderHoveredTooltip(matrix, mouseX, mouseY)
|
||||
override fun render(mouseX: Int, mouseY: Int, partialTicks: Float) {
|
||||
renderBackground()
|
||||
super.render(mouseX, mouseY, partialTicks)
|
||||
renderHoveredToolTip(mouseX, mouseY)
|
||||
}
|
||||
|
||||
override fun drawGuiContainerBackgroundLayer(matrix: MatrixStack, partialTicks: Float, mouseX: Int, mouseY: Int){
|
||||
override fun drawGuiContainerBackgroundLayer(partialTicks: Float, mouseX: Int, mouseY: Int) {
|
||||
val x = (width - xSize) / 2
|
||||
val y = (height - ySize) / 2
|
||||
val heightContainer = 17 + (containerRows * 18)
|
||||
|
||||
GL.color(1F, 1F, 1F, 1F)
|
||||
GL.bindTexture(TEX_BACKGROUND)
|
||||
blit(matrix, x, y, 0, 0, xSize, heightContainer)
|
||||
blit(matrix, x, y + heightContainer, 0, 126, xSize, 96)
|
||||
blit(x, y, 0, 0, xSize, heightContainer)
|
||||
blit(x, y + heightContainer, 0, 126, xSize, 96)
|
||||
}
|
||||
|
||||
override fun drawGuiContainerForegroundLayer(matrix: MatrixStack, mouseX: Int, mouseY: Int){
|
||||
font.drawString(matrix, title.string, 8F, 6F, COLOR_TEXT)
|
||||
font.drawString(matrix, playerInventory.displayName.string, 8F, ySize - 94F, COLOR_TEXT)
|
||||
override fun drawGuiContainerForegroundLayer(mouseX: Int, mouseY: Int) {
|
||||
font.drawString(title.formattedText, 8F, 6F, COLOR_TEXT)
|
||||
font.drawString(playerInventory.displayName.formattedText, 8F, ySize - 94F, COLOR_TEXT)
|
||||
}
|
||||
}
|
||||
|
@@ -1,10 +1,10 @@
|
||||
package chylex.hee.client.gui.base
|
||||
|
||||
import chylex.hee.client.render.gl.GL
|
||||
import chylex.hee.game.container.base.ContainerBaseCustomInventory
|
||||
import chylex.hee.system.color.IntColor.Companion.RGB
|
||||
import chylex.hee.system.forge.Side
|
||||
import chylex.hee.system.forge.Sided
|
||||
import com.mojang.blaze3d.matrix.MatrixStack
|
||||
import net.minecraft.client.gui.screen.inventory.ContainerScreen
|
||||
import net.minecraft.entity.player.PlayerInventory
|
||||
import net.minecraft.util.ResourceLocation
|
||||
@@ -19,23 +19,23 @@ abstract class GuiBaseCustomInventory<T : ContainerBaseCustomInventory<*>>(conta
|
||||
protected abstract val texBackground: ResourceLocation
|
||||
protected abstract val titleContainer: String
|
||||
|
||||
override fun render(matrix: MatrixStack, mouseX: Int, mouseY: Int, partialTicks: Float){
|
||||
renderBackground(matrix)
|
||||
super.render(matrix, mouseX, mouseY, partialTicks)
|
||||
renderHoveredTooltip(matrix, mouseX, mouseY)
|
||||
override fun render(mouseX: Int, mouseY: Int, partialTicks: Float) {
|
||||
renderBackground()
|
||||
super.render(mouseX, mouseY, partialTicks)
|
||||
renderHoveredToolTip(mouseX, mouseY)
|
||||
}
|
||||
|
||||
override fun drawGuiContainerBackgroundLayer(matrix: MatrixStack, partialTicks: Float, mouseX: Int, mouseY: Int){
|
||||
override fun drawGuiContainerBackgroundLayer(partialTicks: Float, mouseX: Int, mouseY: Int) {
|
||||
val x = (width - xSize) / 2
|
||||
val y = (height - ySize) / 2
|
||||
|
||||
GL.color(1F, 1F, 1F, 1F)
|
||||
GL.bindTexture(texBackground)
|
||||
blit(matrix, x, y, 0, 0, xSize, ySize)
|
||||
blit(x, y, 0, 0, xSize, ySize)
|
||||
}
|
||||
|
||||
override fun drawGuiContainerForegroundLayer(matrix: MatrixStack, mouseX: Int, mouseY: Int){
|
||||
font.drawString(matrix, title.string, 8F, 6F, COLOR_TEXT)
|
||||
font.drawString(matrix, playerInventory.displayName.string, 8F, ySize - 94F, COLOR_TEXT)
|
||||
override fun drawGuiContainerForegroundLayer(mouseX: Int, mouseY: Int) {
|
||||
font.drawString(title.formattedText, 8F, 6F, COLOR_TEXT)
|
||||
font.drawString(playerInventory.displayName.formattedText, 8F, ySize - 94F, COLOR_TEXT)
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.model.block
|
||||
|
||||
import chylex.hee.client.model.beginBox
|
||||
import chylex.hee.client.render.gl.translateZ
|
||||
import chylex.hee.system.forge.Side
|
||||
@@ -8,7 +9,7 @@ import com.mojang.blaze3d.vertex.IVertexBuilder
|
||||
import net.minecraft.client.renderer.RenderType
|
||||
import net.minecraft.client.renderer.model.Model
|
||||
import net.minecraft.client.renderer.model.ModelRenderer
|
||||
import net.minecraft.util.math.vector.Vector3d
|
||||
import net.minecraft.util.math.Vec3d
|
||||
import kotlin.math.PI
|
||||
import kotlin.math.abs
|
||||
import kotlin.math.sin
|
||||
@@ -40,7 +41,7 @@ object ModelBlockIgneousPlate : Model(RenderType::getEntityCutout){
|
||||
outerBox.render(matrix, builder, combinedLight, combinedOverlay, red, green, blue, alpha)
|
||||
}
|
||||
|
||||
fun renderInnerBox(matrix: MatrixStack, builder: IVertexBuilder, combinedLight: Int, combinedOverlay: Int, color: Vector3d, animation: Double){
|
||||
fun renderInnerBox(matrix: MatrixStack, builder: IVertexBuilder, combinedLight: Int, combinedOverlay: Int, color: Vec3d, animation: Double) {
|
||||
matrix.push()
|
||||
matrix.translateZ(-abs(sin(-animation)).toFloat() * 0.0925)
|
||||
innerBox.render(matrix, builder, combinedLight, combinedOverlay, color.x.toFloat(), color.y.toFloat(), color.z.toFloat(), 1F)
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.model.entity
|
||||
|
||||
import chylex.hee.client.model.FACE_FRONT
|
||||
import chylex.hee.client.model.beginBox
|
||||
import chylex.hee.client.model.retainFace
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.model.entity
|
||||
|
||||
import chylex.hee.client.MC
|
||||
import chylex.hee.client.model.FACE_FRONT
|
||||
import chylex.hee.client.model.beginBox
|
||||
@@ -56,9 +57,9 @@ object ModelEntityMobBlobby : EntityModel<EntityMobBlobby>(){
|
||||
|
||||
override fun setLivingAnimations(entity: EntityMobBlobby, limbSwing: Float, limbSwingAmount: Float, partialTicks: Float) {
|
||||
entity.color.let {
|
||||
r = it.red / 255F
|
||||
g = it.green / 255F
|
||||
b = it.blue / 255F
|
||||
r = it.redF
|
||||
g = it.greenF
|
||||
b = it.blueF
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,11 +1,12 @@
|
||||
package chylex.hee.client.model.entity
|
||||
|
||||
import chylex.hee.game.entity.living.EntityMobUndread
|
||||
import chylex.hee.system.forge.Side
|
||||
import chylex.hee.system.forge.Sided
|
||||
import net.minecraft.client.renderer.entity.model.AbstractZombieModel
|
||||
|
||||
@Sided(Side.CLIENT)
|
||||
class ModelEntityUndread private constructor(modelSize: Float, textureWidth: Int, textureHeight: Int) : AbstractZombieModel<EntityMobUndread>(modelSize, 0F, textureWidth, textureHeight){
|
||||
class ModelEntityMobUndread private constructor(modelSize: Float, textureWidth: Int, textureHeight: Int) : AbstractZombieModel<EntityMobUndread>(modelSize, 0F, textureWidth, textureHeight) {
|
||||
constructor(modelSize: Float, tallTexture: Boolean) : this(modelSize, 64, if (tallTexture) 32 else 64)
|
||||
constructor() : this(0F, false)
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.model.entity
|
||||
|
||||
import chylex.hee.client.model.beginBox
|
||||
import chylex.hee.game.entity.item.EntityTokenHolder
|
||||
import chylex.hee.system.forge.Side
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.model.item
|
||||
|
||||
import chylex.hee.HEE
|
||||
import chylex.hee.client.MC
|
||||
import chylex.hee.system.facades.Resource
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render
|
||||
|
||||
import chylex.hee.HEE
|
||||
import chylex.hee.client.MC
|
||||
import chylex.hee.client.render.gl.DF_ONE_MINUS_SRC_ALPHA
|
||||
@@ -78,7 +79,7 @@ object OverlayRenderer{
|
||||
GL.bindTexture(TEX_PURIFIED_ENDER_GOO_OVERLAY)
|
||||
}
|
||||
|
||||
MC.instance.ingameGUI.blit(e.matrixStack, 0, 0, 0, 0, window.scaledWidth, window.scaledHeight)
|
||||
MC.instance.ingameGUI.blit(0, 0, 0, 0, window.scaledWidth, window.scaledHeight)
|
||||
|
||||
GL.color(1F, 1F, 1F, 1F)
|
||||
}
|
||||
@@ -90,7 +91,6 @@ object OverlayRenderer{
|
||||
fun onRenderText(@Suppress("UNUSED_PARAMETER") e: RenderGameOverlayEvent.Text) {
|
||||
fun drawTextOffScreenCenter(x: Int, y: Int, line: Int, text: String, color: IntColor) {
|
||||
val window = MC.window
|
||||
val matrix = e.matrixStack
|
||||
|
||||
with(MC.fontRenderer) {
|
||||
val centerX = x + (window.scaledWidth / 2)
|
||||
@@ -102,8 +102,8 @@ object OverlayRenderer{
|
||||
val offsetX = -(textWidth / 2)
|
||||
val offsetY = -(textHeight / 2)
|
||||
|
||||
AbstractGui.fill(matrix, centerX + offsetX - BORDER_SIZE, centerY + offsetY - BORDER_SIZE, centerX - offsetX + BORDER_SIZE - 1, centerY - offsetY + BORDER_SIZE - 1, RGBA(0u, 0.6F).i)
|
||||
drawStringWithShadow(matrix, text, (centerX + offsetX).toFloat(), (centerY + offsetY).toFloat(), color.i)
|
||||
AbstractGui.fill(centerX + offsetX - BORDER_SIZE, centerY + offsetY - BORDER_SIZE, centerX - offsetX + BORDER_SIZE - 1, centerY - offsetY + BORDER_SIZE - 1, RGBA(0u, 0.6F).i)
|
||||
drawStringWithShadow(text, (centerX + offsetX).toFloat(), (centerY + offsetY).toFloat(), color.i)
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,20 +1,24 @@
|
||||
package chylex.hee.client.render
|
||||
|
||||
import chylex.hee.HEE
|
||||
import chylex.hee.client.MC
|
||||
import chylex.hee.client.render.gl.DF_ONE_MINUS_SRC_ALPHA
|
||||
import chylex.hee.client.render.gl.DF_ZERO
|
||||
import chylex.hee.client.render.gl.FOG_EXP2
|
||||
import chylex.hee.client.render.gl.GL
|
||||
import chylex.hee.client.render.gl.SF_ONE
|
||||
import chylex.hee.client.render.gl.SF_SRC_ALPHA
|
||||
import chylex.hee.game.entity.dimensionKey
|
||||
import chylex.hee.client.render.territory.AbstractEnvironmentRenderer
|
||||
import chylex.hee.game.entity.lookDirVec
|
||||
import chylex.hee.game.entity.posVec
|
||||
import chylex.hee.game.particle.ParticleVoid
|
||||
import chylex.hee.game.particle.spawner.ParticleSpawnerCustom
|
||||
import chylex.hee.game.particle.spawner.properties.IOffset.InBox
|
||||
import chylex.hee.game.particle.spawner.properties.IShape.Point
|
||||
import chylex.hee.game.world.WorldProviderEndCustom
|
||||
import chylex.hee.game.world.territory.TerritoryType
|
||||
import chylex.hee.game.world.territory.TerritoryVoid
|
||||
import chylex.hee.game.world.territory.properties.TerritoryEnvironment
|
||||
import chylex.hee.system.Debug
|
||||
import chylex.hee.system.color.IntColor
|
||||
import chylex.hee.system.color.IntColor.Companion.RGB
|
||||
@@ -23,11 +27,13 @@ import chylex.hee.system.forge.Side
|
||||
import chylex.hee.system.forge.SubscribeAllEvents
|
||||
import chylex.hee.system.forge.SubscribeEvent
|
||||
import chylex.hee.system.math.LerpedFloat
|
||||
import chylex.hee.system.math.Vec3
|
||||
import chylex.hee.system.math.floorToInt
|
||||
import chylex.hee.system.math.scale
|
||||
import chylex.hee.system.migration.EntityPlayer
|
||||
import com.mojang.blaze3d.matrix.MatrixStack
|
||||
import net.minecraft.client.resources.I18n
|
||||
import net.minecraft.world.dimension.DimensionType
|
||||
import net.minecraftforge.client.event.EntityViewRenderEvent.RenderFogEvent
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent
|
||||
import net.minecraftforge.common.MinecraftForge
|
||||
import net.minecraftforge.event.TickEvent.ClientTickEvent
|
||||
@@ -38,6 +44,17 @@ import kotlin.math.pow
|
||||
|
||||
@SubscribeAllEvents(Side.CLIENT, modid = HEE.ID)
|
||||
object TerritoryRenderer {
|
||||
@JvmStatic
|
||||
val environment
|
||||
get() = MC.player?.let { TerritoryType.fromX(it.posX.floorToInt()) }?.desc?.environment
|
||||
|
||||
@JvmStatic
|
||||
val skyColor
|
||||
get() = (environment?.let(TerritoryEnvironment::fogColor) ?: Vec3.ZERO).let {
|
||||
// use fog color because vanilla blends fog into sky color based on chunk render distance
|
||||
RGB((it.x * 255).floorToInt(), (it.y * 255).floorToInt(), (it.z * 255).floorToInt()).i
|
||||
}
|
||||
|
||||
private var prevChunkX = Int.MAX_VALUE
|
||||
private var prevTerritory: TerritoryType? = null
|
||||
|
||||
@@ -46,7 +63,7 @@ object TerritoryRenderer{
|
||||
if (e.phase == Phase.START) {
|
||||
val player = MC.player
|
||||
|
||||
if (player != null && player.dimensionKey === HEE.dim && player.ticksExisted > 0){
|
||||
if (player != null && player.world.dimension is WorldProviderEndCustom && player.ticksExisted > 0) {
|
||||
Void.tick(player)
|
||||
Title.tick()
|
||||
|
||||
@@ -80,6 +97,25 @@ object TerritoryRenderer{
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
fun onFog(@Suppress("UNUSED_PARAMETER") e: RenderFogEvent) {
|
||||
val player = MC.player?.takeIf { it.world.dimension.type == DimensionType.THE_END } ?: return
|
||||
val territory = TerritoryType.fromPos(player)
|
||||
|
||||
if (territory == null || WorldProviderEndCustom.debugMode) {
|
||||
GL.setFogMode(FOG_EXP2)
|
||||
GL.setFogDensity(0F)
|
||||
}
|
||||
else {
|
||||
val env = territory.desc.environment
|
||||
val density = env.fogDensity * AbstractEnvironmentRenderer.currentFogDensityMp
|
||||
val modifier = env.fogRenderDistanceModifier * AbstractEnvironmentRenderer.currentRenderDistanceMp
|
||||
|
||||
GL.setFogMode(FOG_EXP2)
|
||||
GL.setFogDensity(density + modifier)
|
||||
}
|
||||
}
|
||||
|
||||
// Void handling
|
||||
|
||||
val VOID_FACTOR_VALUE
|
||||
@@ -123,7 +159,7 @@ object TerritoryRenderer{
|
||||
|
||||
@SubscribeEvent
|
||||
fun onRenderGameOverlayText(e: RenderGameOverlayEvent.Text) {
|
||||
if (MC.settings.showDebugInfo && MC.player?.dimensionKey === HEE.dim){
|
||||
if (MC.settings.showDebugInfo && MC.player?.dimension === HEE.dim) {
|
||||
with(e.left) {
|
||||
add("")
|
||||
add("End Void Factor: ${"%.3f".format(voidFactor.currentValue)}")
|
||||
@@ -204,8 +240,8 @@ object TerritoryRenderer{
|
||||
val x = -fontRenderer.getStringWidth(textTitle) * 0.5F
|
||||
val y = -fontRenderer.FONT_HEIGHT - 2F
|
||||
|
||||
drawTitle(e.matrixStack, x + 0.5F, y + 0.5F, textShadowColor.withAlpha(opacity.pow(1.25F)))
|
||||
drawTitle(e.matrixStack, x, y, textMainColor.withAlpha(opacity))
|
||||
drawTitle(x + 0.5F, y + 0.5F, textShadowColor.withAlpha(opacity.pow(1.25F)))
|
||||
drawTitle(x, y, textMainColor.withAlpha(opacity))
|
||||
|
||||
GL.popMatrix()
|
||||
GL.alphaFunc(GL_GREATER, 0.1F)
|
||||
@@ -213,9 +249,9 @@ object TerritoryRenderer{
|
||||
GL.popMatrix()
|
||||
}
|
||||
|
||||
private fun drawTitle(matrix: MatrixStack, x: Float, y: Float, color: IntColor){
|
||||
private fun drawTitle(x: Float, y: Float, color: IntColor) {
|
||||
if (color.alpha > 3) { // prevents flickering alpha
|
||||
MC.fontRenderer.drawString(matrix, textTitle, x, y, color.i)
|
||||
MC.fontRenderer.drawString(textTitle, x, y, color.i)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,8 +1,10 @@
|
||||
package chylex.hee.client.render.block
|
||||
|
||||
import chylex.hee.client.MC
|
||||
import chylex.hee.client.render.gl.DF_ONE
|
||||
import chylex.hee.client.render.gl.DF_ONE_MINUS_SRC_ALPHA
|
||||
import chylex.hee.client.render.gl.RenderStateBuilder
|
||||
import chylex.hee.client.render.gl.RenderStateBuilder.Companion.FOG_BLACK
|
||||
import chylex.hee.client.render.gl.RenderStateBuilder.Companion.FOG_ENABLED
|
||||
import chylex.hee.client.render.gl.SF_SRC_ALPHA
|
||||
import chylex.hee.game.block.BlockAbstractPortal
|
||||
@@ -23,12 +25,12 @@ import chylex.hee.system.math.toRadians
|
||||
import com.mojang.blaze3d.matrix.MatrixStack
|
||||
import com.mojang.blaze3d.vertex.IVertexBuilder
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer
|
||||
import net.minecraft.client.renderer.Matrix4f
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats
|
||||
import net.minecraft.util.math.BlockPos
|
||||
import net.minecraft.util.math.vector.Matrix4f
|
||||
import net.minecraft.util.math.vector.Vector3d
|
||||
import net.minecraft.util.math.Vec3d
|
||||
import net.minecraft.world.World
|
||||
import org.lwjgl.opengl.GL11
|
||||
import java.util.Random
|
||||
@@ -54,7 +56,7 @@ abstract class RenderTileAbstractPortal<T : TileEntityPortalInner, C : IPortalCo
|
||||
private val RENDER_TYPE_LAYER = Array(16) {
|
||||
with(RenderStateBuilder()) {
|
||||
tex(TEX_PARTICLE_LAYER)
|
||||
fog(FOG_ENABLED)
|
||||
fog(FOG_BLACK)
|
||||
blend(SF_SRC_ALPHA, DF_ONE)
|
||||
buildType("hee:portal_layer_${it}", DefaultVertexFormats.POSITION_COLOR_TEX, GL11.GL_QUADS, bufferSize = 256)
|
||||
}
|
||||
@@ -209,7 +211,7 @@ abstract class RenderTileAbstractPortal<T : TileEntityPortalInner, C : IPortalCo
|
||||
builder.pos(mat, sizeNB, yB, sizeNB).color().tex(texW, 0F).endVertex()
|
||||
}
|
||||
|
||||
private fun renderLayer(mat: Matrix4f, builder: IVertexBuilder, layer: Int, dist: Int, diff: Vector3d){
|
||||
private fun renderLayer(mat: Matrix4f, builder: IVertexBuilder, layer: Int, dist: Int, diff: Vec3d) {
|
||||
val layerIndexRev = 16 - layer
|
||||
val parallaxMp = (1F + abs(diff.y.toFloat() / 32F)).pow(0.12F)
|
||||
|
||||
|
@@ -1,10 +1,11 @@
|
||||
package chylex.hee.client.render.block
|
||||
|
||||
import chylex.hee.game.block.entity.TileEntityDarkChest
|
||||
import chylex.hee.init.ModAtlases
|
||||
import chylex.hee.system.facades.Resource
|
||||
import chylex.hee.system.forge.Side
|
||||
import chylex.hee.system.forge.Sided
|
||||
import net.minecraft.client.renderer.model.RenderMaterial
|
||||
import net.minecraft.client.renderer.model.Material
|
||||
import net.minecraft.client.renderer.tileentity.ChestTileEntityRenderer
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher
|
||||
import net.minecraft.state.properties.ChestType
|
||||
@@ -18,9 +19,9 @@ class RenderTileDarkChest(dispatcher: TileEntityRendererDispatcher) : ChestTileE
|
||||
val TEX_DOUBLE_LEFT = Resource.Custom("entity/dark_chest_left")
|
||||
val TEX_DOUBLE_RIGHT = Resource.Custom("entity/dark_chest_right")
|
||||
|
||||
private val MAT_SINGLE = RenderMaterial(ModAtlases.ATLAS_TILES, TEX_SINGLE)
|
||||
private val MAT_DOUBLE_LEFT = RenderMaterial(ModAtlases.ATLAS_TILES, TEX_DOUBLE_LEFT)
|
||||
private val MAT_DOUBLE_RIGHT = RenderMaterial(ModAtlases.ATLAS_TILES, TEX_DOUBLE_RIGHT)
|
||||
private val MAT_SINGLE = Material(ModAtlases.ATLAS_TILES, TEX_SINGLE)
|
||||
private val MAT_DOUBLE_LEFT = Material(ModAtlases.ATLAS_TILES, TEX_DOUBLE_LEFT)
|
||||
private val MAT_DOUBLE_RIGHT = Material(ModAtlases.ATLAS_TILES, TEX_DOUBLE_RIGHT)
|
||||
}
|
||||
|
||||
init {
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.block
|
||||
|
||||
import chylex.hee.HEE
|
||||
import chylex.hee.game.block.BlockAbstractPortal
|
||||
import chylex.hee.game.block.BlockAbstractPortal.IPortalController
|
||||
@@ -20,7 +21,7 @@ class RenderTileEndPortal(dispatcher: TileEntityRendererDispatcher) : RenderTile
|
||||
}
|
||||
|
||||
override fun findController(world: World, pos: BlockPos): IPortalController? {
|
||||
if (world.dimensionKey === HEE.dim){
|
||||
if (world.dimension.type === HEE.dim) {
|
||||
return AlwaysOnController
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.block
|
||||
|
||||
import chylex.hee.HEE
|
||||
import chylex.hee.client.render.gl.RenderStateBuilder
|
||||
import chylex.hee.client.render.gl.RenderStateBuilder.Companion.ALPHA_CUTOUT
|
||||
@@ -14,6 +15,7 @@ import chylex.hee.system.math.floorToInt
|
||||
import com.mojang.blaze3d.matrix.MatrixStack
|
||||
import com.mojang.blaze3d.vertex.IVertexBuilder
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer
|
||||
import net.minecraft.client.renderer.Matrix4f
|
||||
import net.minecraft.client.renderer.WorldRenderer
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer
|
||||
@@ -21,7 +23,6 @@ import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats
|
||||
import net.minecraft.inventory.container.PlayerContainer
|
||||
import net.minecraft.util.math.BlockPos
|
||||
import net.minecraft.util.math.vector.Matrix4f
|
||||
import net.minecraft.world.World
|
||||
import net.minecraftforge.client.event.TextureStitchEvent
|
||||
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus.MOD
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.block
|
||||
|
||||
import chylex.hee.client.model.block.ModelBlockIgneousPlate
|
||||
import chylex.hee.client.render.gl.RenderStateBuilder
|
||||
import chylex.hee.client.render.gl.RenderStateBuilder.Companion.BLEND_NONE
|
||||
@@ -29,7 +30,7 @@ import net.minecraft.client.renderer.RenderType
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats
|
||||
import net.minecraft.util.math.vector.Vector3d
|
||||
import net.minecraft.util.math.Vec3d
|
||||
import org.lwjgl.opengl.GL11
|
||||
|
||||
@Sided(Side.CLIENT)
|
||||
@@ -53,7 +54,7 @@ class RenderTileIgneousPlate(dispatcher: TileEntityRendererDispatcher) : TileEnt
|
||||
RGB(235, 23, 23).asVec
|
||||
)
|
||||
|
||||
private fun getInnerBoxColor(combinedHeat: Float): Vector3d{
|
||||
private fun getInnerBoxColor(combinedHeat: Float): Vec3d {
|
||||
val index = combinedHeat.floorToInt().coerceIn(0, COLOR_TRANSITIONS.lastIndex - 1)
|
||||
val progress = combinedHeat.toDouble() - index
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.block
|
||||
|
||||
import chylex.hee.HEE
|
||||
import chylex.hee.client.MC
|
||||
import chylex.hee.client.render.gl.RenderStateBuilder
|
||||
@@ -20,7 +21,6 @@ import com.mojang.blaze3d.matrix.MatrixStack
|
||||
import net.minecraft.client.renderer.Atlases
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer
|
||||
import net.minecraft.client.renderer.model.IBakedModel
|
||||
import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite
|
||||
import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer
|
||||
@@ -35,6 +35,7 @@ import net.minecraftforge.client.model.ModelLoader
|
||||
import net.minecraftforge.client.model.data.EmptyModelData
|
||||
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus.MOD
|
||||
import org.lwjgl.opengl.GL11
|
||||
import kotlin.math.sqrt
|
||||
|
||||
@Sided(Side.CLIENT)
|
||||
class RenderTileJarODust(dispatcher: TileEntityRendererDispatcher) : TileEntityRenderer<TileEntityJarODust>(dispatcher) {
|
||||
@@ -54,8 +55,10 @@ class RenderTileJarODust(dispatcher: TileEntityRendererDispatcher) : TileEntityR
|
||||
|
||||
private val AABB = BlockJarODust.AABB
|
||||
|
||||
private const val EPSILON_Y = 0.025
|
||||
private const val EPSILON_Y_BOTTOM = 0.02
|
||||
private const val EPSILON_Y_TOP = 0.04
|
||||
private const val EPSILON_XZ = 0.005
|
||||
private const val FIRST_LAYER_HEIGHT = 0.0325
|
||||
|
||||
@SubscribeEvent
|
||||
fun onTextureStitchPre(e: TextureStitchEvent.Pre) {
|
||||
@@ -71,9 +74,10 @@ class RenderTileJarODust(dispatcher: TileEntityRendererDispatcher) : TileEntityR
|
||||
}
|
||||
}
|
||||
|
||||
private fun renderLayers(layers: DustLayers, matrix: MatrixStack, buffer: IRenderTypeBuffer, combinedLight: Int, combinedOverlay: Int, renderBottom: Boolean){
|
||||
private fun renderLayers(layers: DustLayers, matrix: MatrixStack, buffer: IRenderTypeBuffer, combinedLight: Int, combinedOverlay: Int) {
|
||||
val contents = layers.contents.takeUnless { it.isEmpty() } ?: return
|
||||
val unit = AABB.let { it.maxY - it.minY - (EPSILON_Y * 2) } / layers.totalCapacity
|
||||
val squish = 0.775F + (0.225F * sqrt(contents.sumBy { it.second.toInt() }.toDouble() / layers.totalCapacity))
|
||||
val unit = AABB.let { it.maxY - it.minY - EPSILON_Y_BOTTOM - EPSILON_Y_TOP - FIRST_LAYER_HEIGHT } / layers.totalCapacity / squish
|
||||
|
||||
val builder = buffer.getBuffer(RENDER_TYPE_LAYERS)
|
||||
val mat = matrix.last.matrix
|
||||
@@ -96,12 +100,12 @@ class RenderTileJarODust(dispatcher: TileEntityRendererDispatcher) : TileEntityR
|
||||
val (dustType, dustAmount) = info
|
||||
|
||||
val color = dustType.color
|
||||
val height = dustAmount * unit
|
||||
val height = (if (index == 0) FIRST_LAYER_HEIGHT else 0.0) + (dustAmount * unit)
|
||||
|
||||
val texMin = minU + ((0.01 + relY * TEX_MP) * texHalfSize).toFloat()
|
||||
val texMax = minU + ((0.01 + (relY + height) * TEX_MP) * texHalfSize).toFloat()
|
||||
|
||||
val minY = (relY + AABB.minY + EPSILON_Y).toFloat()
|
||||
val minY = (relY + AABB.minY + EPSILON_Y_BOTTOM).toFloat()
|
||||
val maxY = (minY + height).toFloat()
|
||||
|
||||
val sideR = (color[0] / 1.125F).floorToInt().coerceAtLeast(0)
|
||||
@@ -130,7 +134,7 @@ class RenderTileJarODust(dispatcher: TileEntityRendererDispatcher) : TileEntityR
|
||||
pos(mat, minX, maxY, maxZ).color(sideR, sideG, sideB, 255).tex(texMax, minV).lightmap(combinedLight).overlay(combinedOverlay).endVertex()
|
||||
}
|
||||
|
||||
if (index == 0 && renderBottom){
|
||||
if (index == 0) {
|
||||
val bottomR = color[0]
|
||||
val bottomG = color[1]
|
||||
val bottomB = color[2]
|
||||
@@ -162,7 +166,7 @@ class RenderTileJarODust(dispatcher: TileEntityRendererDispatcher) : TileEntityR
|
||||
}
|
||||
|
||||
override fun render(tile: TileEntityJarODust, partialTicks: Float, matrix: MatrixStack, buffer: IRenderTypeBuffer, combinedLight: Int, combinedOverlay: Int) {
|
||||
renderLayers(tile.layers, matrix, buffer, combinedLight, combinedOverlay, renderBottom = false)
|
||||
renderLayers(tile.layers, matrix, buffer, combinedLight, combinedOverlay)
|
||||
}
|
||||
|
||||
@SubscribeAllEvents(Side.CLIENT, modid = HEE.ID, bus = MOD)
|
||||
@@ -182,12 +186,12 @@ class RenderTileJarODust(dispatcher: TileEntityRendererDispatcher) : TileEntityR
|
||||
|
||||
private val layers = DustLayers(TileEntityJarODust.DUST_CAPACITY)
|
||||
|
||||
override fun func_239207_a_(stack: ItemStack, transformType: TransformType, matrix: MatrixStack, buffer: IRenderTypeBuffer, combinedLight: Int, combinedOverlay: Int){
|
||||
override fun render(stack: ItemStack, matrix: MatrixStack, buffer: IRenderTypeBuffer, combinedLight: Int, combinedOverlay: Int) {
|
||||
val nbt = stack.heeTagOrNull?.getListOfCompounds(TileEntityJarODust.LAYERS_TAG)
|
||||
|
||||
if (nbt != null) {
|
||||
layers.deserializeNBT(nbt)
|
||||
renderLayers(layers, matrix, buffer, combinedLight, combinedOverlay, renderBottom = true)
|
||||
renderLayers(layers, matrix, buffer, combinedLight, combinedOverlay)
|
||||
}
|
||||
|
||||
MC.instance.blockRendererDispatcher.blockModelRenderer.renderModel(matrix.last, buffer.getBuffer(Atlases.getTranslucentCullBlockType()), null, MODEL, 1F, 1F, 1F, combinedLight, combinedOverlay, EmptyModelData.INSTANCE)
|
||||
|
@@ -1,10 +1,11 @@
|
||||
package chylex.hee.client.render.block
|
||||
|
||||
import chylex.hee.game.block.entity.TileEntityLootChest
|
||||
import chylex.hee.init.ModAtlases
|
||||
import chylex.hee.system.facades.Resource
|
||||
import chylex.hee.system.forge.Side
|
||||
import chylex.hee.system.forge.Sided
|
||||
import net.minecraft.client.renderer.model.RenderMaterial
|
||||
import net.minecraft.client.renderer.model.Material
|
||||
import net.minecraft.client.renderer.tileentity.ChestTileEntityRenderer
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher
|
||||
import net.minecraft.state.properties.ChestType
|
||||
@@ -13,14 +14,14 @@ import net.minecraft.state.properties.ChestType
|
||||
class RenderTileLootChest(dispatcher: TileEntityRendererDispatcher) : ChestTileEntityRenderer<TileEntityLootChest>(dispatcher) {
|
||||
companion object {
|
||||
val TEX = Resource.Custom("entity/loot_chest")
|
||||
private val MAT = RenderMaterial(ModAtlases.ATLAS_TILES, TEX)
|
||||
private val MAT = Material(ModAtlases.ATLAS_TILES, TEX)
|
||||
}
|
||||
|
||||
init {
|
||||
isChristmas = false
|
||||
}
|
||||
|
||||
override fun getMaterial(tile: TileEntityLootChest, type: ChestType): RenderMaterial{
|
||||
override fun getMaterial(tile: TileEntityLootChest, type: ChestType): Material {
|
||||
return MAT
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.block
|
||||
|
||||
import chylex.hee.client.MC
|
||||
import chylex.hee.client.model.ModelHelper
|
||||
import chylex.hee.client.render.gl.rotateX
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.block
|
||||
|
||||
import net.minecraft.client.renderer.entity.model.ShulkerModel
|
||||
import net.minecraft.client.renderer.tileentity.ShulkerBoxTileEntityRenderer
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.block
|
||||
|
||||
import chylex.hee.client.MC
|
||||
import chylex.hee.client.render.gl.rotateX
|
||||
import chylex.hee.client.render.gl.rotateY
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.block
|
||||
|
||||
import chylex.hee.client.MC
|
||||
import chylex.hee.client.model.ModelHelper
|
||||
import chylex.hee.client.model.getQuads
|
||||
@@ -57,7 +58,7 @@ class RenderTileTable(dispatcher: TileEntityRendererDispatcher) : TileEntityRend
|
||||
val itemModel = ForgeHooksClient.handleCameraTransforms(matrix, ModelHelper.getItemModel(itemStack), GUI, false)
|
||||
|
||||
val mat = matrix.last
|
||||
val builder = ItemRenderer.getBuffer(buffer, RenderTypeLookup.func_239219_a_(itemStack, true), true /* isItem */, false /* hasGlint */)
|
||||
val builder = ItemRenderer.getBuffer(buffer, RenderTypeLookup.getRenderType(itemStack), true /* isItem */, false /* hasGlint */)
|
||||
|
||||
for(quad in itemModel.getQuads()) {
|
||||
builder.addVertexData(mat, quad, COLOR_SHADE, COLOR_SHADE, COLOR_SHADE, COLOR_ALPHA, LIGHT, OverlayTexture.NO_OVERLAY)
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.block
|
||||
|
||||
import chylex.hee.client.MC
|
||||
import chylex.hee.client.model.ModelHelper
|
||||
import chylex.hee.client.render.gl.DF_ONE_MINUS_SRC_ALPHA
|
||||
@@ -23,6 +24,7 @@ import chylex.hee.system.random.nextFloat
|
||||
import com.mojang.blaze3d.matrix.MatrixStack
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer
|
||||
import net.minecraft.client.renderer.ItemRenderer
|
||||
import net.minecraft.client.renderer.Matrix4f
|
||||
import net.minecraft.client.renderer.model.IBakedModel
|
||||
import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType.GROUND
|
||||
import net.minecraft.client.renderer.texture.OverlayTexture
|
||||
@@ -31,7 +33,6 @@ import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats
|
||||
import net.minecraft.item.Item
|
||||
import net.minecraft.item.ItemStack
|
||||
import net.minecraft.util.math.vector.Matrix4f
|
||||
import org.lwjgl.opengl.GL11
|
||||
import java.util.Collections
|
||||
import java.util.Random
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.block
|
||||
|
||||
import chylex.hee.game.block.BlockAbstractPortal
|
||||
import chylex.hee.game.block.BlockVoidPortalInner.Companion.TYPE
|
||||
import chylex.hee.game.block.BlockVoidPortalInner.ITerritoryInstanceFactory
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.entity
|
||||
|
||||
import chylex.hee.client.model.entity.ModelEntityBossEnderEye
|
||||
import chylex.hee.client.model.entity.ModelEntityBossEnderEye.SCALE
|
||||
import chylex.hee.client.render.entity.layer.LayerEnderEyeLaser
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.entity
|
||||
|
||||
import chylex.hee.client.MC
|
||||
import chylex.hee.system.forge.Side
|
||||
import chylex.hee.system.forge.Sided
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.entity
|
||||
|
||||
import chylex.hee.client.MC
|
||||
import chylex.hee.system.forge.Side
|
||||
import chylex.hee.system.forge.Sided
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.entity
|
||||
|
||||
import chylex.hee.client.render.gl.DF_ONE_MINUS_SRC_ALPHA
|
||||
import chylex.hee.client.render.gl.RenderStateBuilder
|
||||
import chylex.hee.client.render.gl.RenderStateBuilder.Companion.CULL_DISABLED
|
||||
@@ -115,10 +116,10 @@ open class RenderEntityMobAbstractEnderman(manager: EntityRendererManager) : End
|
||||
return if (entity.hurtTime == 0 && entity.isAggro) 2 else 0
|
||||
}
|
||||
|
||||
override fun func_230496_a_(entity: EntityEnderman, isVisible: Boolean, isTranslucent: Boolean, isGlowing: Boolean): RenderType?{
|
||||
override fun func_230042_a_(entity: EntityEnderman, isVisible: Boolean, isTranslucent: Boolean): RenderType? {
|
||||
return if (isRenderingClone)
|
||||
RENDER_TYPE_CLONE(getEntityTexture(entity))
|
||||
else
|
||||
super.func_230496_a_(entity, isVisible, isTranslucent, isGlowing)
|
||||
super.func_230042_a_(entity, isVisible, isTranslucent)
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.entity
|
||||
|
||||
import chylex.hee.game.entity.living.EntityMobAbstractEnderman
|
||||
import chylex.hee.system.forge.Side
|
||||
import chylex.hee.system.forge.Sided
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.entity
|
||||
|
||||
import chylex.hee.client.MC
|
||||
import chylex.hee.client.model.ModelHelper
|
||||
import chylex.hee.client.model.entity.ModelEntityMobBlobby
|
||||
@@ -28,7 +29,6 @@ import net.minecraft.client.renderer.RenderType
|
||||
import net.minecraft.client.renderer.entity.EntityRendererManager
|
||||
import net.minecraft.client.renderer.entity.MobRenderer
|
||||
import net.minecraft.client.renderer.model.IBakedModel
|
||||
import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType
|
||||
import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType.GROUND
|
||||
import net.minecraft.client.renderer.texture.OverlayTexture
|
||||
import net.minecraft.item.ItemStack
|
||||
@@ -67,7 +67,7 @@ class RenderEntityMobBlobby(manager: EntityRendererManager) : MobRenderer<Entity
|
||||
super.render(entity, yaw, partialTicks, matrix, buffer, combinedLight)
|
||||
}
|
||||
|
||||
override fun func_230496_a_(entity: EntityMobBlobby, isVisible: Boolean, isTranslucent: Boolean, isGlowing: Boolean): RenderType{
|
||||
override fun func_230042_a_(entity: EntityMobBlobby, isVisible: Boolean, isTranslucent: Boolean): RenderType {
|
||||
return renderType
|
||||
}
|
||||
|
||||
@@ -112,8 +112,8 @@ class RenderEntityMobBlobby(manager: EntityRendererManager) : MobRenderer<Entity
|
||||
else -> null // POLISH implement more special cases
|
||||
}
|
||||
|
||||
if (overrideType != null){ // UPDATE test transform
|
||||
stack.item.itemStackTileEntityRenderer.func_239207_a_(stack, TransformType.NONE, matrix, { buffer.getBuffer(overrideType) }, combinedLight, OverlayTexture.NO_OVERLAY)
|
||||
if (overrideType != null) {
|
||||
stack.item.itemStackTileEntityRenderer.render(stack, matrix, { buffer.getBuffer(overrideType) }, combinedLight, OverlayTexture.NO_OVERLAY)
|
||||
}
|
||||
else if (stack !== fallbackStack) {
|
||||
matrix.pop()
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.entity
|
||||
|
||||
import chylex.hee.client.render.entity.layer.LayerSpiderlingEyes
|
||||
import chylex.hee.client.render.gl.scale
|
||||
import chylex.hee.game.entity.living.EntityMobSpiderling
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package chylex.hee.client.render.entity
|
||||
import chylex.hee.client.model.entity.ModelEntityUndread
|
||||
|
||||
import chylex.hee.client.model.entity.ModelEntityMobUndread
|
||||
import chylex.hee.game.entity.living.EntityMobUndread
|
||||
import chylex.hee.system.facades.Resource
|
||||
import chylex.hee.system.forge.Side
|
||||
@@ -12,11 +13,11 @@ import net.minecraft.client.renderer.entity.model.AbstractZombieModel
|
||||
import net.minecraft.util.ResourceLocation
|
||||
|
||||
@Sided(Side.CLIENT)
|
||||
class RenderEntityMobUndread(manager: EntityRendererManager) : BipedRenderer<EntityMobUndread, AbstractZombieModel<EntityMobUndread>>(manager, ModelEntityUndread(), 0.5F){
|
||||
class RenderEntityMobUndread(manager: EntityRendererManager) : BipedRenderer<EntityMobUndread, AbstractZombieModel<EntityMobUndread>>(manager, ModelEntityMobUndread(), 0.5F) {
|
||||
private val texture = Resource.Custom("textures/entity/undread.png")
|
||||
|
||||
init {
|
||||
addLayer(BipedArmorLayer(this, ModelEntityUndread(0.5125F, true), ModelEntityUndread(1F, true)))
|
||||
addLayer(BipedArmorLayer(this, ModelEntityMobUndread(0.5125F, true), ModelEntityMobUndread(1F, true)))
|
||||
}
|
||||
|
||||
override fun preRenderCallback(entity: EntityMobUndread, matrix: MatrixStack, partialTicks: Float) {
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.entity
|
||||
|
||||
import chylex.hee.system.facades.Resource
|
||||
import chylex.hee.system.forge.Side
|
||||
import chylex.hee.system.forge.Sided
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.entity
|
||||
|
||||
import chylex.hee.client.MC
|
||||
import chylex.hee.client.render.gl.scale
|
||||
import chylex.hee.game.entity.living.EntityMobVillagerDying
|
||||
|
@@ -1,7 +1,8 @@
|
||||
package chylex.hee.client.render.entity
|
||||
|
||||
import chylex.hee.system.forge.Side
|
||||
import chylex.hee.system.forge.Sided
|
||||
import net.minecraft.client.renderer.culling.ClippingHelper
|
||||
import net.minecraft.client.renderer.culling.ClippingHelperImpl
|
||||
import net.minecraft.client.renderer.entity.EntityRenderer
|
||||
import net.minecraft.client.renderer.entity.EntityRendererManager
|
||||
import net.minecraft.entity.Entity
|
||||
@@ -9,6 +10,6 @@ import net.minecraft.util.ResourceLocation
|
||||
|
||||
@Sided(Side.CLIENT)
|
||||
class RenderEntityNothing(manager: EntityRendererManager) : EntityRenderer<Entity>(manager) {
|
||||
override fun shouldRender(entity: Entity, camera: ClippingHelper, camX: Double, camY: Double, camZ: Double) = false
|
||||
override fun shouldRender(entity: Entity, camera: ClippingHelperImpl, camX: Double, camY: Double, camZ: Double) = false
|
||||
override fun getEntityTexture(entity: Entity): ResourceLocation? = null
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.entity
|
||||
|
||||
import chylex.hee.client.MC
|
||||
import chylex.hee.client.model.ModelHelper
|
||||
import chylex.hee.client.render.gl.rotateY
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.entity
|
||||
|
||||
import chylex.hee.client.MC
|
||||
import chylex.hee.system.forge.Side
|
||||
import chylex.hee.system.forge.Sided
|
||||
|
@@ -1,16 +1,17 @@
|
||||
package chylex.hee.client.render.entity
|
||||
|
||||
import chylex.hee.game.entity.effect.EntityTerritoryLightningBolt
|
||||
import chylex.hee.system.forge.Side
|
||||
import chylex.hee.system.forge.Sided
|
||||
import com.mojang.blaze3d.matrix.MatrixStack
|
||||
import com.mojang.blaze3d.vertex.IVertexBuilder
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer
|
||||
import net.minecraft.client.renderer.Matrix4f
|
||||
import net.minecraft.client.renderer.RenderType
|
||||
import net.minecraft.client.renderer.entity.EntityRenderer
|
||||
import net.minecraft.client.renderer.entity.EntityRendererManager
|
||||
import net.minecraft.inventory.container.PlayerContainer
|
||||
import net.minecraft.util.ResourceLocation
|
||||
import net.minecraft.util.math.vector.Matrix4f
|
||||
import java.util.Random
|
||||
|
||||
@Sided(Side.CLIENT)
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.entity
|
||||
|
||||
import chylex.hee.client.model.entity.ModelEntityTokenHolder
|
||||
import chylex.hee.client.render.gl.rotateX
|
||||
import chylex.hee.client.render.gl.rotateY
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.entity.layer
|
||||
|
||||
import chylex.hee.client.model.entity.ModelEntityBossEnderEye
|
||||
import chylex.hee.client.render.gl.RenderStateBuilder
|
||||
import chylex.hee.client.render.gl.RenderStateBuilder.Companion.CULL_DISABLED
|
||||
@@ -52,28 +53,28 @@ class LayerEnderEyeLaser(entity: IEntityRenderer<EntityBossEnderEye, ModelEntity
|
||||
|
||||
builder.pos(mat, -hw, -hw, 0F).color().tex(0F, 0F).endVertex()
|
||||
builder.pos(mat, -hw, -hw, -len).color().tex(0F, tex).endVertex()
|
||||
builder.pos(mat, hw, -hw, -len).color().tex(1F, tex).endVertex()
|
||||
builder.pos(mat, hw, -hw, 0F).color().tex(1F, 0F).endVertex()
|
||||
builder.pos(mat, +hw, -hw, -len).color().tex(1F, tex).endVertex()
|
||||
builder.pos(mat, +hw, -hw, 0F).color().tex(1F, 0F).endVertex()
|
||||
|
||||
builder.pos(mat, -hw, hw, 0F).color().tex(0F, 0F).endVertex()
|
||||
builder.pos(mat, -hw, hw, -len).color().tex(0F, tex).endVertex()
|
||||
builder.pos(mat, -hw, +hw, 0F).color().tex(0F, 0F).endVertex()
|
||||
builder.pos(mat, -hw, +hw, -len).color().tex(0F, tex).endVertex()
|
||||
builder.pos(mat, -hw, -hw, -len).color().tex(1F, tex).endVertex()
|
||||
builder.pos(mat, -hw, -hw, 0F).color().tex(1F, 0F).endVertex()
|
||||
|
||||
builder.pos(mat, hw, -hw, 0F).color().tex(0F, 0F).endVertex()
|
||||
builder.pos(mat, hw, -hw, -len).color().tex(0F, tex).endVertex()
|
||||
builder.pos(mat, hw, hw, -len).color().tex(1F, tex).endVertex()
|
||||
builder.pos(mat, hw, hw, 0F).color().tex(1F, 0F).endVertex()
|
||||
builder.pos(mat, hw, +hw, -len).color().tex(1F, tex).endVertex()
|
||||
builder.pos(mat, hw, +hw, 0F).color().tex(1F, 0F).endVertex()
|
||||
|
||||
builder.pos(mat, hw, hw, 0F).color().tex(0F, 0F).endVertex()
|
||||
builder.pos(mat, hw, hw, -len).color().tex(0F, tex).endVertex()
|
||||
builder.pos(mat, +hw, hw, 0F).color().tex(0F, 0F).endVertex()
|
||||
builder.pos(mat, +hw, hw, -len).color().tex(0F, tex).endVertex()
|
||||
builder.pos(mat, -hw, hw, -len).color().tex(1F, tex).endVertex()
|
||||
builder.pos(mat, -hw, hw, 0F).color().tex(1F, 0F).endVertex()
|
||||
|
||||
builder.pos(mat, -hw, -hw, -len).color().tex(0F, 0F).endVertex()
|
||||
builder.pos(mat, -hw, hw, -len).color().tex(0F, 0F).endVertex()
|
||||
builder.pos(mat, hw, hw, -len).color().tex(0F, 0F).endVertex()
|
||||
builder.pos(mat, hw, -hw, -len).color().tex(0F, 0F).endVertex()
|
||||
builder.pos(mat, -hw, +hw, -len).color().tex(0F, 0F).endVertex()
|
||||
builder.pos(mat, +hw, +hw, -len).color().tex(0F, 0F).endVertex()
|
||||
builder.pos(mat, +hw, -hw, -len).color().tex(0F, 0F).endVertex()
|
||||
|
||||
matrix.pop()
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.entity.layer
|
||||
|
||||
import chylex.hee.client.render.entity.RenderEntityMobSpiderling
|
||||
import chylex.hee.client.render.gl.scale
|
||||
import chylex.hee.game.entity.living.EntityMobSpiderling
|
||||
|
@@ -1,9 +1,9 @@
|
||||
package chylex.hee.client.render.item
|
||||
|
||||
import chylex.hee.system.forge.Side
|
||||
import chylex.hee.system.forge.Sided
|
||||
import com.mojang.blaze3d.matrix.MatrixStack
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer
|
||||
import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType
|
||||
import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher
|
||||
import net.minecraft.item.ItemStack
|
||||
@@ -11,7 +11,7 @@ import net.minecraft.tileentity.TileEntity
|
||||
|
||||
@Sided(Side.CLIENT)
|
||||
class RenderItemTileEntitySimple<T : TileEntity>(val tile: T) : ItemStackTileEntityRenderer() {
|
||||
override fun func_239207_a_(stack: ItemStack, transformType: TransformType, matrix: MatrixStack, buffer: IRenderTypeBuffer, combinedLight: Int, combinedOverlay: Int){
|
||||
override fun render(stack: ItemStack, matrix: MatrixStack, buffer: IRenderTypeBuffer, combinedLight: Int, combinedOverlay: Int) {
|
||||
TileEntityRendererDispatcher.instance.renderItem(tile, matrix, buffer, combinedLight, combinedOverlay)
|
||||
}
|
||||
}
|
||||
|
@@ -1,10 +1,12 @@
|
||||
package chylex.hee.client.render.territory
|
||||
|
||||
import chylex.hee.client.MC
|
||||
import chylex.hee.client.render.TerritoryRenderer
|
||||
import chylex.hee.client.render.gl.GL
|
||||
import chylex.hee.system.facades.Resource
|
||||
import chylex.hee.system.forge.Side
|
||||
import chylex.hee.system.forge.Sided
|
||||
import chylex.hee.system.math.Vec3
|
||||
import chylex.hee.system.math.remapRange
|
||||
import com.mojang.blaze3d.matrix.MatrixStack
|
||||
import net.minecraft.client.Minecraft
|
||||
@@ -12,7 +14,6 @@ import net.minecraft.client.renderer.RenderHelper
|
||||
import net.minecraft.client.renderer.Tessellator
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats
|
||||
import net.minecraft.client.world.ClientWorld
|
||||
import net.minecraft.util.math.vector.Vector3d
|
||||
import net.minecraftforge.client.SkyRenderHandler
|
||||
import org.lwjgl.opengl.GL11.GL_QUADS
|
||||
import kotlin.math.pow
|
||||
@@ -32,7 +33,7 @@ abstract class AbstractEnvironmentRenderer : SkyRenderHandler{
|
||||
get() = MC.settings.renderDistanceChunks.let { if (it > 12) 0F else (1F - (it / 16.5F)).pow((it - 1) * 0.25F) }
|
||||
|
||||
val DEFAULT_TEXTURE = Resource.Custom("textures/environment/white.png")
|
||||
val DEFAULT_COLOR = Vector3d(1.0, 1.0, 1.0)
|
||||
val DEFAULT_COLOR = Vec3.xyz(1.0)
|
||||
const val DEFAULT_ALPHA = 1F
|
||||
|
||||
fun renderPlane(matrix: MatrixStack, y: Float, size: Float, rescale: Float) {
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.territory
|
||||
|
||||
import chylex.hee.system.forge.Side
|
||||
import chylex.hee.system.forge.Sided
|
||||
import com.mojang.blaze3d.matrix.MatrixStack
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.territory.components
|
||||
|
||||
import chylex.hee.client.MC
|
||||
import chylex.hee.client.render.gl.DF_ONE_MINUS_SRC_ALPHA
|
||||
import chylex.hee.client.render.gl.DF_ZERO
|
||||
@@ -44,10 +45,10 @@ abstract class SkyCubeBase : AbstractEnvironmentRenderer(){
|
||||
matrix.push()
|
||||
|
||||
when(side) {
|
||||
1 -> matrix.rotateX( 90F)
|
||||
1 -> matrix.rotateX(+90F)
|
||||
2 -> matrix.rotateX(-90F)
|
||||
3 -> matrix.rotateX(180F)
|
||||
4 -> matrix.rotateZ( 90F)
|
||||
4 -> matrix.rotateZ(+90F)
|
||||
5 -> matrix.rotateZ(-90F)
|
||||
}
|
||||
|
||||
|
@@ -1,11 +1,12 @@
|
||||
package chylex.hee.client.render.territory.components
|
||||
|
||||
import net.minecraft.util.ResourceLocation
|
||||
import net.minecraft.util.math.vector.Vector3d
|
||||
import net.minecraft.util.math.Vec3d
|
||||
|
||||
class SkyCubeStatic(
|
||||
override val texture: ResourceLocation = DEFAULT_TEXTURE,
|
||||
override val color: Vector3d = DEFAULT_COLOR,
|
||||
override val color: Vec3d = DEFAULT_COLOR,
|
||||
override val alpha: Float = DEFAULT_ALPHA,
|
||||
override val rescale: Float = DEFAULT_RESCALE,
|
||||
override val distance: Float = DEFAULT_DISTANCE
|
||||
override val distance: Float = DEFAULT_DISTANCE,
|
||||
) : SkyCubeBase()
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.territory.components
|
||||
|
||||
import chylex.hee.client.render.gl.DF_ONE_MINUS_SRC_ALPHA
|
||||
import chylex.hee.client.render.gl.GL
|
||||
import chylex.hee.client.render.gl.SF_SRC_ALPHA
|
||||
|
@@ -1,15 +1,16 @@
|
||||
package chylex.hee.client.render.territory.components
|
||||
|
||||
import net.minecraft.util.ResourceLocation
|
||||
import net.minecraft.util.math.vector.Vector3d
|
||||
import net.minecraft.util.math.Vec3d
|
||||
|
||||
class SkyDomeStatic(
|
||||
override val texture: ResourceLocation = DEFAULT_TEXTURE,
|
||||
override val color1: Vector3d = DEFAULT_COLOR,
|
||||
override val color2: Vector3d = DEFAULT_COLOR,
|
||||
override val color1: Vec3d = DEFAULT_COLOR,
|
||||
override val color2: Vec3d = DEFAULT_COLOR,
|
||||
override val alpha1: Float = DEFAULT_ALPHA,
|
||||
override val alpha2: Float = DEFAULT_ALPHA
|
||||
override val alpha2: Float = DEFAULT_ALPHA,
|
||||
) : SkyDomeBase() {
|
||||
constructor(texture: ResourceLocation = DEFAULT_TEXTURE, color: Vector3d = DEFAULT_COLOR, alpha: Float = DEFAULT_ALPHA) : this(texture, color, color, alpha, alpha)
|
||||
constructor(texture: ResourceLocation = DEFAULT_TEXTURE, color1: Vector3d, color2: Vector3d, alpha: Float = DEFAULT_ALPHA) : this(texture, color1, color2, alpha, alpha)
|
||||
constructor(texture: ResourceLocation = DEFAULT_TEXTURE, color: Vector3d = DEFAULT_COLOR, alpha1: Float, alpha2: Float) : this(texture, color, color, alpha1, alpha2)
|
||||
constructor(texture: ResourceLocation = DEFAULT_TEXTURE, color: Vec3d = DEFAULT_COLOR, alpha: Float = DEFAULT_ALPHA) : this(texture, color, color, alpha, alpha)
|
||||
constructor(texture: ResourceLocation = DEFAULT_TEXTURE, color1: Vec3d, color2: Vec3d, alpha: Float = DEFAULT_ALPHA) : this(texture, color1, color2, alpha, alpha)
|
||||
constructor(texture: ResourceLocation = DEFAULT_TEXTURE, color: Vec3d = DEFAULT_COLOR, alpha1: Float, alpha2: Float) : this(texture, color, color, alpha1, alpha2)
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.territory.components
|
||||
|
||||
import chylex.hee.client.MC
|
||||
import chylex.hee.client.render.gl.DF_ONE_MINUS_SRC_ALPHA
|
||||
import chylex.hee.client.render.gl.DF_ZERO
|
||||
@@ -11,16 +12,16 @@ import chylex.hee.system.forge.Sided
|
||||
import com.mojang.blaze3d.matrix.MatrixStack
|
||||
import net.minecraft.client.world.ClientWorld
|
||||
import net.minecraft.util.ResourceLocation
|
||||
import net.minecraft.util.math.vector.Vector3d
|
||||
import net.minecraft.util.math.Vec3d
|
||||
import org.lwjgl.opengl.GL11.GL_GREATER
|
||||
|
||||
class SkyPlaneTopFoggy(
|
||||
override val texture: ResourceLocation = DEFAULT_TEXTURE,
|
||||
override val color: Vector3d = DEFAULT_COLOR,
|
||||
override val color: Vec3d = DEFAULT_COLOR,
|
||||
override val alpha: Float = DEFAULT_ALPHA,
|
||||
override val rescale: Float = DEFAULT_RESCALE,
|
||||
override val distance: Float = DEFAULT_DISTANCE,
|
||||
private val width: Float = distance
|
||||
private val width: Float = distance,
|
||||
) : SkyCubeBase() {
|
||||
@Sided(Side.CLIENT)
|
||||
override fun render(world: ClientWorld, matrix: MatrixStack, partialTicks: Float) {
|
||||
@@ -31,6 +32,7 @@ class SkyPlaneTopFoggy(
|
||||
GL.blendFunc(SF_SRC_ALPHA, DF_ONE_MINUS_SRC_ALPHA, SF_ONE, DF_ZERO)
|
||||
GL.enableAlpha()
|
||||
GL.alphaFunc(GL_GREATER, 0F)
|
||||
GL.enableFog()
|
||||
|
||||
GL.color(color, alpha * currentSkyAlpha)
|
||||
GL.bindTexture(texture)
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.render.territory.components
|
||||
|
||||
import chylex.hee.client.render.gl.DF_ONE
|
||||
import chylex.hee.client.render.gl.DF_ZERO
|
||||
import chylex.hee.client.render.gl.GL
|
||||
|
@@ -1,11 +1,12 @@
|
||||
package chylex.hee.client.render.territory.components
|
||||
|
||||
import net.minecraft.util.ResourceLocation
|
||||
import net.minecraft.util.math.vector.Vector3d
|
||||
import net.minecraft.util.math.Vec3d
|
||||
|
||||
class SunStatic(
|
||||
override val texture: ResourceLocation,
|
||||
override val color: Vector3d = DEFAULT_COLOR,
|
||||
override val color: Vec3d = DEFAULT_COLOR,
|
||||
override val alpha: Float = DEFAULT_ALPHA,
|
||||
override val size: Float,
|
||||
override val distance: Float = DEFAULT_DISTANCE
|
||||
override val distance: Float = DEFAULT_DISTANCE,
|
||||
) : SunBase()
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.client.sound
|
||||
|
||||
import chylex.hee.game.entity.projectile.EntityProjectileSpatialDash
|
||||
import chylex.hee.system.migration.Sounds
|
||||
import chylex.hee.system.random.nextFloat
|
||||
@@ -15,12 +16,12 @@ class MovingSoundSpatialDash(private val entity: EntityProjectileSpatialDash) :
|
||||
|
||||
override fun tick() {
|
||||
if (!entity.isAlive) {
|
||||
finishPlaying()
|
||||
donePlaying = true
|
||||
return
|
||||
}
|
||||
|
||||
x = entity.posX
|
||||
y = entity.posY
|
||||
z = entity.posZ
|
||||
x = entity.posX.toFloat()
|
||||
y = entity.posY.toFloat()
|
||||
z = entity.posZ.toFloat()
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.commands
|
||||
|
||||
import chylex.hee.HEE
|
||||
import chylex.hee.client.MC
|
||||
import chylex.hee.commands.client.CommandClientHelp
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.commands.client
|
||||
|
||||
import chylex.hee.commands.ClientCommandHandler
|
||||
import chylex.hee.commands.IClientCommand
|
||||
import chylex.hee.commands.server.CommandServerHelp
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.commands.client
|
||||
|
||||
import chylex.hee.commands.IClientCommand
|
||||
import chylex.hee.commands.server.CommandDebugStructure
|
||||
import net.minecraft.command.CommandSource
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.commands.client
|
||||
|
||||
import chylex.hee.commands.IClientCommand
|
||||
import chylex.hee.game.world.WorldProviderEndCustom
|
||||
import chylex.hee.init.ModBlocks
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.commands.server
|
||||
|
||||
import chylex.hee.commands.ICommand
|
||||
import chylex.hee.commands.executes
|
||||
import chylex.hee.commands.getInt
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.commands.server
|
||||
|
||||
import chylex.hee.commands.ICommand
|
||||
import chylex.hee.commands.arguments.ValidatedStringArgument.Companion.validatedString
|
||||
import chylex.hee.commands.executes
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.commands.server
|
||||
|
||||
import chylex.hee.HEE
|
||||
import chylex.hee.commands.ICommand
|
||||
import chylex.hee.commands.executes
|
||||
@@ -42,7 +43,7 @@ object CommandDebugTerritory : ICommand{
|
||||
val instance = TerritoryInstance.fromPos(pos)
|
||||
val seed = if (hasSeedArg) ctx.getLong("seed") else null
|
||||
|
||||
if (world.dimensionKey !== HEE.dim){
|
||||
if (world.dimension.type !== HEE.dim) {
|
||||
sendFeedback(StringTextComponent("Invalid dimension."), false)
|
||||
return 0
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.commands.server
|
||||
|
||||
import chylex.hee.commands.CommandExecutionFunction
|
||||
import chylex.hee.commands.ICommand
|
||||
import chylex.hee.commands.returning
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.commands.server
|
||||
|
||||
import chylex.hee.commands.ICommand
|
||||
import chylex.hee.commands.arguments.EnumArgument.Companion.enum
|
||||
import chylex.hee.commands.executes
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.commands.server
|
||||
|
||||
import chylex.hee.commands.CommandExecutionFunctionCtx
|
||||
import chylex.hee.commands.ICommand
|
||||
import chylex.hee.commands.executes
|
||||
@@ -13,7 +14,6 @@ import com.mojang.brigadier.context.CommandContext
|
||||
import net.minecraft.command.CommandException
|
||||
import net.minecraft.command.CommandSource
|
||||
import net.minecraft.command.Commands.argument
|
||||
import net.minecraft.util.text.IFormattableTextComponent
|
||||
import net.minecraft.util.text.ITextComponent
|
||||
import net.minecraft.util.text.StringTextComponent
|
||||
import net.minecraft.util.text.TextFormatting.DARK_GREEN
|
||||
@@ -86,7 +86,7 @@ object CommandServerHelp : ICommand, CommandExecutionFunctionCtx<Boolean>{
|
||||
|
||||
send(source, emptyLine)
|
||||
send(source, TranslationTextComponent(headerKey, currentPage, totalPages).also {
|
||||
it.style.setFormatting(GREEN) // required to set a custom color on tokens
|
||||
it.style.color = GREEN // required to set a custom color on tokens
|
||||
})
|
||||
send(source, emptyLine)
|
||||
|
||||
@@ -101,7 +101,7 @@ object CommandServerHelp : ICommand, CommandExecutionFunctionCtx<Boolean>{
|
||||
send(source, chainTextComponents(
|
||||
StringTextComponent(" "),
|
||||
TranslationTextComponent("commands.hee.${name}.info").also {
|
||||
it.style.setFormatting(GRAY)
|
||||
it.style.color = GRAY
|
||||
}
|
||||
))
|
||||
}
|
||||
@@ -114,7 +114,7 @@ object CommandServerHelp : ICommand, CommandExecutionFunctionCtx<Boolean>{
|
||||
}
|
||||
|
||||
private fun sendInteractiveNavigation(source: CommandSource, currentPage: Int, totalPages: Int?) {
|
||||
val components = mutableListOf<IFormattableTextComponent>()
|
||||
val components = mutableListOf<ITextComponent>()
|
||||
|
||||
if (totalPages == null) {
|
||||
components.add(TranslationTextComponent("commands.hee.help.footer.admin").also {
|
||||
@@ -152,15 +152,15 @@ object CommandServerHelp : ICommand, CommandExecutionFunctionCtx<Boolean>{
|
||||
|
||||
if (page != null) {
|
||||
style.clickEvent = ClickEvent(RUN_COMMAND, "/${ModCommands.ROOT} help $page")
|
||||
style.setFormatting(GREEN)
|
||||
style.setUnderlined(true)
|
||||
style.color = GREEN
|
||||
style.underlined = true
|
||||
}
|
||||
else {
|
||||
style.setFormatting(DARK_GREEN)
|
||||
style.color = DARK_GREEN
|
||||
}
|
||||
}
|
||||
|
||||
private fun chainTextComponents(vararg components: IFormattableTextComponent): ITextComponent{
|
||||
return components.reduce(IFormattableTextComponent::append)
|
||||
private fun chainTextComponents(vararg components: ITextComponent): ITextComponent {
|
||||
return components.reduce(ITextComponent::appendSibling)
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.commands.server
|
||||
|
||||
import chylex.hee.commands.ICommand
|
||||
import chylex.hee.commands.arguments.EnumArgument.Companion.enum
|
||||
import chylex.hee.commands.exception
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.commands.server
|
||||
|
||||
import chylex.hee.commands.ICommand
|
||||
import chylex.hee.commands.exception
|
||||
import chylex.hee.commands.getPos
|
||||
@@ -15,7 +16,7 @@ import net.minecraft.command.Commands.literal
|
||||
import net.minecraft.command.arguments.BlockPosArgument.blockPos
|
||||
import net.minecraft.command.arguments.ResourceLocationArgument.getResourceLocation
|
||||
import net.minecraft.command.arguments.ResourceLocationArgument.resourceLocation
|
||||
import net.minecraft.loot.LootTable
|
||||
import net.minecraft.world.storage.loot.LootTable
|
||||
|
||||
object CommandServerLootChest : ICommand {
|
||||
override val name = "lootchest"
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.commands.server
|
||||
|
||||
import chylex.hee.commands.CommandExecutionFunctionCtx
|
||||
import chylex.hee.commands.ICommand
|
||||
import chylex.hee.commands.arguments.EnumArgument.Companion.enum
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.game.block
|
||||
|
||||
import chylex.hee.HEE
|
||||
import chylex.hee.game.block.properties.BlockBuilder
|
||||
import chylex.hee.game.inventory.isNotEmpty
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.game.block
|
||||
|
||||
import chylex.hee.game.block.entity.base.TileEntityBaseChest
|
||||
import chylex.hee.game.block.properties.BlockBuilder
|
||||
import chylex.hee.game.entity.living.ai.AIOcelotSitOverride.IOcelotCanSitOn
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.game.block
|
||||
|
||||
import chylex.hee.game.block.fluid.FlowingFluid5
|
||||
import chylex.hee.game.block.fluid.FluidBase
|
||||
import chylex.hee.game.block.logic.BlockCollisionLimiter
|
||||
@@ -16,15 +17,17 @@ import chylex.hee.system.serialization.getLongOrNull
|
||||
import chylex.hee.system.serialization.getOrCreateCompound
|
||||
import net.minecraft.block.BlockState
|
||||
import net.minecraft.block.material.Material
|
||||
import net.minecraft.block.material.MaterialColor
|
||||
import net.minecraft.entity.Entity
|
||||
import net.minecraft.util.math.BlockPos
|
||||
import net.minecraft.util.math.vector.Vector3d
|
||||
import net.minecraft.util.math.Vec3d
|
||||
import net.minecraft.world.IBlockReader
|
||||
import net.minecraft.world.IWorldReader
|
||||
import net.minecraft.world.World
|
||||
|
||||
abstract class BlockAbstractGoo(
|
||||
private val fluid: FluidBase,
|
||||
material: Material
|
||||
material: Material,
|
||||
) : BlockFlowingFluid(supply(fluid.still), Properties.create(material, fluid.mapColor).hardnessAndResistance(fluid.resistance).doesNotBlockMovement().noDrops()) {
|
||||
protected companion object {
|
||||
private const val LAST_TIME_TAG = "Time"
|
||||
@@ -96,8 +99,12 @@ abstract class BlockAbstractGoo(
|
||||
abstract fun onInsideGoo(entity: Entity)
|
||||
abstract fun modifyMotion(entity: Entity, level: Int)
|
||||
|
||||
override fun getMaterialColor(state: BlockState, world: IBlockReader, pos: BlockPos): MaterialColor {
|
||||
return fluid.mapColor
|
||||
}
|
||||
|
||||
@Sided(Side.CLIENT)
|
||||
override fun getFogColor(state: BlockState, world: IWorldReader, pos: BlockPos, entity: Entity, originalColor: Vector3d, partialTicks: Float): Vector3d{
|
||||
override fun getFogColor(state: BlockState, world: IWorldReader, pos: BlockPos, entity: Entity, originalColor: Vec3d, partialTicks: Float): Vec3d {
|
||||
return fluid.fogColor
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.game.block
|
||||
|
||||
import chylex.hee.game.block.properties.BlockBuilder
|
||||
import chylex.hee.game.world.allInBox
|
||||
import chylex.hee.game.world.allInBoxMutable
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.game.block
|
||||
|
||||
import chylex.hee.client.render.block.IBlockLayerCutout
|
||||
import chylex.hee.game.block.properties.BlockBuilder
|
||||
import chylex.hee.system.forge.Side
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.game.block
|
||||
|
||||
import chylex.hee.game.block.entity.base.TileEntityBaseTable
|
||||
import chylex.hee.game.block.properties.BlockBuilder
|
||||
import chylex.hee.game.world.getTile
|
||||
|
@@ -1,8 +1,10 @@
|
||||
package chylex.hee.game.block
|
||||
|
||||
import chylex.hee.client.render.block.IBlockLayerCutout
|
||||
import chylex.hee.game.block.properties.BlockBuilder
|
||||
import chylex.hee.game.world.breakBlock
|
||||
import chylex.hee.system.forge.SubscribeEvent
|
||||
import chylex.hee.system.math.Vec3
|
||||
import chylex.hee.system.migration.BlockWeb
|
||||
import chylex.hee.system.migration.EntityItem
|
||||
import chylex.hee.system.migration.EntityLivingBase
|
||||
@@ -14,7 +16,6 @@ import chylex.hee.system.migration.ItemSword
|
||||
import net.minecraft.block.BlockState
|
||||
import net.minecraft.entity.Entity
|
||||
import net.minecraft.util.math.BlockPos
|
||||
import net.minecraft.util.math.vector.Vector3d
|
||||
import net.minecraft.util.math.shapes.ISelectionContext
|
||||
import net.minecraft.util.math.shapes.VoxelShape
|
||||
import net.minecraft.util.math.shapes.VoxelShapes
|
||||
@@ -52,7 +53,7 @@ class BlockAncientCobweb(builder: BlockBuilder) : BlockWeb(builder.p), IBlockLay
|
||||
|
||||
override fun onEntityCollision(state: BlockState, world: World, pos: BlockPos, entity: Entity) {
|
||||
if (entity is EntityItem) {
|
||||
entity.setMotionMultiplier(state, Vector3d(0.6, 0.6, 0.6))
|
||||
entity.setMotionMultiplier(state, Vec3.xyz(0.6))
|
||||
}
|
||||
else if (!world.isRemote) {
|
||||
val canBreak = when(entity) {
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.game.block
|
||||
|
||||
import chylex.hee.client.render.block.IBlockLayerCutout
|
||||
import chylex.hee.game.block.entity.TileEntityBrewingStandCustom
|
||||
import chylex.hee.game.block.properties.BlockBuilder
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.game.block
|
||||
|
||||
import chylex.hee.game.block.properties.BlockBuilder
|
||||
import net.minecraft.item.ItemStack
|
||||
import net.minecraft.item.Items
|
||||
|
@@ -1,4 +1,5 @@
|
||||
package chylex.hee.game.block
|
||||
|
||||
import chylex.hee.game.block.properties.BlockBuilder
|
||||
import chylex.hee.game.potion.brewing.PotionItems
|
||||
import chylex.hee.system.migration.PotionTypes
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user