1
0
mirror of https://github.com/chylex/Hardcore-Ender-Expansion-2.git synced 2025-11-19 08:22:35 +01:00

28 Commits

Author SHA1 Message Date
b64005357e [WIP] Components 2021-02-28 14:33:35 +01:00
3279dde625 Add a component system 2021-02-28 13:29:18 +01:00
a9df51e315 Refactor Ender Eye spawner particle data to use FxVecData 2021-02-27 23:57:40 +01:00
322c005648 Implement Tomb Dungeon mob spawn triggers 2021-02-27 23:16:27 +01:00
5211731e62 Tweak Dusty Stone crumble behavior for light mobs 2021-02-27 20:57:13 +01:00
08d2fcb19c Fix overriding canCreatureSpawn instead of canEntitySpawn 2021-02-07 14:00:13 +01:00
e9077c680f Move unit tests and add main methods with special tests 2021-01-23 14:18:46 +01:00
276df76979 Fix Transform mirroring entity yaw incorrectly 2021-01-02 22:23:18 +01:00
14788dd9ad Fix invisible bottom layer in Jar o' Dust when placed on transparent block 2020-12-31 21:25:57 +01:00
5b69abf29e Make Jar o' Dust layers more visible & add dust compression effect 2020-12-31 21:25:28 +01:00
dd6f4fa4d1 Implement Jar o' Dust generation in Tomb Dungeon 2020-12-31 21:16:07 +01:00
414b11aa0d Implement Undread spawning in Forgotten Tombs 2020-12-30 00:11:12 +01:00
14fbcac4e0 Make Undreads avoid unsupported Dusty Stone when not in aggro 2020-12-29 21:36:22 +01:00
3e0aedc039 Add entity ground navigator that supports custom node processors 2020-12-29 21:33:38 +01:00
20c21f9afa Fix overriding wrong overload of getBlockPathWeight in entities 2020-12-29 19:49:45 +01:00
f4fac58b32 Add special handler for entities colliding with full blocks instead of making collision boxes slightly shorter 2020-12-29 17:38:00 +01:00
f21a4fbf3f Replace broken EntitySelector.inDimension 2020-12-29 17:24:49 +01:00
c9ad94bcb4 Fix portal rendering in fog 2020-12-29 15:11:14 +01:00
1a11754bad Reformat code 2020-12-25 09:15:22 +01:00
421cadb545 Fix IntelliJ folder exclusions in build.gradle 2020-12-25 00:05:27 +01:00
596042b255 Work on Forgotten Tombs environment (dust particles, Grave Dirt sounds) 2020-12-20 19:27:06 +01:00
f4bfd0f8e3 Add IntColor properties for RGBA as floats 2020-12-20 15:43:45 +01:00
373087e33c Fix debug mode not removing territory fog 2020-12-19 12:57:07 +01:00
a46524e518 Finalize The Hub environment 2020-12-19 12:40:50 +01:00
ecd48ec345 Address a few technical TODOs and tweak code 2020-12-15 20:44:36 +01:00
8c21bcad67 Partially fix rendering issues with lightmaps and fog after updating from 1.14 2020-12-15 20:27:00 +01:00
7b54a8885a IntelliJ folder exclusions are fucked... 2020-12-11 17:03:00 +01:00
e587f212eb Refactor Vec3d uses to simplify eventual 1.16 transition 2020-12-08 05:37:13 +01:00
898 changed files with 12604 additions and 10425 deletions

2
.idea/gradle.xml generated
View File

@@ -4,6 +4,8 @@
<component name="GradleSettings"> <component name="GradleSettings">
<option name="linkedExternalProjectsSettings"> <option name="linkedExternalProjectsSettings">
<GradleProjectSettings> <GradleProjectSettings>
<option name="delegatedBuild" value="true" />
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" /> <option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" /> <option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules"> <option name="modules">

1
.idea/misc.xml generated
View File

@@ -14,7 +14,6 @@
<item index="9" class="java.lang.String" itemvalue="net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.Name" /> <item index="9" class="java.lang.String" itemvalue="net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.Name" />
</list> </list>
</component> </component>
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FrameworkDetectionExcludesConfiguration"> <component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" /> <file type="web" url="file://$PROJECT_DIR$" />
</component> </component>

View File

@@ -1,2 +1,3 @@
# Hardcore Ender Expansion 2 # Hardcore Ender Expansion 2
Work in progress. PRs will not be accepted before release. Work in progress. PRs will not be accepted before release.

View File

@@ -1,8 +1,8 @@
ext { ext {
mc_version = "1.16.4" mc_version = "1.15.2"
forge_version = "35.1.2" forge_version = "31.2.45"
mapping_version = "20201028-1.16.3" mapping_version = "20200626-1.15.1"
kotlin_mod_version = "1.6.2" kotlin_mod_version = "1.6.1"
} }
buildscript { buildscript {
@@ -49,8 +49,16 @@ archivesBaseName = metaName.replaceAll("\\s", "")
idea { idea {
module { module {
[".idea", ".settings", ".classpath", ".project", "gradle", "out", "run"].each { [".idea", ".settings", ".gradle", "build", "gradle", "out", "run", "src/main/kotlin", "src/test/kotlin"].each {
excludeDirs << file(it) 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)
} }
} }
} }

View File

@@ -1,4 +1,5 @@
package chylex.hee.datagen package chylex.hee.datagen
import chylex.hee.HEE import chylex.hee.HEE
import chylex.hee.datagen.client.BlockItemModels import chylex.hee.datagen.client.BlockItemModels
import chylex.hee.datagen.client.BlockModels import chylex.hee.datagen.client.BlockModels

View File

@@ -1,4 +1,5 @@
package chylex.hee.datagen package chylex.hee.datagen
import chylex.hee.HEE import chylex.hee.HEE
import chylex.hee.system.facades.Resource import chylex.hee.system.facades.Resource
import net.minecraft.block.Block import net.minecraft.block.Block

View File

@@ -1,4 +1,5 @@
package chylex.hee.datagen.client package chylex.hee.datagen.client
import chylex.hee.datagen.client.util.block import chylex.hee.datagen.client.util.block
import chylex.hee.datagen.client.util.multi import chylex.hee.datagen.client.util.multi
import chylex.hee.datagen.client.util.override import chylex.hee.datagen.client.util.override

View File

@@ -1,4 +1,5 @@
package chylex.hee.datagen.client package chylex.hee.datagen.client
import chylex.hee.datagen.client.util.cauldron import chylex.hee.datagen.client.util.cauldron
import chylex.hee.datagen.client.util.cross import chylex.hee.datagen.client.util.cross
import chylex.hee.datagen.client.util.cube 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_top", it)
texture("overlay_side", 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_top", it)
texture("overlay_side", 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_top", it)
texture("overlay_side", it) texture("overlay_side", it)
}} }
}
table(ModBlocks.ACCUMULATION_TABLE_TIER_1) table(ModBlocks.ACCUMULATION_TABLE_TIER_1)
table(ModBlocks.ACCUMULATION_TABLE_TIER_2) table(ModBlocks.ACCUMULATION_TABLE_TIER_2)

View File

@@ -1,4 +1,5 @@
package chylex.hee.datagen.client package chylex.hee.datagen.client
import chylex.hee.datagen.client.util.cube import chylex.hee.datagen.client.util.cube
import chylex.hee.datagen.client.util.log import chylex.hee.datagen.client.util.log
import chylex.hee.datagen.client.util.pillar import chylex.hee.datagen.client.util.pillar

View File

@@ -1,4 +1,5 @@
package chylex.hee.datagen.client package chylex.hee.datagen.client
import chylex.hee.datagen.client.util.layers import chylex.hee.datagen.client.util.layers
import chylex.hee.datagen.client.util.multi import chylex.hee.datagen.client.util.multi
import chylex.hee.datagen.client.util.override import chylex.hee.datagen.client.util.override

View File

@@ -1,4 +1,5 @@
package chylex.hee.datagen.client.util package chylex.hee.datagen.client.util
import chylex.hee.datagen.Callback import chylex.hee.datagen.Callback
import chylex.hee.datagen.path import chylex.hee.datagen.path
import chylex.hee.datagen.r import chylex.hee.datagen.r

View File

@@ -1,4 +1,5 @@
package chylex.hee.datagen.client.util package chylex.hee.datagen.client.util
import chylex.hee.datagen.r import chylex.hee.datagen.r
import chylex.hee.datagen.safeUnit import chylex.hee.datagen.safeUnit
import chylex.hee.system.migration.BlockLog import chylex.hee.system.migration.BlockLog

View File

@@ -1,4 +1,5 @@
package chylex.hee.datagen.client.util package chylex.hee.datagen.client.util
import chylex.hee.datagen.Callback import chylex.hee.datagen.Callback
import chylex.hee.datagen.path import chylex.hee.datagen.path
import chylex.hee.datagen.r import chylex.hee.datagen.r

View File

@@ -1,4 +1,5 @@
package chylex.hee.datagen.server package chylex.hee.datagen.server
import chylex.hee.datagen.server.util.BlockLootTableProvider import chylex.hee.datagen.server.util.BlockLootTableProvider
import chylex.hee.init.ModBlocks import chylex.hee.init.ModBlocks
import chylex.hee.init.ModItems import chylex.hee.init.ModItems

View File

@@ -1,4 +1,5 @@
package chylex.hee.datagen.server package chylex.hee.datagen.server
import chylex.hee.datagen.server.util.add import chylex.hee.datagen.server.util.add
import chylex.hee.game.block.BlockWhitebarkSapling import chylex.hee.game.block.BlockWhitebarkSapling
import chylex.hee.init.ModBlocks import chylex.hee.init.ModBlocks

View File

@@ -1,4 +1,5 @@
package chylex.hee.datagen.server package chylex.hee.datagen.server
import chylex.hee.init.ModItems import chylex.hee.init.ModItems
import net.minecraft.data.DataGenerator import net.minecraft.data.DataGenerator
import net.minecraft.data.ItemTagsProvider import net.minecraft.data.ItemTagsProvider

View File

@@ -1,17 +1,18 @@
package chylex.hee.datagen.server.util package chylex.hee.datagen.server.util
import chylex.hee.system.migration.BlockFlowerPot import chylex.hee.system.migration.BlockFlowerPot
import com.mojang.datafixers.util.Pair import com.mojang.datafixers.util.Pair
import net.minecraft.block.Block import net.minecraft.block.Block
import net.minecraft.data.DataGenerator import net.minecraft.data.DataGenerator
import net.minecraft.data.LootTableProvider import net.minecraft.data.LootTableProvider
import net.minecraft.data.loot.BlockLootTables 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.IItemProvider
import net.minecraft.util.ResourceLocation 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.BiConsumer
import java.util.function.Consumer import java.util.function.Consumer
import java.util.function.Supplier import java.util.function.Supplier

View File

@@ -1,4 +1,5 @@
package chylex.hee.datagen.server.util package chylex.hee.datagen.server.util
import net.minecraft.tags.Tag import net.minecraft.tags.Tag
fun <T> Tag.Builder<T>.add(items: List<T>) { fun <T> Tag.Builder<T>.add(items: List<T>) {

View File

@@ -1,4 +1,5 @@
package chylex.hee package chylex.hee
import chylex.hee.game.block.BlockBrewingStandCustom import chylex.hee.game.block.BlockBrewingStandCustom
import chylex.hee.game.block.BlockEndPortalOverride import chylex.hee.game.block.BlockEndPortalOverride
import chylex.hee.game.block.BlockShulkerBoxOverride 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.SubscribeAllEvents
import chylex.hee.system.forge.SubscribeEvent import chylex.hee.system.forge.SubscribeEvent
import net.minecraft.block.Blocks import net.minecraft.block.Blocks
import net.minecraft.world.dimension.DimensionType
import net.minecraftforge.fml.DistExecutor import net.minecraftforge.fml.DistExecutor
import net.minecraftforge.fml.DistExecutor.SafeSupplier import net.minecraftforge.fml.DistExecutor.SafeSupplier
import net.minecraftforge.fml.ModLoadingContext import net.minecraftforge.fml.ModLoadingContext

View File

@@ -1,17 +1,16 @@
package chylex.hee.client package chylex.hee.client
import chylex.hee.HEE import chylex.hee.HEE
import chylex.hee.system.facades.Resource import chylex.hee.system.facades.Resource
import chylex.hee.system.migration.supply import chylex.hee.system.migration.supply
import net.minecraft.client.Minecraft import net.minecraft.client.Minecraft
import net.minecraft.resources.IPackFinder import net.minecraft.resources.IPackFinder
import net.minecraft.resources.IPackNameDecorator
import net.minecraft.resources.IResourcePack import net.minecraft.resources.IResourcePack
import net.minecraft.resources.ResourcePackInfo import net.minecraft.resources.ResourcePackInfo
import net.minecraft.resources.ResourcePackInfo.IFactory import net.minecraft.resources.ResourcePackInfo.IFactory
import net.minecraft.resources.ResourcePackInfo.Priority import net.minecraft.resources.ResourcePackInfo.Priority
import net.minecraft.resources.ResourcePackType import net.minecraft.resources.ResourcePackType
import net.minecraftforge.fml.packs.ResourcePackLoader import net.minecraftforge.fml.packs.ResourcePackLoader
import java.util.function.Consumer
object VanillaResourceOverrides : IPackFinder { object VanillaResourceOverrides : IPackFinder {
fun register() { 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 delegate = ResourcePackLoader.getResourcePackFor(HEE.ID).get()
val supplier = supply<IResourcePack>(Pack(delegate)) 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 { private class Pack(delegate: IResourcePack) : IResourcePack by delegate {

View File

@@ -1,12 +1,13 @@
package chylex.hee.client.gui package chylex.hee.client.gui
import chylex.hee.client.gui.base.GuiBaseChestContainer import chylex.hee.client.gui.base.GuiBaseChestContainer
import chylex.hee.game.container.ContainerAmuletOfRecovery import chylex.hee.game.container.ContainerAmuletOfRecovery
import chylex.hee.network.server.PacketServerContainerEvent import chylex.hee.network.server.PacketServerContainerEvent
import chylex.hee.system.forge.Side import chylex.hee.system.forge.Side
import chylex.hee.system.forge.Sided import chylex.hee.system.forge.Sided
import net.minecraft.client.resources.I18n
import net.minecraft.entity.player.PlayerInventory import net.minecraft.entity.player.PlayerInventory
import net.minecraft.util.text.ITextComponent import net.minecraft.util.text.ITextComponent
import net.minecraft.util.text.TranslationTextComponent
import net.minecraftforge.fml.client.gui.widget.ExtendedButton import net.minecraftforge.fml.client.gui.widget.ExtendedButton
@Sided(Side.CLIENT) @Sided(Side.CLIENT)
@@ -14,8 +15,8 @@ class GuiAmuletOfRecovery(container: ContainerAmuletOfRecovery, inventory: Playe
override fun init() { override fun init() {
super.init() super.init()
val moveAllTitle = TranslationTextComponent("gui.hee.amulet_of_recovery.move_all") val moveAllTitle = I18n.format("gui.hee.amulet_of_recovery.move_all")
val moveAllWidth = (font.getStringPropertyWidth(moveAllTitle) + 14).coerceAtMost(xSize / 2) val moveAllWidth = (font.getStringWidth(moveAllTitle) + 14).coerceAtMost(xSize / 2)
addButton(ExtendedButton(guiLeft + xSize - moveAllWidth - 7, (height / 2) + 6, moveAllWidth, 11, moveAllTitle) { addButton(ExtendedButton(guiLeft + xSize - moveAllWidth - 7, (height / 2) + 6, moveAllWidth, 11, moveAllTitle) {
PacketServerContainerEvent(0).sendToServer() PacketServerContainerEvent(0).sendToServer()

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.gui package chylex.hee.client.gui
import chylex.hee.client.MC import chylex.hee.client.MC
import chylex.hee.client.render.gl.GL import chylex.hee.client.render.gl.GL
import chylex.hee.game.block.entity.TileEntityBrewingStandCustom 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.facades.Resource
import chylex.hee.system.forge.Side import chylex.hee.system.forge.Side
import chylex.hee.system.forge.Sided import chylex.hee.system.forge.Sided
import com.mojang.blaze3d.matrix.MatrixStack
import net.minecraft.client.gui.screen.inventory.BrewingStandScreen import net.minecraft.client.gui.screen.inventory.BrewingStandScreen
import net.minecraft.entity.player.PlayerInventory import net.minecraft.entity.player.PlayerInventory
import net.minecraft.inventory.container.BrewingStandContainer import net.minecraft.inventory.container.BrewingStandContainer
@@ -21,13 +21,13 @@ class GuiBrewingStandCustom(container: BrewingStandContainer, inventory: PlayerI
private var brewStartTime = MC.world!!.totalTime 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 x = (width - xSize) / 2
val y = (height - ySize) / 2 val y = (height - ySize) / 2
GL.color(1F, 1F, 1F, 1F) GL.color(1F, 1F, 1F, 1F)
GL.bindTexture(TEX_BACKGROUND) 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 worldTime = MC.world!!.totalTime
val brewTime = container.func_216981_f() // RENAME getBrewTime 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() val brewProgress = (28F * (1F - (brewTime / 400F))).toInt()
if (brewProgress > 0) { 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] val bubbleLength = BUBBLE_LENGTHS[((worldTime - brewStartTime).toInt() / 2) % 7]
if (bubbleLength > 0) { 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 { else {
@@ -50,14 +50,14 @@ class GuiBrewingStandCustom(container: BrewingStandContainer, inventory: PlayerI
} }
if (container.getSlot(TileEntityBrewingStandCustom.SLOT_MODIFIER).hasStack) { 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) { for(slotIndex in TileEntityBrewingStandCustom.SLOTS_POTIONS) {
val slot = container.getSlot(slotIndex) val slot = container.getSlot(slotIndex)
if (!slot.hasStack) { 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)
} }
} }
} }

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.gui package chylex.hee.client.gui
import chylex.hee.client.gui.base.GuiBaseChestContainer import chylex.hee.client.gui.base.GuiBaseChestContainer
import chylex.hee.game.block.entity.TileEntityLootChest import chylex.hee.game.block.entity.TileEntityLootChest
import chylex.hee.game.container.ContainerLootChest import chylex.hee.game.container.ContainerLootChest

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.gui package chylex.hee.client.gui
import chylex.hee.client.gui.base.GuiBaseChestContainer import chylex.hee.client.gui.base.GuiBaseChestContainer
import chylex.hee.game.container.ContainerPortalTokenStorage import chylex.hee.game.container.ContainerPortalTokenStorage
import chylex.hee.system.forge.Side import chylex.hee.system.forge.Side

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.gui package chylex.hee.client.gui
import chylex.hee.client.gui.base.GuiBaseChestContainer import chylex.hee.client.gui.base.GuiBaseChestContainer
import chylex.hee.game.container.ContainerShulkerBox import chylex.hee.game.container.ContainerShulkerBox
import chylex.hee.system.forge.Side import chylex.hee.system.forge.Side

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.gui package chylex.hee.client.gui
import chylex.hee.client.gui.base.GuiBaseCustomInventory import chylex.hee.client.gui.base.GuiBaseCustomInventory
import chylex.hee.game.container.ContainerTrinketPouch import chylex.hee.game.container.ContainerTrinketPouch
import chylex.hee.game.container.base.ContainerBaseCustomInventory 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.facades.Resource
import chylex.hee.system.forge.Side import chylex.hee.system.forge.Side
import chylex.hee.system.forge.Sided import chylex.hee.system.forge.Sided
import com.mojang.blaze3d.matrix.MatrixStack
import net.minecraft.entity.player.PlayerInventory import net.minecraft.entity.player.PlayerInventory
import net.minecraft.util.text.ITextComponent 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 hiddenSlots = ContainerTrinketPouch.MAX_SLOTS - (container as ContainerBaseCustomInventory<*>).containerInventory.size
} }
override fun drawGuiContainerBackgroundLayer(matrix: MatrixStack, partialTicks: Float, mouseX: Int, mouseY: Int){ override fun drawGuiContainerBackgroundLayer(partialTicks: Float, mouseX: Int, mouseY: Int) {
super.drawGuiContainerBackgroundLayer(matrix, partialTicks, mouseX, mouseY) super.drawGuiContainerBackgroundLayer(partialTicks, mouseX, mouseY)
val middleSlot = ContainerTrinketPouch.MAX_SLOTS / 2 val middleSlot = ContainerTrinketPouch.MAX_SLOTS / 2
repeat(hiddenSlots) { 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 x = guiLeft + 44 + (index * 18)
val y = guiTop + 18 val y = guiTop + 18
fill(matrix, x, y, x + 16, y + 16, hiddenSlotColor) fill(x, y, x + 16, y + 16, hiddenSlotColor)
} }
} }

View File

@@ -1,11 +1,11 @@
package chylex.hee.client.gui.base package chylex.hee.client.gui.base
import chylex.hee.client.render.gl.GL import chylex.hee.client.render.gl.GL
import chylex.hee.game.inventory.size import chylex.hee.game.inventory.size
import chylex.hee.system.color.IntColor.Companion.RGB import chylex.hee.system.color.IntColor.Companion.RGB
import chylex.hee.system.facades.Resource import chylex.hee.system.facades.Resource
import chylex.hee.system.forge.Side import chylex.hee.system.forge.Side
import chylex.hee.system.forge.Sided import chylex.hee.system.forge.Sided
import com.mojang.blaze3d.matrix.MatrixStack
import net.minecraft.client.gui.screen.inventory.ContainerScreen import net.minecraft.client.gui.screen.inventory.ContainerScreen
import net.minecraft.entity.player.PlayerInventory import net.minecraft.entity.player.PlayerInventory
import net.minecraft.inventory.container.ChestContainer import net.minecraft.inventory.container.ChestContainer
@@ -24,25 +24,25 @@ abstract class GuiBaseChestContainer<T : ChestContainer>(container: T, inventory
ySize = 114 + (containerRows * 18) ySize = 114 + (containerRows * 18)
} }
override fun render(matrix: MatrixStack, mouseX: Int, mouseY: Int, partialTicks: Float){ override fun render(mouseX: Int, mouseY: Int, partialTicks: Float) {
renderBackground(matrix) renderBackground()
super.render(matrix, mouseX, mouseY, partialTicks) super.render(mouseX, mouseY, partialTicks)
renderHoveredTooltip(matrix, mouseX, mouseY) 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 x = (width - xSize) / 2
val y = (height - ySize) / 2 val y = (height - ySize) / 2
val heightContainer = 17 + (containerRows * 18) val heightContainer = 17 + (containerRows * 18)
GL.color(1F, 1F, 1F, 1F) GL.color(1F, 1F, 1F, 1F)
GL.bindTexture(TEX_BACKGROUND) GL.bindTexture(TEX_BACKGROUND)
blit(matrix, x, y, 0, 0, xSize, heightContainer) blit(x, y, 0, 0, xSize, heightContainer)
blit(matrix, x, y + heightContainer, 0, 126, xSize, 96) blit(x, y + heightContainer, 0, 126, xSize, 96)
} }
override fun drawGuiContainerForegroundLayer(matrix: MatrixStack, mouseX: Int, mouseY: Int){ override fun drawGuiContainerForegroundLayer(mouseX: Int, mouseY: Int) {
font.drawString(matrix, title.string, 8F, 6F, COLOR_TEXT) font.drawString(title.formattedText, 8F, 6F, COLOR_TEXT)
font.drawString(matrix, playerInventory.displayName.string, 8F, ySize - 94F, COLOR_TEXT) font.drawString(playerInventory.displayName.formattedText, 8F, ySize - 94F, COLOR_TEXT)
} }
} }

View File

@@ -1,10 +1,10 @@
package chylex.hee.client.gui.base package chylex.hee.client.gui.base
import chylex.hee.client.render.gl.GL import chylex.hee.client.render.gl.GL
import chylex.hee.game.container.base.ContainerBaseCustomInventory import chylex.hee.game.container.base.ContainerBaseCustomInventory
import chylex.hee.system.color.IntColor.Companion.RGB import chylex.hee.system.color.IntColor.Companion.RGB
import chylex.hee.system.forge.Side import chylex.hee.system.forge.Side
import chylex.hee.system.forge.Sided import chylex.hee.system.forge.Sided
import com.mojang.blaze3d.matrix.MatrixStack
import net.minecraft.client.gui.screen.inventory.ContainerScreen import net.minecraft.client.gui.screen.inventory.ContainerScreen
import net.minecraft.entity.player.PlayerInventory import net.minecraft.entity.player.PlayerInventory
import net.minecraft.util.ResourceLocation import net.minecraft.util.ResourceLocation
@@ -19,23 +19,23 @@ abstract class GuiBaseCustomInventory<T : ContainerBaseCustomInventory<*>>(conta
protected abstract val texBackground: ResourceLocation protected abstract val texBackground: ResourceLocation
protected abstract val titleContainer: String protected abstract val titleContainer: String
override fun render(matrix: MatrixStack, mouseX: Int, mouseY: Int, partialTicks: Float){ override fun render(mouseX: Int, mouseY: Int, partialTicks: Float) {
renderBackground(matrix) renderBackground()
super.render(matrix, mouseX, mouseY, partialTicks) super.render(mouseX, mouseY, partialTicks)
renderHoveredTooltip(matrix, mouseX, mouseY) 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 x = (width - xSize) / 2
val y = (height - ySize) / 2 val y = (height - ySize) / 2
GL.color(1F, 1F, 1F, 1F) GL.color(1F, 1F, 1F, 1F)
GL.bindTexture(texBackground) 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){ override fun drawGuiContainerForegroundLayer(mouseX: Int, mouseY: Int) {
font.drawString(matrix, title.string, 8F, 6F, COLOR_TEXT) font.drawString(title.formattedText, 8F, 6F, COLOR_TEXT)
font.drawString(matrix, playerInventory.displayName.string, 8F, ySize - 94F, COLOR_TEXT) font.drawString(playerInventory.displayName.formattedText, 8F, ySize - 94F, COLOR_TEXT)
} }
} }

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.model.block package chylex.hee.client.model.block
import chylex.hee.client.model.beginBox import chylex.hee.client.model.beginBox
import chylex.hee.client.render.gl.translateZ import chylex.hee.client.render.gl.translateZ
import chylex.hee.system.forge.Side 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.RenderType
import net.minecraft.client.renderer.model.Model import net.minecraft.client.renderer.model.Model
import net.minecraft.client.renderer.model.ModelRenderer 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.PI
import kotlin.math.abs import kotlin.math.abs
import kotlin.math.sin import kotlin.math.sin
@@ -40,7 +41,7 @@ object ModelBlockIgneousPlate : Model(RenderType::getEntityCutout){
outerBox.render(matrix, builder, combinedLight, combinedOverlay, red, green, blue, alpha) 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.push()
matrix.translateZ(-abs(sin(-animation)).toFloat() * 0.0925) matrix.translateZ(-abs(sin(-animation)).toFloat() * 0.0925)
innerBox.render(matrix, builder, combinedLight, combinedOverlay, color.x.toFloat(), color.y.toFloat(), color.z.toFloat(), 1F) innerBox.render(matrix, builder, combinedLight, combinedOverlay, color.x.toFloat(), color.y.toFloat(), color.z.toFloat(), 1F)

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.model.entity package chylex.hee.client.model.entity
import chylex.hee.client.model.FACE_FRONT import chylex.hee.client.model.FACE_FRONT
import chylex.hee.client.model.beginBox import chylex.hee.client.model.beginBox
import chylex.hee.client.model.retainFace import chylex.hee.client.model.retainFace

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.model.entity package chylex.hee.client.model.entity
import chylex.hee.client.MC import chylex.hee.client.MC
import chylex.hee.client.model.FACE_FRONT import chylex.hee.client.model.FACE_FRONT
import chylex.hee.client.model.beginBox 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) { override fun setLivingAnimations(entity: EntityMobBlobby, limbSwing: Float, limbSwingAmount: Float, partialTicks: Float) {
entity.color.let { entity.color.let {
r = it.red / 255F r = it.redF
g = it.green / 255F g = it.greenF
b = it.blue / 255F b = it.blueF
} }
} }

View File

@@ -1,11 +1,12 @@
package chylex.hee.client.model.entity package chylex.hee.client.model.entity
import chylex.hee.game.entity.living.EntityMobUndread import chylex.hee.game.entity.living.EntityMobUndread
import chylex.hee.system.forge.Side import chylex.hee.system.forge.Side
import chylex.hee.system.forge.Sided import chylex.hee.system.forge.Sided
import net.minecraft.client.renderer.entity.model.AbstractZombieModel import net.minecraft.client.renderer.entity.model.AbstractZombieModel
@Sided(Side.CLIENT) @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(modelSize: Float, tallTexture: Boolean) : this(modelSize, 64, if (tallTexture) 32 else 64)
constructor() : this(0F, false) constructor() : this(0F, false)

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.model.entity package chylex.hee.client.model.entity
import chylex.hee.client.model.beginBox import chylex.hee.client.model.beginBox
import chylex.hee.game.entity.item.EntityTokenHolder import chylex.hee.game.entity.item.EntityTokenHolder
import chylex.hee.system.forge.Side import chylex.hee.system.forge.Side

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.model.item package chylex.hee.client.model.item
import chylex.hee.HEE import chylex.hee.HEE
import chylex.hee.client.MC import chylex.hee.client.MC
import chylex.hee.system.facades.Resource import chylex.hee.system.facades.Resource

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render package chylex.hee.client.render
import chylex.hee.HEE import chylex.hee.HEE
import chylex.hee.client.MC import chylex.hee.client.MC
import chylex.hee.client.render.gl.DF_ONE_MINUS_SRC_ALPHA import chylex.hee.client.render.gl.DF_ONE_MINUS_SRC_ALPHA
@@ -78,7 +79,7 @@ object OverlayRenderer{
GL.bindTexture(TEX_PURIFIED_ENDER_GOO_OVERLAY) 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) GL.color(1F, 1F, 1F, 1F)
} }
@@ -90,7 +91,6 @@ object OverlayRenderer{
fun onRenderText(@Suppress("UNUSED_PARAMETER") e: RenderGameOverlayEvent.Text) { fun onRenderText(@Suppress("UNUSED_PARAMETER") e: RenderGameOverlayEvent.Text) {
fun drawTextOffScreenCenter(x: Int, y: Int, line: Int, text: String, color: IntColor) { fun drawTextOffScreenCenter(x: Int, y: Int, line: Int, text: String, color: IntColor) {
val window = MC.window val window = MC.window
val matrix = e.matrixStack
with(MC.fontRenderer) { with(MC.fontRenderer) {
val centerX = x + (window.scaledWidth / 2) val centerX = x + (window.scaledWidth / 2)
@@ -102,8 +102,8 @@ object OverlayRenderer{
val offsetX = -(textWidth / 2) val offsetX = -(textWidth / 2)
val offsetY = -(textHeight / 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) 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(matrix, text, (centerX + offsetX).toFloat(), (centerY + offsetY).toFloat(), color.i) drawStringWithShadow(text, (centerX + offsetX).toFloat(), (centerY + offsetY).toFloat(), color.i)
} }
} }

View File

@@ -1,20 +1,24 @@
package chylex.hee.client.render package chylex.hee.client.render
import chylex.hee.HEE import chylex.hee.HEE
import chylex.hee.client.MC import chylex.hee.client.MC
import chylex.hee.client.render.gl.DF_ONE_MINUS_SRC_ALPHA 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.DF_ZERO
import chylex.hee.client.render.gl.FOG_EXP2
import chylex.hee.client.render.gl.GL import chylex.hee.client.render.gl.GL
import chylex.hee.client.render.gl.SF_ONE import chylex.hee.client.render.gl.SF_ONE
import chylex.hee.client.render.gl.SF_SRC_ALPHA 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.lookDirVec
import chylex.hee.game.entity.posVec import chylex.hee.game.entity.posVec
import chylex.hee.game.particle.ParticleVoid import chylex.hee.game.particle.ParticleVoid
import chylex.hee.game.particle.spawner.ParticleSpawnerCustom import chylex.hee.game.particle.spawner.ParticleSpawnerCustom
import chylex.hee.game.particle.spawner.properties.IOffset.InBox import chylex.hee.game.particle.spawner.properties.IOffset.InBox
import chylex.hee.game.particle.spawner.properties.IShape.Point 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.TerritoryType
import chylex.hee.game.world.territory.TerritoryVoid import chylex.hee.game.world.territory.TerritoryVoid
import chylex.hee.game.world.territory.properties.TerritoryEnvironment
import chylex.hee.system.Debug import chylex.hee.system.Debug
import chylex.hee.system.color.IntColor import chylex.hee.system.color.IntColor
import chylex.hee.system.color.IntColor.Companion.RGB 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.SubscribeAllEvents
import chylex.hee.system.forge.SubscribeEvent import chylex.hee.system.forge.SubscribeEvent
import chylex.hee.system.math.LerpedFloat import chylex.hee.system.math.LerpedFloat
import chylex.hee.system.math.Vec3
import chylex.hee.system.math.floorToInt import chylex.hee.system.math.floorToInt
import chylex.hee.system.math.scale import chylex.hee.system.math.scale
import chylex.hee.system.migration.EntityPlayer import chylex.hee.system.migration.EntityPlayer
import com.mojang.blaze3d.matrix.MatrixStack
import net.minecraft.client.resources.I18n 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.client.event.RenderGameOverlayEvent
import net.minecraftforge.common.MinecraftForge import net.minecraftforge.common.MinecraftForge
import net.minecraftforge.event.TickEvent.ClientTickEvent import net.minecraftforge.event.TickEvent.ClientTickEvent
@@ -38,6 +44,17 @@ import kotlin.math.pow
@SubscribeAllEvents(Side.CLIENT, modid = HEE.ID) @SubscribeAllEvents(Side.CLIENT, modid = HEE.ID)
object TerritoryRenderer { 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 prevChunkX = Int.MAX_VALUE
private var prevTerritory: TerritoryType? = null private var prevTerritory: TerritoryType? = null
@@ -46,7 +63,7 @@ object TerritoryRenderer{
if (e.phase == Phase.START) { if (e.phase == Phase.START) {
val player = MC.player 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) Void.tick(player)
Title.tick() 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 // Void handling
val VOID_FACTOR_VALUE val VOID_FACTOR_VALUE
@@ -123,7 +159,7 @@ object TerritoryRenderer{
@SubscribeEvent @SubscribeEvent
fun onRenderGameOverlayText(e: RenderGameOverlayEvent.Text) { 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) { with(e.left) {
add("") add("")
add("End Void Factor: ${"%.3f".format(voidFactor.currentValue)}") add("End Void Factor: ${"%.3f".format(voidFactor.currentValue)}")
@@ -204,8 +240,8 @@ object TerritoryRenderer{
val x = -fontRenderer.getStringWidth(textTitle) * 0.5F val x = -fontRenderer.getStringWidth(textTitle) * 0.5F
val y = -fontRenderer.FONT_HEIGHT - 2F val y = -fontRenderer.FONT_HEIGHT - 2F
drawTitle(e.matrixStack, x + 0.5F, y + 0.5F, textShadowColor.withAlpha(opacity.pow(1.25F))) drawTitle(x + 0.5F, y + 0.5F, textShadowColor.withAlpha(opacity.pow(1.25F)))
drawTitle(e.matrixStack, x, y, textMainColor.withAlpha(opacity)) drawTitle(x, y, textMainColor.withAlpha(opacity))
GL.popMatrix() GL.popMatrix()
GL.alphaFunc(GL_GREATER, 0.1F) GL.alphaFunc(GL_GREATER, 0.1F)
@@ -213,9 +249,9 @@ object TerritoryRenderer{
GL.popMatrix() 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 if (color.alpha > 3) { // prevents flickering alpha
MC.fontRenderer.drawString(matrix, textTitle, x, y, color.i) MC.fontRenderer.drawString(textTitle, x, y, color.i)
} }
} }
} }

View File

@@ -1,8 +1,10 @@
package chylex.hee.client.render.block package chylex.hee.client.render.block
import chylex.hee.client.MC import chylex.hee.client.MC
import chylex.hee.client.render.gl.DF_ONE 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.DF_ONE_MINUS_SRC_ALPHA
import chylex.hee.client.render.gl.RenderStateBuilder 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.RenderStateBuilder.Companion.FOG_ENABLED
import chylex.hee.client.render.gl.SF_SRC_ALPHA import chylex.hee.client.render.gl.SF_SRC_ALPHA
import chylex.hee.game.block.BlockAbstractPortal 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.matrix.MatrixStack
import com.mojang.blaze3d.vertex.IVertexBuilder import com.mojang.blaze3d.vertex.IVertexBuilder
import net.minecraft.client.renderer.IRenderTypeBuffer 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.TileEntityRenderer
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher
import net.minecraft.client.renderer.vertex.DefaultVertexFormats import net.minecraft.client.renderer.vertex.DefaultVertexFormats
import net.minecraft.util.math.BlockPos import net.minecraft.util.math.BlockPos
import net.minecraft.util.math.vector.Matrix4f import net.minecraft.util.math.Vec3d
import net.minecraft.util.math.vector.Vector3d
import net.minecraft.world.World import net.minecraft.world.World
import org.lwjgl.opengl.GL11 import org.lwjgl.opengl.GL11
import java.util.Random import java.util.Random
@@ -54,7 +56,7 @@ abstract class RenderTileAbstractPortal<T : TileEntityPortalInner, C : IPortalCo
private val RENDER_TYPE_LAYER = Array(16) { private val RENDER_TYPE_LAYER = Array(16) {
with(RenderStateBuilder()) { with(RenderStateBuilder()) {
tex(TEX_PARTICLE_LAYER) tex(TEX_PARTICLE_LAYER)
fog(FOG_ENABLED) fog(FOG_BLACK)
blend(SF_SRC_ALPHA, DF_ONE) blend(SF_SRC_ALPHA, DF_ONE)
buildType("hee:portal_layer_${it}", DefaultVertexFormats.POSITION_COLOR_TEX, GL11.GL_QUADS, bufferSize = 256) 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() 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 layerIndexRev = 16 - layer
val parallaxMp = (1F + abs(diff.y.toFloat() / 32F)).pow(0.12F) val parallaxMp = (1F + abs(diff.y.toFloat() / 32F)).pow(0.12F)

View File

@@ -1,10 +1,11 @@
package chylex.hee.client.render.block package chylex.hee.client.render.block
import chylex.hee.game.block.entity.TileEntityDarkChest import chylex.hee.game.block.entity.TileEntityDarkChest
import chylex.hee.init.ModAtlases import chylex.hee.init.ModAtlases
import chylex.hee.system.facades.Resource import chylex.hee.system.facades.Resource
import chylex.hee.system.forge.Side import chylex.hee.system.forge.Side
import chylex.hee.system.forge.Sided 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.ChestTileEntityRenderer
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher
import net.minecraft.state.properties.ChestType 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_LEFT = Resource.Custom("entity/dark_chest_left")
val TEX_DOUBLE_RIGHT = Resource.Custom("entity/dark_chest_right") val TEX_DOUBLE_RIGHT = Resource.Custom("entity/dark_chest_right")
private val MAT_SINGLE = RenderMaterial(ModAtlases.ATLAS_TILES, TEX_SINGLE) private val MAT_SINGLE = Material(ModAtlases.ATLAS_TILES, TEX_SINGLE)
private val MAT_DOUBLE_LEFT = RenderMaterial(ModAtlases.ATLAS_TILES, TEX_DOUBLE_LEFT) private val MAT_DOUBLE_LEFT = Material(ModAtlases.ATLAS_TILES, TEX_DOUBLE_LEFT)
private val MAT_DOUBLE_RIGHT = RenderMaterial(ModAtlases.ATLAS_TILES, TEX_DOUBLE_RIGHT) private val MAT_DOUBLE_RIGHT = Material(ModAtlases.ATLAS_TILES, TEX_DOUBLE_RIGHT)
} }
init { init {

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.block package chylex.hee.client.render.block
import chylex.hee.HEE import chylex.hee.HEE
import chylex.hee.game.block.BlockAbstractPortal import chylex.hee.game.block.BlockAbstractPortal
import chylex.hee.game.block.BlockAbstractPortal.IPortalController import chylex.hee.game.block.BlockAbstractPortal.IPortalController
@@ -20,7 +21,7 @@ class RenderTileEndPortal(dispatcher: TileEntityRendererDispatcher) : RenderTile
} }
override fun findController(world: World, pos: BlockPos): IPortalController? { override fun findController(world: World, pos: BlockPos): IPortalController? {
if (world.dimensionKey === HEE.dim){ if (world.dimension.type === HEE.dim) {
return AlwaysOnController return AlwaysOnController
} }

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.block package chylex.hee.client.render.block
import chylex.hee.HEE import chylex.hee.HEE
import chylex.hee.client.render.gl.RenderStateBuilder import chylex.hee.client.render.gl.RenderStateBuilder
import chylex.hee.client.render.gl.RenderStateBuilder.Companion.ALPHA_CUTOUT 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.matrix.MatrixStack
import com.mojang.blaze3d.vertex.IVertexBuilder import com.mojang.blaze3d.vertex.IVertexBuilder
import net.minecraft.client.renderer.IRenderTypeBuffer import net.minecraft.client.renderer.IRenderTypeBuffer
import net.minecraft.client.renderer.Matrix4f
import net.minecraft.client.renderer.WorldRenderer import net.minecraft.client.renderer.WorldRenderer
import net.minecraft.client.renderer.texture.TextureAtlasSprite import net.minecraft.client.renderer.texture.TextureAtlasSprite
import net.minecraft.client.renderer.tileentity.TileEntityRenderer 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.client.renderer.vertex.DefaultVertexFormats
import net.minecraft.inventory.container.PlayerContainer import net.minecraft.inventory.container.PlayerContainer
import net.minecraft.util.math.BlockPos import net.minecraft.util.math.BlockPos
import net.minecraft.util.math.vector.Matrix4f
import net.minecraft.world.World import net.minecraft.world.World
import net.minecraftforge.client.event.TextureStitchEvent import net.minecraftforge.client.event.TextureStitchEvent
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus.MOD import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus.MOD

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.block package chylex.hee.client.render.block
import chylex.hee.client.model.block.ModelBlockIgneousPlate import chylex.hee.client.model.block.ModelBlockIgneousPlate
import chylex.hee.client.render.gl.RenderStateBuilder import chylex.hee.client.render.gl.RenderStateBuilder
import chylex.hee.client.render.gl.RenderStateBuilder.Companion.BLEND_NONE 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.TileEntityRenderer
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher
import net.minecraft.client.renderer.vertex.DefaultVertexFormats 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 import org.lwjgl.opengl.GL11
@Sided(Side.CLIENT) @Sided(Side.CLIENT)
@@ -53,7 +54,7 @@ class RenderTileIgneousPlate(dispatcher: TileEntityRendererDispatcher) : TileEnt
RGB(235, 23, 23).asVec 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 index = combinedHeat.floorToInt().coerceIn(0, COLOR_TRANSITIONS.lastIndex - 1)
val progress = combinedHeat.toDouble() - index val progress = combinedHeat.toDouble() - index

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.block package chylex.hee.client.render.block
import chylex.hee.HEE import chylex.hee.HEE
import chylex.hee.client.MC import chylex.hee.client.MC
import chylex.hee.client.render.gl.RenderStateBuilder 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.Atlases
import net.minecraft.client.renderer.IRenderTypeBuffer import net.minecraft.client.renderer.IRenderTypeBuffer
import net.minecraft.client.renderer.model.IBakedModel 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.texture.TextureAtlasSprite
import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer
import net.minecraft.client.renderer.tileentity.TileEntityRenderer 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.client.model.data.EmptyModelData
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus.MOD import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus.MOD
import org.lwjgl.opengl.GL11 import org.lwjgl.opengl.GL11
import kotlin.math.sqrt
@Sided(Side.CLIENT) @Sided(Side.CLIENT)
class RenderTileJarODust(dispatcher: TileEntityRendererDispatcher) : TileEntityRenderer<TileEntityJarODust>(dispatcher) { class RenderTileJarODust(dispatcher: TileEntityRendererDispatcher) : TileEntityRenderer<TileEntityJarODust>(dispatcher) {
@@ -54,8 +55,10 @@ class RenderTileJarODust(dispatcher: TileEntityRendererDispatcher) : TileEntityR
private val AABB = BlockJarODust.AABB 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 EPSILON_XZ = 0.005
private const val FIRST_LAYER_HEIGHT = 0.0325
@SubscribeEvent @SubscribeEvent
fun onTextureStitchPre(e: TextureStitchEvent.Pre) { 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 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 builder = buffer.getBuffer(RENDER_TYPE_LAYERS)
val mat = matrix.last.matrix val mat = matrix.last.matrix
@@ -96,12 +100,12 @@ class RenderTileJarODust(dispatcher: TileEntityRendererDispatcher) : TileEntityR
val (dustType, dustAmount) = info val (dustType, dustAmount) = info
val color = dustType.color 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 texMin = minU + ((0.01 + relY * TEX_MP) * texHalfSize).toFloat()
val texMax = minU + ((0.01 + (relY + height) * 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 maxY = (minY + height).toFloat()
val sideR = (color[0] / 1.125F).floorToInt().coerceAtLeast(0) 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() 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 bottomR = color[0]
val bottomG = color[1] val bottomG = color[1]
val bottomB = color[2] 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) { 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) @SubscribeAllEvents(Side.CLIENT, modid = HEE.ID, bus = MOD)
@@ -182,12 +186,12 @@ class RenderTileJarODust(dispatcher: TileEntityRendererDispatcher) : TileEntityR
private val layers = DustLayers(TileEntityJarODust.DUST_CAPACITY) 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) val nbt = stack.heeTagOrNull?.getListOfCompounds(TileEntityJarODust.LAYERS_TAG)
if (nbt != null) { if (nbt != null) {
layers.deserializeNBT(nbt) 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) MC.instance.blockRendererDispatcher.blockModelRenderer.renderModel(matrix.last, buffer.getBuffer(Atlases.getTranslucentCullBlockType()), null, MODEL, 1F, 1F, 1F, combinedLight, combinedOverlay, EmptyModelData.INSTANCE)

View File

@@ -1,10 +1,11 @@
package chylex.hee.client.render.block package chylex.hee.client.render.block
import chylex.hee.game.block.entity.TileEntityLootChest import chylex.hee.game.block.entity.TileEntityLootChest
import chylex.hee.init.ModAtlases import chylex.hee.init.ModAtlases
import chylex.hee.system.facades.Resource import chylex.hee.system.facades.Resource
import chylex.hee.system.forge.Side import chylex.hee.system.forge.Side
import chylex.hee.system.forge.Sided 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.ChestTileEntityRenderer
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher
import net.minecraft.state.properties.ChestType import net.minecraft.state.properties.ChestType
@@ -13,14 +14,14 @@ import net.minecraft.state.properties.ChestType
class RenderTileLootChest(dispatcher: TileEntityRendererDispatcher) : ChestTileEntityRenderer<TileEntityLootChest>(dispatcher) { class RenderTileLootChest(dispatcher: TileEntityRendererDispatcher) : ChestTileEntityRenderer<TileEntityLootChest>(dispatcher) {
companion object { companion object {
val TEX = Resource.Custom("entity/loot_chest") val TEX = Resource.Custom("entity/loot_chest")
private val MAT = RenderMaterial(ModAtlases.ATLAS_TILES, TEX) private val MAT = Material(ModAtlases.ATLAS_TILES, TEX)
} }
init { init {
isChristmas = false isChristmas = false
} }
override fun getMaterial(tile: TileEntityLootChest, type: ChestType): RenderMaterial{ override fun getMaterial(tile: TileEntityLootChest, type: ChestType): Material {
return MAT return MAT
} }
} }

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.block package chylex.hee.client.render.block
import chylex.hee.client.MC import chylex.hee.client.MC
import chylex.hee.client.model.ModelHelper import chylex.hee.client.model.ModelHelper
import chylex.hee.client.render.gl.rotateX import chylex.hee.client.render.gl.rotateX

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.block package chylex.hee.client.render.block
import net.minecraft.client.renderer.entity.model.ShulkerModel import net.minecraft.client.renderer.entity.model.ShulkerModel
import net.minecraft.client.renderer.tileentity.ShulkerBoxTileEntityRenderer import net.minecraft.client.renderer.tileentity.ShulkerBoxTileEntityRenderer
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.block package chylex.hee.client.render.block
import chylex.hee.client.MC import chylex.hee.client.MC
import chylex.hee.client.render.gl.rotateX import chylex.hee.client.render.gl.rotateX
import chylex.hee.client.render.gl.rotateY import chylex.hee.client.render.gl.rotateY

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.block package chylex.hee.client.render.block
import chylex.hee.client.MC import chylex.hee.client.MC
import chylex.hee.client.model.ModelHelper import chylex.hee.client.model.ModelHelper
import chylex.hee.client.model.getQuads 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 itemModel = ForgeHooksClient.handleCameraTransforms(matrix, ModelHelper.getItemModel(itemStack), GUI, false)
val mat = matrix.last 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()) { for(quad in itemModel.getQuads()) {
builder.addVertexData(mat, quad, COLOR_SHADE, COLOR_SHADE, COLOR_SHADE, COLOR_ALPHA, LIGHT, OverlayTexture.NO_OVERLAY) builder.addVertexData(mat, quad, COLOR_SHADE, COLOR_SHADE, COLOR_SHADE, COLOR_ALPHA, LIGHT, OverlayTexture.NO_OVERLAY)

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.block package chylex.hee.client.render.block
import chylex.hee.client.MC import chylex.hee.client.MC
import chylex.hee.client.model.ModelHelper import chylex.hee.client.model.ModelHelper
import chylex.hee.client.render.gl.DF_ONE_MINUS_SRC_ALPHA 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 com.mojang.blaze3d.matrix.MatrixStack
import net.minecraft.client.renderer.IRenderTypeBuffer import net.minecraft.client.renderer.IRenderTypeBuffer
import net.minecraft.client.renderer.ItemRenderer 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.IBakedModel
import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType.GROUND import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType.GROUND
import net.minecraft.client.renderer.texture.OverlayTexture 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.client.renderer.vertex.DefaultVertexFormats
import net.minecraft.item.Item import net.minecraft.item.Item
import net.minecraft.item.ItemStack import net.minecraft.item.ItemStack
import net.minecraft.util.math.vector.Matrix4f
import org.lwjgl.opengl.GL11 import org.lwjgl.opengl.GL11
import java.util.Collections import java.util.Collections
import java.util.Random import java.util.Random

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.block package chylex.hee.client.render.block
import chylex.hee.game.block.BlockAbstractPortal import chylex.hee.game.block.BlockAbstractPortal
import chylex.hee.game.block.BlockVoidPortalInner.Companion.TYPE import chylex.hee.game.block.BlockVoidPortalInner.Companion.TYPE
import chylex.hee.game.block.BlockVoidPortalInner.ITerritoryInstanceFactory import chylex.hee.game.block.BlockVoidPortalInner.ITerritoryInstanceFactory

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.entity package chylex.hee.client.render.entity
import chylex.hee.client.model.entity.ModelEntityBossEnderEye import chylex.hee.client.model.entity.ModelEntityBossEnderEye
import chylex.hee.client.model.entity.ModelEntityBossEnderEye.SCALE import chylex.hee.client.model.entity.ModelEntityBossEnderEye.SCALE
import chylex.hee.client.render.entity.layer.LayerEnderEyeLaser import chylex.hee.client.render.entity.layer.LayerEnderEyeLaser

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.entity package chylex.hee.client.render.entity
import chylex.hee.client.MC import chylex.hee.client.MC
import chylex.hee.system.forge.Side import chylex.hee.system.forge.Side
import chylex.hee.system.forge.Sided import chylex.hee.system.forge.Sided

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.entity package chylex.hee.client.render.entity
import chylex.hee.client.MC import chylex.hee.client.MC
import chylex.hee.system.forge.Side import chylex.hee.system.forge.Side
import chylex.hee.system.forge.Sided import chylex.hee.system.forge.Sided

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.entity package chylex.hee.client.render.entity
import chylex.hee.client.render.gl.DF_ONE_MINUS_SRC_ALPHA 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
import chylex.hee.client.render.gl.RenderStateBuilder.Companion.CULL_DISABLED 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 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) return if (isRenderingClone)
RENDER_TYPE_CLONE(getEntityTexture(entity)) RENDER_TYPE_CLONE(getEntityTexture(entity))
else else
super.func_230496_a_(entity, isVisible, isTranslucent, isGlowing) super.func_230042_a_(entity, isVisible, isTranslucent)
} }
} }

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.entity package chylex.hee.client.render.entity
import chylex.hee.game.entity.living.EntityMobAbstractEnderman import chylex.hee.game.entity.living.EntityMobAbstractEnderman
import chylex.hee.system.forge.Side import chylex.hee.system.forge.Side
import chylex.hee.system.forge.Sided import chylex.hee.system.forge.Sided

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.entity package chylex.hee.client.render.entity
import chylex.hee.client.MC import chylex.hee.client.MC
import chylex.hee.client.model.ModelHelper import chylex.hee.client.model.ModelHelper
import chylex.hee.client.model.entity.ModelEntityMobBlobby 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.EntityRendererManager
import net.minecraft.client.renderer.entity.MobRenderer import net.minecraft.client.renderer.entity.MobRenderer
import net.minecraft.client.renderer.model.IBakedModel 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.model.ItemCameraTransforms.TransformType.GROUND
import net.minecraft.client.renderer.texture.OverlayTexture import net.minecraft.client.renderer.texture.OverlayTexture
import net.minecraft.item.ItemStack import net.minecraft.item.ItemStack
@@ -67,7 +67,7 @@ class RenderEntityMobBlobby(manager: EntityRendererManager) : MobRenderer<Entity
super.render(entity, yaw, partialTicks, matrix, buffer, combinedLight) 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 return renderType
} }
@@ -112,8 +112,8 @@ class RenderEntityMobBlobby(manager: EntityRendererManager) : MobRenderer<Entity
else -> null // POLISH implement more special cases else -> null // POLISH implement more special cases
} }
if (overrideType != null){ // UPDATE test transform if (overrideType != null) {
stack.item.itemStackTileEntityRenderer.func_239207_a_(stack, TransformType.NONE, matrix, { buffer.getBuffer(overrideType) }, combinedLight, OverlayTexture.NO_OVERLAY) stack.item.itemStackTileEntityRenderer.render(stack, matrix, { buffer.getBuffer(overrideType) }, combinedLight, OverlayTexture.NO_OVERLAY)
} }
else if (stack !== fallbackStack) { else if (stack !== fallbackStack) {
matrix.pop() matrix.pop()

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.entity package chylex.hee.client.render.entity
import chylex.hee.client.render.entity.layer.LayerSpiderlingEyes import chylex.hee.client.render.entity.layer.LayerSpiderlingEyes
import chylex.hee.client.render.gl.scale import chylex.hee.client.render.gl.scale
import chylex.hee.game.entity.living.EntityMobSpiderling import chylex.hee.game.entity.living.EntityMobSpiderling

View File

@@ -1,5 +1,6 @@
package chylex.hee.client.render.entity 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.game.entity.living.EntityMobUndread
import chylex.hee.system.facades.Resource import chylex.hee.system.facades.Resource
import chylex.hee.system.forge.Side import chylex.hee.system.forge.Side
@@ -12,11 +13,11 @@ import net.minecraft.client.renderer.entity.model.AbstractZombieModel
import net.minecraft.util.ResourceLocation import net.minecraft.util.ResourceLocation
@Sided(Side.CLIENT) @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") private val texture = Resource.Custom("textures/entity/undread.png")
init { 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) { override fun preRenderCallback(entity: EntityMobUndread, matrix: MatrixStack, partialTicks: Float) {

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.entity package chylex.hee.client.render.entity
import chylex.hee.system.facades.Resource import chylex.hee.system.facades.Resource
import chylex.hee.system.forge.Side import chylex.hee.system.forge.Side
import chylex.hee.system.forge.Sided import chylex.hee.system.forge.Sided

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.entity package chylex.hee.client.render.entity
import chylex.hee.client.MC import chylex.hee.client.MC
import chylex.hee.client.render.gl.scale import chylex.hee.client.render.gl.scale
import chylex.hee.game.entity.living.EntityMobVillagerDying import chylex.hee.game.entity.living.EntityMobVillagerDying

View File

@@ -1,7 +1,8 @@
package chylex.hee.client.render.entity package chylex.hee.client.render.entity
import chylex.hee.system.forge.Side import chylex.hee.system.forge.Side
import chylex.hee.system.forge.Sided 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.EntityRenderer
import net.minecraft.client.renderer.entity.EntityRendererManager import net.minecraft.client.renderer.entity.EntityRendererManager
import net.minecraft.entity.Entity import net.minecraft.entity.Entity
@@ -9,6 +10,6 @@ import net.minecraft.util.ResourceLocation
@Sided(Side.CLIENT) @Sided(Side.CLIENT)
class RenderEntityNothing(manager: EntityRendererManager) : EntityRenderer<Entity>(manager) { 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 override fun getEntityTexture(entity: Entity): ResourceLocation? = null
} }

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.entity package chylex.hee.client.render.entity
import chylex.hee.client.MC import chylex.hee.client.MC
import chylex.hee.client.model.ModelHelper import chylex.hee.client.model.ModelHelper
import chylex.hee.client.render.gl.rotateY import chylex.hee.client.render.gl.rotateY

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.entity package chylex.hee.client.render.entity
import chylex.hee.client.MC import chylex.hee.client.MC
import chylex.hee.system.forge.Side import chylex.hee.system.forge.Side
import chylex.hee.system.forge.Sided import chylex.hee.system.forge.Sided

View File

@@ -1,16 +1,17 @@
package chylex.hee.client.render.entity package chylex.hee.client.render.entity
import chylex.hee.game.entity.effect.EntityTerritoryLightningBolt import chylex.hee.game.entity.effect.EntityTerritoryLightningBolt
import chylex.hee.system.forge.Side import chylex.hee.system.forge.Side
import chylex.hee.system.forge.Sided import chylex.hee.system.forge.Sided
import com.mojang.blaze3d.matrix.MatrixStack import com.mojang.blaze3d.matrix.MatrixStack
import com.mojang.blaze3d.vertex.IVertexBuilder import com.mojang.blaze3d.vertex.IVertexBuilder
import net.minecraft.client.renderer.IRenderTypeBuffer import net.minecraft.client.renderer.IRenderTypeBuffer
import net.minecraft.client.renderer.Matrix4f
import net.minecraft.client.renderer.RenderType import net.minecraft.client.renderer.RenderType
import net.minecraft.client.renderer.entity.EntityRenderer import net.minecraft.client.renderer.entity.EntityRenderer
import net.minecraft.client.renderer.entity.EntityRendererManager import net.minecraft.client.renderer.entity.EntityRendererManager
import net.minecraft.inventory.container.PlayerContainer import net.minecraft.inventory.container.PlayerContainer
import net.minecraft.util.ResourceLocation import net.minecraft.util.ResourceLocation
import net.minecraft.util.math.vector.Matrix4f
import java.util.Random import java.util.Random
@Sided(Side.CLIENT) @Sided(Side.CLIENT)

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.entity package chylex.hee.client.render.entity
import chylex.hee.client.model.entity.ModelEntityTokenHolder import chylex.hee.client.model.entity.ModelEntityTokenHolder
import chylex.hee.client.render.gl.rotateX import chylex.hee.client.render.gl.rotateX
import chylex.hee.client.render.gl.rotateY import chylex.hee.client.render.gl.rotateY

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.entity.layer package chylex.hee.client.render.entity.layer
import chylex.hee.client.model.entity.ModelEntityBossEnderEye import chylex.hee.client.model.entity.ModelEntityBossEnderEye
import chylex.hee.client.render.gl.RenderStateBuilder import chylex.hee.client.render.gl.RenderStateBuilder
import chylex.hee.client.render.gl.RenderStateBuilder.Companion.CULL_DISABLED 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, 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(0F, tex).endVertex()
builder.pos(mat, hw, -hw, -len).color().tex(1F, 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(1F, 0F).endVertex()
builder.pos(mat, -hw, hw, 0F).color().tex(0F, 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(0F, tex).endVertex()
builder.pos(mat, -hw, -hw, -len).color().tex(1F, 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(1F, 0F).endVertex()
builder.pos(mat, hw, -hw, 0F).color().tex(0F, 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(0F, tex).endVertex()
builder.pos(mat, hw, hw, -len).color().tex(1F, 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(1F, 0F).endVertex()
builder.pos(mat, hw, hw, 0F).color().tex(0F, 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(0F, tex).endVertex()
builder.pos(mat, -hw, hw, -len).color().tex(1F, 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(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() builder.pos(mat, +hw, -hw, -len).color().tex(0F, 0F).endVertex()
matrix.pop() matrix.pop()
} }

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.entity.layer package chylex.hee.client.render.entity.layer
import chylex.hee.client.render.entity.RenderEntityMobSpiderling import chylex.hee.client.render.entity.RenderEntityMobSpiderling
import chylex.hee.client.render.gl.scale import chylex.hee.client.render.gl.scale
import chylex.hee.game.entity.living.EntityMobSpiderling import chylex.hee.game.entity.living.EntityMobSpiderling

View File

@@ -1,9 +1,9 @@
package chylex.hee.client.render.item package chylex.hee.client.render.item
import chylex.hee.system.forge.Side import chylex.hee.system.forge.Side
import chylex.hee.system.forge.Sided import chylex.hee.system.forge.Sided
import com.mojang.blaze3d.matrix.MatrixStack import com.mojang.blaze3d.matrix.MatrixStack
import net.minecraft.client.renderer.IRenderTypeBuffer 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.ItemStackTileEntityRenderer
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher
import net.minecraft.item.ItemStack import net.minecraft.item.ItemStack
@@ -11,7 +11,7 @@ import net.minecraft.tileentity.TileEntity
@Sided(Side.CLIENT) @Sided(Side.CLIENT)
class RenderItemTileEntitySimple<T : TileEntity>(val tile: T) : ItemStackTileEntityRenderer() { 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) TileEntityRendererDispatcher.instance.renderItem(tile, matrix, buffer, combinedLight, combinedOverlay)
} }
} }

View File

@@ -1,10 +1,12 @@
package chylex.hee.client.render.territory package chylex.hee.client.render.territory
import chylex.hee.client.MC import chylex.hee.client.MC
import chylex.hee.client.render.TerritoryRenderer import chylex.hee.client.render.TerritoryRenderer
import chylex.hee.client.render.gl.GL import chylex.hee.client.render.gl.GL
import chylex.hee.system.facades.Resource import chylex.hee.system.facades.Resource
import chylex.hee.system.forge.Side import chylex.hee.system.forge.Side
import chylex.hee.system.forge.Sided import chylex.hee.system.forge.Sided
import chylex.hee.system.math.Vec3
import chylex.hee.system.math.remapRange import chylex.hee.system.math.remapRange
import com.mojang.blaze3d.matrix.MatrixStack import com.mojang.blaze3d.matrix.MatrixStack
import net.minecraft.client.Minecraft 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.Tessellator
import net.minecraft.client.renderer.vertex.DefaultVertexFormats import net.minecraft.client.renderer.vertex.DefaultVertexFormats
import net.minecraft.client.world.ClientWorld import net.minecraft.client.world.ClientWorld
import net.minecraft.util.math.vector.Vector3d
import net.minecraftforge.client.SkyRenderHandler import net.minecraftforge.client.SkyRenderHandler
import org.lwjgl.opengl.GL11.GL_QUADS import org.lwjgl.opengl.GL11.GL_QUADS
import kotlin.math.pow 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) } 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_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 const val DEFAULT_ALPHA = 1F
fun renderPlane(matrix: MatrixStack, y: Float, size: Float, rescale: Float) { fun renderPlane(matrix: MatrixStack, y: Float, size: Float, rescale: Float) {

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.territory package chylex.hee.client.render.territory
import chylex.hee.system.forge.Side import chylex.hee.system.forge.Side
import chylex.hee.system.forge.Sided import chylex.hee.system.forge.Sided
import com.mojang.blaze3d.matrix.MatrixStack import com.mojang.blaze3d.matrix.MatrixStack

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.territory.components package chylex.hee.client.render.territory.components
import chylex.hee.client.MC import chylex.hee.client.MC
import chylex.hee.client.render.gl.DF_ONE_MINUS_SRC_ALPHA 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.DF_ZERO
@@ -44,10 +45,10 @@ abstract class SkyCubeBase : AbstractEnvironmentRenderer(){
matrix.push() matrix.push()
when(side) { when(side) {
1 -> matrix.rotateX( 90F) 1 -> matrix.rotateX(+90F)
2 -> matrix.rotateX(-90F) 2 -> matrix.rotateX(-90F)
3 -> matrix.rotateX(180F) 3 -> matrix.rotateX(180F)
4 -> matrix.rotateZ( 90F) 4 -> matrix.rotateZ(+90F)
5 -> matrix.rotateZ(-90F) 5 -> matrix.rotateZ(-90F)
} }

View File

@@ -1,11 +1,12 @@
package chylex.hee.client.render.territory.components package chylex.hee.client.render.territory.components
import net.minecraft.util.ResourceLocation import net.minecraft.util.ResourceLocation
import net.minecraft.util.math.vector.Vector3d import net.minecraft.util.math.Vec3d
class SkyCubeStatic( class SkyCubeStatic(
override val texture: ResourceLocation = DEFAULT_TEXTURE, 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 alpha: Float = DEFAULT_ALPHA,
override val rescale: Float = DEFAULT_RESCALE, override val rescale: Float = DEFAULT_RESCALE,
override val distance: Float = DEFAULT_DISTANCE override val distance: Float = DEFAULT_DISTANCE,
) : SkyCubeBase() ) : SkyCubeBase()

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.territory.components package chylex.hee.client.render.territory.components
import chylex.hee.client.render.gl.DF_ONE_MINUS_SRC_ALPHA import chylex.hee.client.render.gl.DF_ONE_MINUS_SRC_ALPHA
import chylex.hee.client.render.gl.GL import chylex.hee.client.render.gl.GL
import chylex.hee.client.render.gl.SF_SRC_ALPHA import chylex.hee.client.render.gl.SF_SRC_ALPHA

View File

@@ -1,15 +1,16 @@
package chylex.hee.client.render.territory.components package chylex.hee.client.render.territory.components
import net.minecraft.util.ResourceLocation import net.minecraft.util.ResourceLocation
import net.minecraft.util.math.vector.Vector3d import net.minecraft.util.math.Vec3d
class SkyDomeStatic( class SkyDomeStatic(
override val texture: ResourceLocation = DEFAULT_TEXTURE, override val texture: ResourceLocation = DEFAULT_TEXTURE,
override val color1: Vector3d = DEFAULT_COLOR, override val color1: Vec3d = DEFAULT_COLOR,
override val color2: Vector3d = DEFAULT_COLOR, override val color2: Vec3d = DEFAULT_COLOR,
override val alpha1: Float = DEFAULT_ALPHA, override val alpha1: Float = DEFAULT_ALPHA,
override val alpha2: Float = DEFAULT_ALPHA override val alpha2: Float = DEFAULT_ALPHA,
) : SkyDomeBase() { ) : 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, color: Vec3d = 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, color1: Vec3d, color2: Vec3d, 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, alpha1: Float, alpha2: Float) : this(texture, color, color, alpha1, alpha2)
} }

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.territory.components package chylex.hee.client.render.territory.components
import chylex.hee.client.MC import chylex.hee.client.MC
import chylex.hee.client.render.gl.DF_ONE_MINUS_SRC_ALPHA 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.DF_ZERO
@@ -11,16 +12,16 @@ import chylex.hee.system.forge.Sided
import com.mojang.blaze3d.matrix.MatrixStack import com.mojang.blaze3d.matrix.MatrixStack
import net.minecraft.client.world.ClientWorld import net.minecraft.client.world.ClientWorld
import net.minecraft.util.ResourceLocation 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 import org.lwjgl.opengl.GL11.GL_GREATER
class SkyPlaneTopFoggy( class SkyPlaneTopFoggy(
override val texture: ResourceLocation = DEFAULT_TEXTURE, 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 alpha: Float = DEFAULT_ALPHA,
override val rescale: Float = DEFAULT_RESCALE, override val rescale: Float = DEFAULT_RESCALE,
override val distance: Float = DEFAULT_DISTANCE, override val distance: Float = DEFAULT_DISTANCE,
private val width: Float = distance private val width: Float = distance,
) : SkyCubeBase() { ) : SkyCubeBase() {
@Sided(Side.CLIENT) @Sided(Side.CLIENT)
override fun render(world: ClientWorld, matrix: MatrixStack, partialTicks: Float) { 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.blendFunc(SF_SRC_ALPHA, DF_ONE_MINUS_SRC_ALPHA, SF_ONE, DF_ZERO)
GL.enableAlpha() GL.enableAlpha()
GL.alphaFunc(GL_GREATER, 0F) GL.alphaFunc(GL_GREATER, 0F)
GL.enableFog()
GL.color(color, alpha * currentSkyAlpha) GL.color(color, alpha * currentSkyAlpha)
GL.bindTexture(texture) GL.bindTexture(texture)

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.render.territory.components package chylex.hee.client.render.territory.components
import chylex.hee.client.render.gl.DF_ONE import chylex.hee.client.render.gl.DF_ONE
import chylex.hee.client.render.gl.DF_ZERO import chylex.hee.client.render.gl.DF_ZERO
import chylex.hee.client.render.gl.GL import chylex.hee.client.render.gl.GL

View File

@@ -1,11 +1,12 @@
package chylex.hee.client.render.territory.components package chylex.hee.client.render.territory.components
import net.minecraft.util.ResourceLocation import net.minecraft.util.ResourceLocation
import net.minecraft.util.math.vector.Vector3d import net.minecraft.util.math.Vec3d
class SunStatic( class SunStatic(
override val texture: ResourceLocation, override val texture: ResourceLocation,
override val color: Vector3d = DEFAULT_COLOR, override val color: Vec3d = DEFAULT_COLOR,
override val alpha: Float = DEFAULT_ALPHA, override val alpha: Float = DEFAULT_ALPHA,
override val size: Float, override val size: Float,
override val distance: Float = DEFAULT_DISTANCE override val distance: Float = DEFAULT_DISTANCE,
) : SunBase() ) : SunBase()

View File

@@ -1,4 +1,5 @@
package chylex.hee.client.sound package chylex.hee.client.sound
import chylex.hee.game.entity.projectile.EntityProjectileSpatialDash import chylex.hee.game.entity.projectile.EntityProjectileSpatialDash
import chylex.hee.system.migration.Sounds import chylex.hee.system.migration.Sounds
import chylex.hee.system.random.nextFloat import chylex.hee.system.random.nextFloat
@@ -15,12 +16,12 @@ class MovingSoundSpatialDash(private val entity: EntityProjectileSpatialDash) :
override fun tick() { override fun tick() {
if (!entity.isAlive) { if (!entity.isAlive) {
finishPlaying() donePlaying = true
return return
} }
x = entity.posX x = entity.posX.toFloat()
y = entity.posY y = entity.posY.toFloat()
z = entity.posZ z = entity.posZ.toFloat()
} }
} }

View File

@@ -1,4 +1,5 @@
package chylex.hee.commands package chylex.hee.commands
import chylex.hee.HEE import chylex.hee.HEE
import chylex.hee.client.MC import chylex.hee.client.MC
import chylex.hee.commands.client.CommandClientHelp import chylex.hee.commands.client.CommandClientHelp

View File

@@ -1,4 +1,5 @@
package chylex.hee.commands.client package chylex.hee.commands.client
import chylex.hee.commands.ClientCommandHandler import chylex.hee.commands.ClientCommandHandler
import chylex.hee.commands.IClientCommand import chylex.hee.commands.IClientCommand
import chylex.hee.commands.server.CommandServerHelp import chylex.hee.commands.server.CommandServerHelp

View File

@@ -1,4 +1,5 @@
package chylex.hee.commands.client package chylex.hee.commands.client
import chylex.hee.commands.IClientCommand import chylex.hee.commands.IClientCommand
import chylex.hee.commands.server.CommandDebugStructure import chylex.hee.commands.server.CommandDebugStructure
import net.minecraft.command.CommandSource import net.minecraft.command.CommandSource

View File

@@ -1,4 +1,5 @@
package chylex.hee.commands.client package chylex.hee.commands.client
import chylex.hee.commands.IClientCommand import chylex.hee.commands.IClientCommand
import chylex.hee.game.world.WorldProviderEndCustom import chylex.hee.game.world.WorldProviderEndCustom
import chylex.hee.init.ModBlocks import chylex.hee.init.ModBlocks

View File

@@ -1,4 +1,5 @@
package chylex.hee.commands.server package chylex.hee.commands.server
import chylex.hee.commands.ICommand import chylex.hee.commands.ICommand
import chylex.hee.commands.executes import chylex.hee.commands.executes
import chylex.hee.commands.getInt import chylex.hee.commands.getInt

View File

@@ -1,4 +1,5 @@
package chylex.hee.commands.server package chylex.hee.commands.server
import chylex.hee.commands.ICommand import chylex.hee.commands.ICommand
import chylex.hee.commands.arguments.ValidatedStringArgument.Companion.validatedString import chylex.hee.commands.arguments.ValidatedStringArgument.Companion.validatedString
import chylex.hee.commands.executes import chylex.hee.commands.executes

View File

@@ -1,4 +1,5 @@
package chylex.hee.commands.server package chylex.hee.commands.server
import chylex.hee.HEE import chylex.hee.HEE
import chylex.hee.commands.ICommand import chylex.hee.commands.ICommand
import chylex.hee.commands.executes import chylex.hee.commands.executes
@@ -42,7 +43,7 @@ object CommandDebugTerritory : ICommand{
val instance = TerritoryInstance.fromPos(pos) val instance = TerritoryInstance.fromPos(pos)
val seed = if (hasSeedArg) ctx.getLong("seed") else null 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) sendFeedback(StringTextComponent("Invalid dimension."), false)
return 0 return 0
} }

View File

@@ -1,4 +1,5 @@
package chylex.hee.commands.server package chylex.hee.commands.server
import chylex.hee.commands.CommandExecutionFunction import chylex.hee.commands.CommandExecutionFunction
import chylex.hee.commands.ICommand import chylex.hee.commands.ICommand
import chylex.hee.commands.returning import chylex.hee.commands.returning

View File

@@ -1,4 +1,5 @@
package chylex.hee.commands.server package chylex.hee.commands.server
import chylex.hee.commands.ICommand import chylex.hee.commands.ICommand
import chylex.hee.commands.arguments.EnumArgument.Companion.enum import chylex.hee.commands.arguments.EnumArgument.Companion.enum
import chylex.hee.commands.executes import chylex.hee.commands.executes

View File

@@ -1,4 +1,5 @@
package chylex.hee.commands.server package chylex.hee.commands.server
import chylex.hee.commands.CommandExecutionFunctionCtx import chylex.hee.commands.CommandExecutionFunctionCtx
import chylex.hee.commands.ICommand import chylex.hee.commands.ICommand
import chylex.hee.commands.executes import chylex.hee.commands.executes
@@ -13,7 +14,6 @@ import com.mojang.brigadier.context.CommandContext
import net.minecraft.command.CommandException import net.minecraft.command.CommandException
import net.minecraft.command.CommandSource import net.minecraft.command.CommandSource
import net.minecraft.command.Commands.argument import net.minecraft.command.Commands.argument
import net.minecraft.util.text.IFormattableTextComponent
import net.minecraft.util.text.ITextComponent import net.minecraft.util.text.ITextComponent
import net.minecraft.util.text.StringTextComponent import net.minecraft.util.text.StringTextComponent
import net.minecraft.util.text.TextFormatting.DARK_GREEN import net.minecraft.util.text.TextFormatting.DARK_GREEN
@@ -86,7 +86,7 @@ object CommandServerHelp : ICommand, CommandExecutionFunctionCtx<Boolean>{
send(source, emptyLine) send(source, emptyLine)
send(source, TranslationTextComponent(headerKey, currentPage, totalPages).also { 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) send(source, emptyLine)
@@ -101,7 +101,7 @@ object CommandServerHelp : ICommand, CommandExecutionFunctionCtx<Boolean>{
send(source, chainTextComponents( send(source, chainTextComponents(
StringTextComponent(" "), StringTextComponent(" "),
TranslationTextComponent("commands.hee.${name}.info").also { 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?) { private fun sendInteractiveNavigation(source: CommandSource, currentPage: Int, totalPages: Int?) {
val components = mutableListOf<IFormattableTextComponent>() val components = mutableListOf<ITextComponent>()
if (totalPages == null) { if (totalPages == null) {
components.add(TranslationTextComponent("commands.hee.help.footer.admin").also { components.add(TranslationTextComponent("commands.hee.help.footer.admin").also {
@@ -152,15 +152,15 @@ object CommandServerHelp : ICommand, CommandExecutionFunctionCtx<Boolean>{
if (page != null) { if (page != null) {
style.clickEvent = ClickEvent(RUN_COMMAND, "/${ModCommands.ROOT} help $page") style.clickEvent = ClickEvent(RUN_COMMAND, "/${ModCommands.ROOT} help $page")
style.setFormatting(GREEN) style.color = GREEN
style.setUnderlined(true) style.underlined = true
} }
else { else {
style.setFormatting(DARK_GREEN) style.color = DARK_GREEN
} }
} }
private fun chainTextComponents(vararg components: IFormattableTextComponent): ITextComponent{ private fun chainTextComponents(vararg components: ITextComponent): ITextComponent {
return components.reduce(IFormattableTextComponent::append) return components.reduce(ITextComponent::appendSibling)
} }
} }

View File

@@ -1,4 +1,5 @@
package chylex.hee.commands.server package chylex.hee.commands.server
import chylex.hee.commands.ICommand import chylex.hee.commands.ICommand
import chylex.hee.commands.arguments.EnumArgument.Companion.enum import chylex.hee.commands.arguments.EnumArgument.Companion.enum
import chylex.hee.commands.exception import chylex.hee.commands.exception

View File

@@ -1,4 +1,5 @@
package chylex.hee.commands.server package chylex.hee.commands.server
import chylex.hee.commands.ICommand import chylex.hee.commands.ICommand
import chylex.hee.commands.exception import chylex.hee.commands.exception
import chylex.hee.commands.getPos 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.BlockPosArgument.blockPos
import net.minecraft.command.arguments.ResourceLocationArgument.getResourceLocation import net.minecraft.command.arguments.ResourceLocationArgument.getResourceLocation
import net.minecraft.command.arguments.ResourceLocationArgument.resourceLocation import net.minecraft.command.arguments.ResourceLocationArgument.resourceLocation
import net.minecraft.loot.LootTable import net.minecraft.world.storage.loot.LootTable
object CommandServerLootChest : ICommand { object CommandServerLootChest : ICommand {
override val name = "lootchest" override val name = "lootchest"

View File

@@ -1,4 +1,5 @@
package chylex.hee.commands.server package chylex.hee.commands.server
import chylex.hee.commands.CommandExecutionFunctionCtx import chylex.hee.commands.CommandExecutionFunctionCtx
import chylex.hee.commands.ICommand import chylex.hee.commands.ICommand
import chylex.hee.commands.arguments.EnumArgument.Companion.enum import chylex.hee.commands.arguments.EnumArgument.Companion.enum

View File

@@ -1,4 +1,5 @@
package chylex.hee.game.block package chylex.hee.game.block
import chylex.hee.HEE import chylex.hee.HEE
import chylex.hee.game.block.properties.BlockBuilder import chylex.hee.game.block.properties.BlockBuilder
import chylex.hee.game.inventory.isNotEmpty import chylex.hee.game.inventory.isNotEmpty

View File

@@ -1,4 +1,5 @@
package chylex.hee.game.block package chylex.hee.game.block
import chylex.hee.game.block.entity.base.TileEntityBaseChest import chylex.hee.game.block.entity.base.TileEntityBaseChest
import chylex.hee.game.block.properties.BlockBuilder import chylex.hee.game.block.properties.BlockBuilder
import chylex.hee.game.entity.living.ai.AIOcelotSitOverride.IOcelotCanSitOn import chylex.hee.game.entity.living.ai.AIOcelotSitOverride.IOcelotCanSitOn

View File

@@ -1,4 +1,5 @@
package chylex.hee.game.block package chylex.hee.game.block
import chylex.hee.game.block.fluid.FlowingFluid5 import chylex.hee.game.block.fluid.FlowingFluid5
import chylex.hee.game.block.fluid.FluidBase import chylex.hee.game.block.fluid.FluidBase
import chylex.hee.game.block.logic.BlockCollisionLimiter import chylex.hee.game.block.logic.BlockCollisionLimiter
@@ -16,15 +17,17 @@ import chylex.hee.system.serialization.getLongOrNull
import chylex.hee.system.serialization.getOrCreateCompound import chylex.hee.system.serialization.getOrCreateCompound
import net.minecraft.block.BlockState import net.minecraft.block.BlockState
import net.minecraft.block.material.Material import net.minecraft.block.material.Material
import net.minecraft.block.material.MaterialColor
import net.minecraft.entity.Entity import net.minecraft.entity.Entity
import net.minecraft.util.math.BlockPos 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.IWorldReader
import net.minecraft.world.World import net.minecraft.world.World
abstract class BlockAbstractGoo( abstract class BlockAbstractGoo(
private val fluid: FluidBase, private val fluid: FluidBase,
material: Material material: Material,
) : BlockFlowingFluid(supply(fluid.still), Properties.create(material, fluid.mapColor).hardnessAndResistance(fluid.resistance).doesNotBlockMovement().noDrops()) { ) : BlockFlowingFluid(supply(fluid.still), Properties.create(material, fluid.mapColor).hardnessAndResistance(fluid.resistance).doesNotBlockMovement().noDrops()) {
protected companion object { protected companion object {
private const val LAST_TIME_TAG = "Time" private const val LAST_TIME_TAG = "Time"
@@ -96,8 +99,12 @@ abstract class BlockAbstractGoo(
abstract fun onInsideGoo(entity: Entity) abstract fun onInsideGoo(entity: Entity)
abstract fun modifyMotion(entity: Entity, level: Int) abstract fun modifyMotion(entity: Entity, level: Int)
override fun getMaterialColor(state: BlockState, world: IBlockReader, pos: BlockPos): MaterialColor {
return fluid.mapColor
}
@Sided(Side.CLIENT) @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 return fluid.fogColor
} }
} }

View File

@@ -1,4 +1,5 @@
package chylex.hee.game.block package chylex.hee.game.block
import chylex.hee.game.block.properties.BlockBuilder import chylex.hee.game.block.properties.BlockBuilder
import chylex.hee.game.world.allInBox import chylex.hee.game.world.allInBox
import chylex.hee.game.world.allInBoxMutable import chylex.hee.game.world.allInBoxMutable

View File

@@ -1,4 +1,5 @@
package chylex.hee.game.block package chylex.hee.game.block
import chylex.hee.client.render.block.IBlockLayerCutout import chylex.hee.client.render.block.IBlockLayerCutout
import chylex.hee.game.block.properties.BlockBuilder import chylex.hee.game.block.properties.BlockBuilder
import chylex.hee.system.forge.Side import chylex.hee.system.forge.Side

View File

@@ -1,4 +1,5 @@
package chylex.hee.game.block package chylex.hee.game.block
import chylex.hee.game.block.entity.base.TileEntityBaseTable import chylex.hee.game.block.entity.base.TileEntityBaseTable
import chylex.hee.game.block.properties.BlockBuilder import chylex.hee.game.block.properties.BlockBuilder
import chylex.hee.game.world.getTile import chylex.hee.game.world.getTile

View File

@@ -1,8 +1,10 @@
package chylex.hee.game.block package chylex.hee.game.block
import chylex.hee.client.render.block.IBlockLayerCutout import chylex.hee.client.render.block.IBlockLayerCutout
import chylex.hee.game.block.properties.BlockBuilder import chylex.hee.game.block.properties.BlockBuilder
import chylex.hee.game.world.breakBlock import chylex.hee.game.world.breakBlock
import chylex.hee.system.forge.SubscribeEvent import chylex.hee.system.forge.SubscribeEvent
import chylex.hee.system.math.Vec3
import chylex.hee.system.migration.BlockWeb import chylex.hee.system.migration.BlockWeb
import chylex.hee.system.migration.EntityItem import chylex.hee.system.migration.EntityItem
import chylex.hee.system.migration.EntityLivingBase import chylex.hee.system.migration.EntityLivingBase
@@ -14,7 +16,6 @@ import chylex.hee.system.migration.ItemSword
import net.minecraft.block.BlockState import net.minecraft.block.BlockState
import net.minecraft.entity.Entity import net.minecraft.entity.Entity
import net.minecraft.util.math.BlockPos 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.ISelectionContext
import net.minecraft.util.math.shapes.VoxelShape import net.minecraft.util.math.shapes.VoxelShape
import net.minecraft.util.math.shapes.VoxelShapes 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) { override fun onEntityCollision(state: BlockState, world: World, pos: BlockPos, entity: Entity) {
if (entity is EntityItem) { 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) { else if (!world.isRemote) {
val canBreak = when(entity) { val canBreak = when(entity) {

View File

@@ -1,4 +1,5 @@
package chylex.hee.game.block package chylex.hee.game.block
import chylex.hee.client.render.block.IBlockLayerCutout import chylex.hee.client.render.block.IBlockLayerCutout
import chylex.hee.game.block.entity.TileEntityBrewingStandCustom import chylex.hee.game.block.entity.TileEntityBrewingStandCustom
import chylex.hee.game.block.properties.BlockBuilder import chylex.hee.game.block.properties.BlockBuilder

View File

@@ -1,4 +1,5 @@
package chylex.hee.game.block package chylex.hee.game.block
import chylex.hee.game.block.properties.BlockBuilder import chylex.hee.game.block.properties.BlockBuilder
import net.minecraft.item.ItemStack import net.minecraft.item.ItemStack
import net.minecraft.item.Items import net.minecraft.item.Items

View File

@@ -1,4 +1,5 @@
package chylex.hee.game.block package chylex.hee.game.block
import chylex.hee.game.block.properties.BlockBuilder import chylex.hee.game.block.properties.BlockBuilder
import chylex.hee.game.potion.brewing.PotionItems import chylex.hee.game.potion.brewing.PotionItems
import chylex.hee.system.migration.PotionTypes import chylex.hee.system.migration.PotionTypes

Some files were not shown because too many files have changed in this diff Show More