Compare commits
29
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34f98ad930 | ||
|
|
a0e3d1751f | ||
|
|
726fef01f6 | ||
|
|
f523d73954 | ||
|
|
51a1e0d83d | ||
|
|
12042a98d8 | ||
|
|
69fc32e3f6 | ||
|
|
b8e763aa68 | ||
|
|
0af6cc0b7f | ||
|
|
cac303797f | ||
|
|
8e0a57d42f | ||
|
|
1ea78a02f8 | ||
|
|
b82c3fe947 | ||
|
|
aa090008cf | ||
|
|
cded7cd3ee | ||
|
|
737e8d3b28 | ||
|
|
1b2b9767c9 | ||
|
|
005c58798e | ||
|
|
317a706d97 | ||
|
|
f511c38f15 | ||
|
|
db2028bf13 | ||
|
|
cb11c89b5e | ||
|
|
6d30f8065b | ||
|
|
7b7a014a15 | ||
|
|
0fe2dded65 | ||
|
|
fbc9f7e66f | ||
|
|
cfff95a728 | ||
|
|
b168a9c636 | ||
|
|
c49b5f03fb |
No files matched your search
+14
-10
@@ -2,7 +2,7 @@ name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
module-ref:
|
||||
@@ -18,9 +18,12 @@ on:
|
||||
required: false
|
||||
default: 'false'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
cancel-in-progress: ${{ github.ref_name != github.event.repository.default_branch }}
|
||||
|
||||
# Organisation-wide Stratum settings (registry, group, runner routes) are organisation variables.
|
||||
env:
|
||||
@@ -31,24 +34,25 @@ env:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
if: github.event_name != 'push' || github.ref_name == github.event.repository.default_branch
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 90
|
||||
steps:
|
||||
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
||||
with:
|
||||
ref: ${{ inputs.module-ref || github.sha }}
|
||||
fetch-depth: 0 # the package version is derived from git history
|
||||
filter: blob:none
|
||||
|
||||
- uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6
|
||||
- uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad
|
||||
with:
|
||||
distribution: zulu
|
||||
java-version: '25'
|
||||
cache-jdk: true
|
||||
|
||||
- uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb
|
||||
- uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c
|
||||
with:
|
||||
cache-provider: basic
|
||||
cache-provider: "${{ github.server_url == 'https://github.com' && 'basic' || 'external' }}"
|
||||
|
||||
- name: Build
|
||||
env:
|
||||
@@ -68,21 +72,21 @@ jobs:
|
||||
MAVEN_USER: ${{ secrets.MAVEN_USER }}
|
||||
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
|
||||
steps:
|
||||
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
||||
with:
|
||||
ref: ${{ inputs.module-ref || github.sha }}
|
||||
fetch-depth: 0 # the package version is derived from git history
|
||||
filter: blob:none
|
||||
|
||||
- uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6
|
||||
- uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad
|
||||
with:
|
||||
distribution: zulu
|
||||
java-version: '25'
|
||||
cache-jdk: true
|
||||
|
||||
- uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb
|
||||
- uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c
|
||||
with:
|
||||
cache-provider: basic
|
||||
cache-provider: "${{ github.server_url == 'https://github.com' && 'basic' || 'external' }}"
|
||||
|
||||
- name: Check the publish credentials
|
||||
run: |
|
||||
|
||||
+19
@@ -2,3 +2,22 @@ build/
|
||||
run/
|
||||
|
||||
.gradle/
|
||||
decompile.log
|
||||
# ==== TDLM standard ignore template ====
|
||||
# Dev runtime
|
||||
logs/
|
||||
*.log
|
||||
# Build outputs
|
||||
out/
|
||||
# Gradle
|
||||
# IDE
|
||||
.idea/
|
||||
*.iml
|
||||
.vscode/
|
||||
.classpath
|
||||
.project
|
||||
.settings/
|
||||
eclipse/
|
||||
# OS
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
@@ -1 +0,0 @@
|
||||
ok=307 bad=0 (Fernflower, 逐类反编译)
|
||||
@@ -4,6 +4,7 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
// Thaumcraft 4 full dev jar (api + common impl; the sources import thaumcraft.common.* and thaumcraft.client.*)
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
api("uk.potatolab:Thaumcraft4:4.2.3.5-20261028.155248-g1a600e9")
|
||||
// cofh.api.energy.IEnergyReceiver is used by TileThaumicGenerator (the CoFH API lives in CoFHLib, not CoFHCore)
|
||||
compileOnly("uk.potatolab:CoFHLib-1.7.10-Legacy:1.7.10R3.0.3-20261028.145717-gbf0ac89")
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
# F-005
|
||||
- **状态**:观察·待处理
|
||||
- **状态**:观察·已修复(TDLM/thaumicadditions#11,2026-10-31:TESR 模型与贴图改为字段/静态常量,不再每帧新建模型(顺带消除每帧新编译显示列表))
|
||||
- **范式**:F1
|
||||
- **位置**:`src/main/java/com/pengu/thaumcraft/additions/renderer/RendererDarkGen.java:16`、`:22`;同型 `RendererHyperNodeCreator.java:17`、`:23`、`RendererInfuser.java:19`、`:24`、`RendererInfuserActivator.java:19`、`:37`、`RendererSymboller.java:17`、`:23`、`RendererThaumicGenerator.java:17`、`:23`、`RendererThaumicRestorer.java:16`、`:22`、`RendererSeal.java:41-48`、`RendererTankBasic.java:20`、`:32`
|
||||
- **位置**:`src/main/java/com/pengu/thaumcraft/additions/renderer/RendererDarkGen.java:16`、`:22`;同型 `RendererHyperNodeCreator.java:17`、`:23`、`RendererInfuser.java:19`、`:24`、`RendererInfuserActivator.java:19`、`:37`、`RendererSymboller.java:17`、`:23`、`RendererThaumicGenerator.java:17`、`:23`、`RendererThaumicRestorer.java:16`、`:22`、`RendererSeal.java:41-48`、`RendererTankBasic.java:20`、`:32`、`TileRendererCreativeNode.java:22`、`:23`、`:34`(后者每帧 `new Random`/`Calendar.getInstance()`/RL 字符串拼接)
|
||||
- **证据**:
|
||||
```java
|
||||
ResourceLocation textures = new ResourceLocation("thaumicadditions", "textures/models/DarkGen.png");
|
||||
@@ -16,4 +16,4 @@
|
||||
- **修法**:提 `private static final ResourceLocation`;Model 提实例字段复用(需确认无跨 TE 可变状态串扰,故本档观察)。
|
||||
- **风险 · 置信度**:RL 提常量无;Model 复用需隔离论证 · 高(形态)
|
||||
- **移交**:无
|
||||
- **来源**:P1 2026-10-26 2f7b9c9;同族 F-006/F-016
|
||||
- **来源**:P1 2026-10-26 2f7b9c9;P2 2026-10-29 c49b5f0 同型补记 `TileRendererCreativeNode.java:22`、`:23`、`:34`(计数不变);同族 F-006/F-016
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# F-006
|
||||
- **状态**:观察·待处理
|
||||
- **状态**:观察·已修复(TDLM/thaumicadditions#11,2026-10-31:Random 复用并 setSeed(序列不变),光环贴图预建,毫秒取 currentTimeMillis%1000)
|
||||
- **范式**:F1
|
||||
- **位置**:`src/main/java/com/pengu/thaumcraft/additions/tileentity/TileRendererCreativeNode.java:22-23`、`:34`
|
||||
- **证据**:
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# F-007
|
||||
- **状态**:观察·待处理
|
||||
- **状态**:观察·已驳回(TDLM/thaumicadditions#11,2026-10-31:每趟内爆炸会生成新奇点并改动实体,且每趟破坏随机方块,提出查询会改变吸取结果)
|
||||
- **范式**:S1
|
||||
- **位置**:`src/main/java/com/pengu/thaumcraft/additions/entity/EntitySingularity.java:70-73`
|
||||
- **证据**:
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# F-008
|
||||
- **状态**:观察·待处理
|
||||
- **状态**:观察·已驳回(TDLM/thaumicadditions#11,2026-10-31:加间隔会改变拾取时机)
|
||||
- **范式**:S1
|
||||
- **位置**:`src/main/java/com/pengu/thaumcraft/additions/event/sealing/SealEventCollectItems.java:25-26`
|
||||
- **证据**:
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# F-009
|
||||
- **状态**:观察·待处理
|
||||
- **状态**:观察·已驳回(TDLM/thaumicadditions#11,2026-10-31:配方缓存需槽位变更失效,反编译 TE 无干净钩子)
|
||||
- **范式**:T1
|
||||
- **位置**:`src/main/java/com/pengu/thaumcraft/additions/tileentity/TileInfuser.java:41-45`;`TileDarkInfuser.java:41-45`
|
||||
- **证据**:
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# F-010
|
||||
- **状态**:观察·待处理
|
||||
- **状态**:观察·已修复(TDLM/thaumicadditions#11,2026-10-31:每向邻居 TE 只取一次)
|
||||
- **范式**:T1
|
||||
- **位置**:`src/main/java/com/pengu/thaumcraft/additions/tileentity/TileTileBooster.java:27`
|
||||
- **证据**:
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# F-011
|
||||
- **状态**:观察·待处理
|
||||
- **状态**:观察·已修复(TDLM/thaumicadditions#11,2026-10-31:每向 TE 取一次;isModLoaded 静态常量;Botania 桥接单例;方向数组静态)
|
||||
- **范式**:T1
|
||||
- **位置**:`src/main/java/com/pengu/thaumcraft/additions/tileentity/TileThaumicGenerator.java:62-87`、`:71`
|
||||
- **证据**:
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# F-012
|
||||
- **状态**:观察·待处理
|
||||
- **状态**:观察·已驳回(TDLM/thaumicadditions#11,2026-10-31:印面组合缓存需印面变更失效,语义难核)
|
||||
- **范式**:T1
|
||||
- **位置**:`src/main/java/com/pengu/thaumcraft/additions/tileentity/TileSeal.java:43`、`:57-62`
|
||||
- **证据**:
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# F-013
|
||||
- **状态**:观察·待处理
|
||||
- **状态**:观察·已修复(TDLM/thaumicadditions#11,2026-10-31:每向邻居 TE 只取一次)
|
||||
- **范式**:T1
|
||||
- **位置**:`src/main/java/com/pengu/thaumcraft/additions/piping/TileVisTube.java:61-75`、`:98`
|
||||
- **证据**:
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# F-014
|
||||
- **状态**:边界·待处理
|
||||
- **状态**:边界·已修复(TDLM/thaumicadditions#11,2026-10-31:长度按包内剩余字节校验,超限解码失败)
|
||||
- **范式**:N1
|
||||
- **位置**:`src/main/java/com/pengu/thaumcraft/additions/playnet/packtetmng/PacketAuraVis.java:38`、`:45`
|
||||
- **证据**:
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# F-015
|
||||
- **状态**:边界·待处理
|
||||
- **状态**:边界·已驳回(TDLM/thaumicadditions#11,2026-10-31:预约爆炸会改变时序分布)
|
||||
- **范式**:T15
|
||||
- **位置**:`src/main/java/com/pengu/thaumcraft/additions/tileentity/TileTankBasic.java:45`
|
||||
- **证据**:
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
# F-016
|
||||
- **状态**:边界·待处理
|
||||
- **状态**:边界·已修复(TDLM/thaumicadditions#11,2026-10-31:十个 GUI 背景贴图 static final)
|
||||
- **范式**:F1
|
||||
- **位置**:`src/main/java/com/pengu/thaumcraft/additions/gui/GUIInfuser.java:24`;同型 `GUICondensator.java:26`、`GUIDarkGenerator.java:26`、`GUIDarkInfuser.java:26`、`GUIHyperNodeCreator.java:25`、`GUISealGlobe.java:38`、`GUIThaumicCrystallizer.java:24`、`GUIThaumicGenerator.java:24`、`GUIThaumicRestorer.java:25`、`GUIVoidChest.java:23`
|
||||
- **证据**:
|
||||
@@ -9,7 +9,7 @@
|
||||
(GUIInfuser.java:24;其余 9 处同句式换路径)
|
||||
- **机制**:十个容器 GUI 背景层每帧 new ResourceLocation;可提 static final。
|
||||
- **频率**:每帧(GUI 打开期间)。
|
||||
- **修法**:记录不修:形态命中量级微(仅开 GUI);维护者可按 TESR 同法提常量。
|
||||
- **修法**:记录不修——量级算式:开窗期每帧 1 个 `ResourceLocation`(对象+两段字符串小写,约 0.2–0.5 µs)⇒ ≤0.003% 帧预算;若要收:提 `private static final ResourceLocation`,逐字节不变。
|
||||
- **风险 · 置信度**:无 · 高
|
||||
- **移交**:无
|
||||
- **来源**:P1 2026-10-26 2f7b9c9;同族 F-005
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# F-017
|
||||
- **状态**:观察·待处理
|
||||
- **状态**:观察·已修复(TDLM/thaumicadditions#11,2026-10-31:删除每包 INFO 日志)
|
||||
- **范式**:D1
|
||||
- **位置**:`src/main/java/com/pengu/thaumcraft/additions/playnet/packtetmng/PacketAuraVis.java:25`
|
||||
- **证据**:
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# F-018
|
||||
- **状态**:边界·已驳回(TDLM/thaumicadditions#11,2026-10-31:GUI 内测宽量级微,且脚本打不开这些 GUI 无法实测)
|
||||
- **范式**:F13
|
||||
- **位置**:`src/main/java/com/pengu/thaumcraft/additions/gui/GUIDarkGenerator.java:35`、`:36`;同型 `GUICondensator.java:39`、`GUIDarkInfuser.java:44`、`GUIHyperNodeCreator.java:31`、`:32`、`GUIInfuser.java:35`、`GUISealGlobe.java:76`、`GUIThaumicCrystallizer.java:34`、`GUIThaumicGenerator.java:32`、`GUIThaumicRestorer.java:33`;`src/main/java/com/pengu/thaumcraft/additions/utils/hud/TipMessage.java:35`(宽度环 `:69-81`,入口同包 `HUD.java:111`)
|
||||
- **证据**:
|
||||
```java
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 3, 4210752);
|
||||
```
|
||||
(GUIDarkGenerator.java:35;`:36` 对 `Lang.localiseRaw("container.inventory")` 取两次翻译再做同式居中)
|
||||
```java
|
||||
float decrease = this.getStringWidth(this.tipText) / 2.0F;
|
||||
```
|
||||
(TipMessage.java:35;`tipText` 为 final 字段 `:9`,宽度环 `:69-81` 逐字符 `loadGlyphTexture` → `renderEngine.bindTexture`)
|
||||
- **机制**:9 个 `drawGuiContainerForegroundLayer` 与 HUD 提示每帧对不变串重测宽度、随即 `drawString` 内部再测一遍,偏移只用于居中。串与字体在开窗/提示存活期内不变(`GUISealGlobe.java:67`/`:70` 同帧重取 TE 与组合描述属另一面,本块不计)。
|
||||
- **频率**:每帧(GUI 开启期)/每帧(提示存活期)。
|
||||
- **修法**:记录不修——量级算式:GUI 侧 10–20 字符测宽约 100–300 ns,`GUIDarkGenerator:35-36` 另加两次 `localiseRaw`,`GUISealGlobe:76` 含每行翻译与测宽合计 ≤3 µs/帧(16.6 ms 的 ≤0.02%);HUD 侧 10–40 字符 × 每次 `bindTexture` 0.2–1 µs ⇒ 2–40 µs/帧(16.6 ms 的 ≤0.25%)且仅提示存活期间。若要收:开窗期把标题串与宽度缓存在 `initGui`/构造器,`TipMessage` 在构造器算好 `decrease`;宽度为定值,偏移逐像素不变。
|
||||
- **风险 · 置信度**:无 · 高(形态)
|
||||
- **移交**:无
|
||||
- **来源**:P2 2026-10-29 c49b5f0
|
||||
+40
-25
@@ -10,21 +10,22 @@
|
||||
| [F-002](F-002.md) | 修·已修复 | `F-002.md` |
|
||||
| [F-003](F-003.md) | 修·已修复 | `F-003.md` |
|
||||
| [F-004](F-004.md) | 修·已修复 | `F-004.md` |
|
||||
| [F-005](F-005.md) | 观察·待处理 | `F-005.md` |
|
||||
| [F-006](F-006.md) | 观察·待处理 | `F-006.md` |
|
||||
| [F-007](F-007.md) | 观察·待处理 | `F-007.md` |
|
||||
| [F-008](F-008.md) | 观察·待处理 | `F-008.md` |
|
||||
| [F-009](F-009.md) | 观察·待处理 | `F-009.md` |
|
||||
| [F-010](F-010.md) | 观察·待处理 | `F-010.md` |
|
||||
| [F-011](F-011.md) | 观察·待处理 | `F-011.md` |
|
||||
| [F-012](F-012.md) | 观察·待处理 | `F-012.md` |
|
||||
| [F-013](F-013.md) | 观察·待处理 | `F-013.md` |
|
||||
| [F-014](F-014.md) | 边界·待处理 | `F-014.md` |
|
||||
| [F-015](F-015.md) | 边界·待处理 | `F-015.md` |
|
||||
| [F-016](F-016.md) | 边界·待处理 | `F-016.md` |
|
||||
| [F-017](F-017.md) | 观察·待处理 | `F-017.md` |
|
||||
| [F-005](F-005.md) | 观察·已修复 | `F-005.md` |
|
||||
| [F-006](F-006.md) | 观察·已修复 | `F-006.md` |
|
||||
| [F-007](F-007.md) | 观察·已驳回 | `F-007.md` |
|
||||
| [F-008](F-008.md) | 观察·已驳回 | `F-008.md` |
|
||||
| [F-009](F-009.md) | 观察·已驳回 | `F-009.md` |
|
||||
| [F-010](F-010.md) | 观察·已修复 | `F-010.md` |
|
||||
| [F-011](F-011.md) | 观察·已修复 | `F-011.md` |
|
||||
| [F-012](F-012.md) | 观察·已驳回 | `F-012.md` |
|
||||
| [F-013](F-013.md) | 观察·已修复 | `F-013.md` |
|
||||
| [F-014](F-014.md) | 边界·已修复 | `F-014.md` |
|
||||
| [F-015](F-015.md) | 边界·已驳回 | `F-015.md` |
|
||||
| [F-016](F-016.md) | 边界·已修复 | `F-016.md` |
|
||||
| [F-017](F-017.md) | 观察·已修复 | `F-017.md` |
|
||||
| [F-018](F-018.md) | 边界·已驳回 | `F-018.md` |
|
||||
|
||||
未关闭项(不含已修复/已延后):**13**(F-005, F-006, F-007, F-008, F-009, F-010, F-011, F-012, F-013, F-014, F-015, F-016, F-017)
|
||||
未关闭项(不含已修复/已延后):**6**(F-007, F-008, F-009, F-012, F-015, F-018)
|
||||
|
||||
## 迁移备注
|
||||
|
||||
@@ -34,25 +35,27 @@
|
||||
|
||||
| 项 | 值 |
|
||||
|---|---|
|
||||
| 仓库 | TDLM/thaumicadditions(建档源:`D:\tmp\missing-mod-archive\repos\thaumicadditions`,无 `.git` 的 zip 反编译树) |
|
||||
| 分支 · HEAD | (源树无 git)· `2f7b9c9696ee6cceb11d93c54592fed30ca218de`(`SCAN_HEAD_SHA.txt`) |
|
||||
| 最近更新 | 2026-10-26(P1 建档) |
|
||||
| 形态 | Forge 1.7.10 TC4 附属内容 mod(反编译重托管,jar `Thaumic Additions - 0.41`);java 307(src/main,无 kt/scala/Mixin);updateEntity 20、canUpdate 覆写 0;TESR 16;@SubscribeEvent 含 PlayerTick/ClientTick/HUD;SimpleNetworkWrapper 通道 `thaumicadditions-playnet`;实体 4;IFMLLoadingPlugin 类在树内但本提取无 META-INF 清单 |
|
||||
| 工具 | 人工形态画像+候选式 grep+命中点全文回读;范式 B1/D1 全仓必扫;周期/渲染/包/空间面按形态选 T1/T4/T15/F1/S1/N1;未跑目标仓构建 |
|
||||
| 仓库 | TDLM/thaumicadditions(git 仓,`src/` 直源) |
|
||||
| 分支 · HEAD | `main` · `c49b5f03fb07907632830659ff83da18ab824c8c`(P2 扫描时 HEAD) |
|
||||
| 最近更新 | 2026-10-29(P2) |
|
||||
| 形态 | Forge 1.7.10 TC4 附属内容 mod(`Thaumic Additions - 0.41`,P2 起按实仓):java 307 / 32,017 行(src/main,无 kt/scala/Mixin);updateEntity 20、TESR 16(`ClientProxy.java:63-78`);`@SubscribeEvent` 含 PlayerTick/ClientTick/HUD;SimpleNetworkWrapper 通道 `thaumicadditions-playnet`;实体 4;构建走 Stratum 组织插件(`.github/workflows/build.yml`) |
|
||||
| 工具 | 人工形态画像+候选式 grep+命中点全文回读;P2 覆 F8–F15 与 J5/J6 |
|
||||
|
||||
**计数矩阵**(处置 × 状态;合计 17)
|
||||
**计数矩阵**(处置 × 状态;合计 18)
|
||||
|
||||
| 处置\状态 | 待处理 | 待裁决 | 已延后 | 已驳回 | 已修复 |
|
||||
|---|---|---|---|---|---|
|
||||
| 修 | 0 | 0 | 0 | 0 | 4 |
|
||||
| 观察 | 10 | 0 | 0 | 0 | 0 |
|
||||
| 边界 | 3 | 0 | 0 | 0 | 0 |
|
||||
| 观察 | 0 | 0 | 0 | 4 | 6 |
|
||||
| 边界 | 0 | 0 | 0 | 2 | 2 |
|
||||
| **合计** | **14** | 0 | 0 | 0 | **4** |
|
||||
|
||||
**扫描轮次**
|
||||
|
||||
| 轮次 | 日期 | SHA | 范围 | 净增(修/观/边) |
|
||||
|---|---|---|---|---|
|
||||
| P1 | 2026-10-26 | 2f7b9c9 | 建档:B1+D1 必扫+TE/TESR/包/封印/奇点热入口 | 4/10/3 |
|
||||
| P2 | 2026-10-29 | c49b5f0 | F8–F15+J5/J6 过堂;F-005 同型补记(计数不变) | 0/0/1 |
|
||||
|
||||
## 四、命中(已记)
|
||||
|
||||
@@ -60,12 +63,13 @@
|
||||
|---|---|---|
|
||||
| B1 | F-001、F-002 | concurrency;maven content |
|
||||
| T4 | F-003、F-004 | 空转 TE |
|
||||
| F1 | F-005、F-006、F-016 | TESR/创造节点/GUI |
|
||||
| F1 | F-005、F-006、F-016 | TESR/创造节点/GUI(P2 同型补记 `TileRendererCreativeNode`) |
|
||||
| S1 | F-007、F-008 | 奇点;收集印 |
|
||||
| T1 | F-009–F-013 | 配方/重复 getTE/封印/管 |
|
||||
| D1 | F-017 | 包路径 INFO |
|
||||
| N1 | F-014 | 安全相邻 |
|
||||
| T15 | F-015 | 储罐抽样 |
|
||||
| F13 | F-018 | GUI 前景与 HUD 提示每帧重测文本宽度(边界) |
|
||||
|
||||
## 五、排除面
|
||||
|
||||
@@ -88,6 +92,13 @@
|
||||
| F4 | E-形态全零 | 同帧同参重复昂贵求值未独立确认(重复 getTE 归 T1) |
|
||||
| F5 | E-形态全零 | TESR 无每帧射线/无节流世界反查主形态 |
|
||||
| F6 | E-产品形态 | 无自研网格面剔除;渲染走 Model/原版通道 |
|
||||
| F8 | E-守卫在位 | 16 个 TESR 于 `ClientProxy.java:63-78` 绑定,全仓 0 处覆写 `getMaxRenderDistanceSquared` ⇒ 走原版默认 4096(64 格)封顶;模型为 1 格级小几何,64 格处 1 格≈12 px(1080p、垂直 FOV 70°:1080/(2·tan35°·64)),再裁即可辨 ⇒ 无可裁点;每帧 `new Model`/RL 归 F-005 |
|
||||
| F9 | E-形态全零 | `glFinish`/`glReadPixels`/`glGetInteger`/`glGetFloat`/`glGetBoolean`/`glGetError`/`glGetUniformLocation*`/`glGetAttribLocation` 全仓 0 命中;无同步点与回读面 |
|
||||
| F10 | E-形态全零 | `glNewList`/`glCallList`/`compileDisplayList`/`glGenLists` 0;23 处 `setRotationAngles` 全在 `ModelBase` 子类 `render()` 内按原版约定调用或仅 `super` 转发(`ModelSeal.java:60`、`:94`),非输入未变仍全价重建 |
|
||||
| F11 | E-设计本体 | 11 处发射全为玩法事件/封印工作态上的固定小数目:封印 reddust 每次 1 枚(`SealEventDestroySoil.java:37`、`SealEventTillSoil.java:37`)、熔炼结果 20 枚一次性(`SealEventItemSmelt.java:68`,栈耗尽即 `setDead`)、修复 1 枚(`SealEventItemRepairer.java:36`)、`randomDisplayTick` ≤10 枚(`BlockReturner.java:54`)、API 单枚(`APIProvide.java:40`、`AbstractParticle.java:34`);无每实例每帧无上限倾倒与拖尾无界追加 |
|
||||
| F12 | E-形态全零 | `glBufferData`/`glBufferSubData`/`glGenBuffers`/`BufferManagement` 0;几何只经 Tessellator 立即模式提交 |
|
||||
| F14 | E-形态全零 | `glUseProgram`/`glUniform*`/`ARBShaderObjects` 0,无自建着色器程序与逐元素 uniform 设定 |
|
||||
| F15 | E-启动期 | 图集申请全在注册沿:`registerBlockIcons`(`BlockDarkGen.java:59` 等)、`registerIcons`(`FocusProjectile.java:34`)、`setTextureName`(`init/MF.java:34` 等);运行期无重复申请 |
|
||||
| S2 | E-设计本体 | 周期 `getBlock`/`getTileEntity` 均为已加载邻域作业读取,非「结果可弃的试读加载」 |
|
||||
| N2 | E-产品形态 | SimpleNetworkWrapper 1.7.10 主线程投递标准形态;无裸 Netty 业务线程改世界 |
|
||||
| N3 | E-形态全零 | 未见无 shutdown 线程池或静态滞留 World/TE 注册表只增 |
|
||||
@@ -101,8 +112,8 @@
|
||||
| J2 | E-形态全零 | 热路径无定幂 `Math.pow`/仅比较用开方等未廉价化算式立案 |
|
||||
| J3 | E-形态全零 | `parkNanos`/`yield`/`onSpinWait` 0 |
|
||||
| J4 | E-形态全零 | 无基本类型数组同构手写循环可换批量原语的热面 |
|
||||
| J5 | E-形态全零 | 粒子/TESR 非「同纹理逐元素 startDrawing…draw 成对未合并」主形态 |
|
||||
| J6 | E-形态全零 | 未见同一拍同源多谓词可融合的独立遍历立案 |
|
||||
| J5 | E-形态全零 | 粒子/TESR 非「同纹理逐元素 startDrawing…draw 成对未合并」主形态;P2 复核全仓 3 处 `startDrawingQuads` 各为单 quad 批(`RendererInfuser.java:69`、`TileRendererCreativeNode.java:48`、`HUD.java:191`) |
|
||||
| J6 | E-形态全零 | 未见同一拍同源多谓词可融合的独立遍历立案;P2 复核封印路径为单趟扫事件表(`TileSeal.java:57-62`,频次已记 F-012) |
|
||||
|
||||
## 六、规则反馈
|
||||
|
||||
@@ -112,9 +123,13 @@
|
||||
| T1 | `Loader.isModLoaded` + `new` 桥接对象出现在 updateEntity 六向环,易被只扫配方表的规则漏掉 | F-011 TileThaumicGenerator.java:71 |
|
||||
| S1 | 「盒有界但循环内重复查询同一盒」应明示计入频率乘子,勿因 radius 字面量有界直接排除 | F-007 EntitySingularity.java:70 |
|
||||
| T4 | 1.7.10 默认 `canUpdate()==true`;无覆写 + 空/继承空 updateEntity 即命中,勿写「默认 false」 | F-003/F-004 |
|
||||
| F8 | 1.7.10 `TileEntity.getMaxRenderDistanceSquared()` 默认 4096(64 格)即原版门;未覆写应记为门在位正例,勿把「没写 if(distance)」当缺门 | `ClientProxy.java:63-78` |
|
||||
| F11 | 拟补判定款:固定小数目(1/≤10/一次性 20)且挂在玩法事件或工作态上的点光源发射,不算「无预算倾倒」;不认这条会把封印类与 `randomDisplayTick` 形态全拖进复核面 | `SealEventDestroySoil.java:37`、`BlockReturner.java:54` |
|
||||
| F13 | 证据强度仍标「来源数 0」;本仓 9 个 GUI 前景+HUD 逐帧 `getStringWidth`(含 HUD 逐字符 `bindTexture`)可回填来源数,并明示「测宽=排版面、`drawString` 内部重测仍算一次」 | `GUIThaumicGenerator.java:32`、`TipMessage.java:35` |
|
||||
|
||||
## 七、修订史
|
||||
|
||||
| 日期 | 轮次 | 变更 |
|
||||
|---|---|---|
|
||||
| 2026-10-26 | P1 | 建档:修 4 / 观 10 / 边 3;源树 HEAD `2f7b9c9696ee6cceb11d93c54592fed30ca218de` |
|
||||
| 2026-10-29 | P2 | F8–F15+J5/J6 过堂(SHA `c49b5f0`):F13 立 F-018(边界,GUI 前景 9 处+`TipMessage` 逐帧测宽);F8/F9/F10/F11/F12/F14/F15 入排除面;F-005 同型补记 `TileRendererCreativeNode`(计数不变);F-016 修法补量级算式(处置/状态不变);概况改按 git 实仓(HEAD `c49b5f0`@`main`),矩阵补合计行 → 边 3→4、合计 17→18、未关闭 13→14 |
|
||||
+2
-2
@@ -22,7 +22,7 @@ plugins {
|
||||
|
||||
rootProject.name = 'thaumicadditions'
|
||||
|
||||
// Published as uk.potatolab:ThaumicAdditions:<version>-<commit time>-g<sha>, to the organisation's registry.
|
||||
// Published as uk.potatolab:thaumicadditions:<version>-<commit time>-g<sha>, to the organisation's registry.
|
||||
stratum {
|
||||
artifactId = 'ThaumicAdditions'
|
||||
artifactId = 'thaumicadditions'
|
||||
}
|
||||
@@ -19,7 +19,7 @@ public class StructureDefiner {
|
||||
|
||||
public final Map<ChunkCoordinates, BlockStack> map = new HashMap();
|
||||
public final Map<ChunkCoordinates, NBTTagCompound> nbts = new HashMap();
|
||||
public String Clazz = "mrdimka.api.thaumicadditions.worldgen.BasicStructure";
|
||||
public String Clazz = "com.pengu.api.thaumicadditions.worldgen.BasicStructure";
|
||||
|
||||
|
||||
public void gatherData(BufferedReader r) {
|
||||
|
||||
@@ -63,7 +63,7 @@ import thaumcraft.api.wands.WandRod;
|
||||
modid = "thaumicadditions",
|
||||
version = "0.41",
|
||||
name = "Thaumic Additions",
|
||||
guiFactory = "mrdimka.thaumcraft.additions.config.ConfigurationGuiFactory",
|
||||
guiFactory = "com.pengu.thaumcraft.additions.config.ConfigurationGuiFactory",
|
||||
dependencies = "required-after:Thaumcraft@[4.2.3.5,);required-after:Forge@[10.13.3.137,);required-after:Baubles@[1.0.1.10,)"
|
||||
)
|
||||
public class TA {
|
||||
@@ -138,7 +138,7 @@ public class TA {
|
||||
proxy.init();
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(Reference.instance, new GUIHandler());
|
||||
if(Loader.isModLoaded("Botania")) {
|
||||
this.accessClass("mrdimka.thaumcraft.additions.api.others.Botania").init();
|
||||
this.accessClass("com.pengu.thaumcraft.additions.api.others.Botania").init();
|
||||
}
|
||||
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(All.singularity, new BehaviorDispenseSingularity());
|
||||
@@ -167,7 +167,7 @@ public class TA {
|
||||
adaminitewood_staff.setGlowing(true);
|
||||
adaminitewood_staff.setRunes(true);
|
||||
if(Loader.isModLoaded("Botania")) {
|
||||
this.accessClass("mrdimka.thaumcraft.additions.api.others.Botania").postInit();
|
||||
this.accessClass("com.pengu.thaumcraft.additions.api.others.Botania").postInit();
|
||||
}
|
||||
|
||||
All.initVoidChestLoot();
|
||||
|
||||
@@ -40,6 +40,11 @@ public class BlockCreativeNode extends BlockContainer {
|
||||
}
|
||||
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World w, int x, int y, int z) {
|
||||
if(!w.isRemote) {
|
||||
// rendering never happens on the server, so the stack walk below can only find nothing
|
||||
return AxisAlignedBB.getBoundingBox(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
StackTraceElement[] var5 = Thread.currentThread().getStackTrace();
|
||||
int var6 = var5.length;
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ public class BlockHyperNodeCreator extends BlockContainer {
|
||||
public BlockHyperNodeCreator() {
|
||||
super(Material.iron);
|
||||
this.setBlockName("thaumicadditions:hyper_node_creator");
|
||||
this.setBlockTextureName("thaumicadditions:creative_node");
|
||||
this.setCreativeTab(TA.tabTA);
|
||||
this.setBlockUnbreakable();
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ public class BlockInfuserActivator extends BlockContainer {
|
||||
public BlockInfuserActivator() {
|
||||
super(Material.rock);
|
||||
this.setBlockName("thaumicadditions:infuser_activator");
|
||||
this.setBlockTextureName("thaumicadditions:infuser_activator");
|
||||
this.setBlockTextureName("thaumicadditions:infuser/side");
|
||||
this.setCreativeTab(TA.tabTA);
|
||||
this.blockHardness = 2.0F;
|
||||
this.blockResistance = 5.0F;
|
||||
|
||||
@@ -22,6 +22,7 @@ public class BlockReturner extends BlockContainer {
|
||||
TileEntity.addMapping(TileReturner.class, "thaumicadditions:Returner");
|
||||
this.setBlockUnbreakable();
|
||||
this.setBlockName("thaumicadditions:returner_block");
|
||||
this.setBlockTextureName("thaumicadditions:void");
|
||||
}
|
||||
|
||||
public void getSubBlocks(Item i, CreativeTabs c, List l) {}
|
||||
|
||||
@@ -2,12 +2,32 @@ package com.pengu.thaumcraft.additions.config;
|
||||
|
||||
import com.pengu.thaumcraft.additions.config.modcfg;
|
||||
import cpw.mods.fml.client.config.GuiConfig;
|
||||
import cpw.mods.fml.client.config.IConfigElement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraftforge.common.config.ConfigCategory;
|
||||
import net.minecraftforge.common.config.ConfigElement;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
public class ModConfigurationGui extends GuiConfig {
|
||||
|
||||
public ModConfigurationGui(GuiScreen gui) {
|
||||
super(gui, (new ConfigElement(modcfg.getConfiguration().getCategory("general"))).getChildElements(), "thaumicadditions", true, true, GuiConfig.getAbridgedConfigPath(modcfg.getConfiguration().toString()));
|
||||
super(gui, getCategoryElements(), "thaumicadditions", true, true, GuiConfig.getAbridgedConfigPath(modcfg.getConfiguration().toString()));
|
||||
}
|
||||
|
||||
// 选项都在 Customization、misc、ClientSide 里,general 是空的,所以按实际分类列出来。
|
||||
private static List<IConfigElement> getCategoryElements() {
|
||||
Configuration cfg = modcfg.getConfiguration();
|
||||
List<IConfigElement> elements = new ArrayList<IConfigElement>();
|
||||
|
||||
for(String name : cfg.getCategoryNames()) {
|
||||
ConfigCategory category = cfg.getCategory(name);
|
||||
if(!category.getValues().isEmpty()) {
|
||||
elements.add(new ConfigElement(category));
|
||||
}
|
||||
}
|
||||
|
||||
return elements;
|
||||
}
|
||||
}
|
||||
@@ -67,10 +67,18 @@ public class EntitySingularity extends EntityAlumentum {
|
||||
List l;
|
||||
List l2;
|
||||
int i;
|
||||
// position and radius do not change inside the loop, so the box is built once and the entity lists are
|
||||
// only queried again after a round that could have added or removed entities (alumentum, block breaking)
|
||||
AxisAlignedBB ent = AxisAlignedBB.getBoundingBox(this.posX - (double)this.radius, this.posY - (double)this.radius, this.posZ - (double)this.radius, this.posX + (double)this.radius, this.posY + (double)this.radius, this.posZ + (double)this.radius);
|
||||
l = this.worldObj.getEntitiesWithinAABB(Entity.class, ent);
|
||||
l2 = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, ent);
|
||||
boolean entitiesChanged = false;
|
||||
for(p = 0; p < 128; ++p) {
|
||||
AxisAlignedBB ent = AxisAlignedBB.getBoundingBox(this.posX - (double)this.radius, this.posY - (double)this.radius, this.posZ - (double)this.radius, this.posX + (double)this.radius, this.posY + (double)this.radius, this.posZ + (double)this.radius);
|
||||
l = this.worldObj.getEntitiesWithinAABB(Entity.class, ent);
|
||||
l2 = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, ent);
|
||||
if(entitiesChanged) {
|
||||
l = this.worldObj.getEntitiesWithinAABB(Entity.class, ent);
|
||||
l2 = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, ent);
|
||||
entitiesChanged = false;
|
||||
}
|
||||
|
||||
double ry;
|
||||
double ey;
|
||||
@@ -103,6 +111,7 @@ public class EntitySingularity extends EntityAlumentum {
|
||||
var24.posZ = ez;
|
||||
var24.inGround = true;
|
||||
this.worldObj.spawnEntityInWorld(var24);
|
||||
entitiesChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,23 +131,6 @@ public class EntitySingularity extends EntityAlumentum {
|
||||
}
|
||||
|
||||
int var22;
|
||||
for(i = 0; i < 16; ++i) {
|
||||
for(var22 = 0; var22 < l2.size(); ++var22) {
|
||||
double rz = ((EntityLivingBase)l2.get(var22)).posX;
|
||||
double ey1 = ((EntityLivingBase)l2.get(var22)).posY;
|
||||
double ez1 = ((EntityLivingBase)l2.get(var22)).posZ;
|
||||
double motionX1 = ((EntityLivingBase)l2.get(var22)).motionX;
|
||||
double motionY1 = ((EntityLivingBase)l2.get(var22)).motionY;
|
||||
double motionZ1 = ((EntityLivingBase)l2.get(var22)).motionZ;
|
||||
motionX1 = this.posX - rz;
|
||||
motionY1 = this.posY - ey1 + (double)(this.ticksExisted < 400?(float)this.ticksExisted / 400.0F * 4.0F:4.0F);
|
||||
motionZ1 = this.posZ - ez1;
|
||||
((EntityLivingBase)l2.get(var22)).motionX = motionX1 / 10.0D;
|
||||
((EntityLivingBase)l2.get(var22)).motionY = motionY1 / 10.0D;
|
||||
((EntityLivingBase)l2.get(var22)).motionZ = motionZ1 / 10.0D;
|
||||
}
|
||||
}
|
||||
|
||||
i = (int)this.posX;
|
||||
var22 = (int)this.posY;
|
||||
int var23 = (int)this.posZ;
|
||||
@@ -153,6 +145,7 @@ public class EntitySingularity extends EntityAlumentum {
|
||||
}
|
||||
|
||||
this.worldObj.setBlockToAir(i, var22, var23);
|
||||
entitiesChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class GUICondensator extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation("thaumicadditions", "textures/gui/guicondenser.png");
|
||||
|
||||
private TileOldCondensator mw;
|
||||
|
||||
|
||||
@@ -23,7 +25,7 @@ public class GUICondensator extends GuiContainer {
|
||||
}
|
||||
|
||||
public void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("thaumicadditions", "textures/gui/guicondenser.png"));
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE);
|
||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
|
||||
int i = this.mw.getProgressScaled(36);
|
||||
GL11.glPushMatrix();
|
||||
|
||||
@@ -12,6 +12,8 @@ import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIDarkGenerator extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation("thaumicadditions", "textures/gui/guidarkgen.png");
|
||||
|
||||
private TileDarkGen mw;
|
||||
|
||||
|
||||
@@ -23,7 +25,7 @@ public class GUIDarkGenerator extends GuiContainer {
|
||||
}
|
||||
|
||||
public void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("thaumicadditions", "textures/gui/guidarkgen.png"));
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE);
|
||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
|
||||
this.drawTexturedModalRect(this.guiLeft + 84, this.guiTop + 44, 192, this.mw.getWorldObj().getMoonPhase() * 8, 8, 8);
|
||||
this.drawTexturedModalRect(this.guiLeft + 84 - 4, this.guiTop + 44 - 20, 176, LightUtil.getLightValue(this.mw.getWorldObj(), this.mw.xCoord, this.mw.yCoord, this.mw.zCoord) * 16, 16, 16);
|
||||
|
||||
@@ -12,6 +12,8 @@ import net.minecraft.util.StatCollector;
|
||||
|
||||
public class GUIDarkInfuser extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation("thaumicadditions", "textures/gui/guidarkinfuser.png");
|
||||
|
||||
private TileDarkInfuser mw;
|
||||
|
||||
|
||||
@@ -23,7 +25,7 @@ public class GUIDarkInfuser extends GuiContainer {
|
||||
}
|
||||
|
||||
public void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("thaumicadditions", "textures/gui/guidarkinfuser.png"));
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE);
|
||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
|
||||
int i;
|
||||
if(this.mw.cookTime > 0) {
|
||||
|
||||
@@ -11,6 +11,8 @@ import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIHyperNodeCreator extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation("thaumicadditions", "textures/gui/guihypernodecreator.png");
|
||||
|
||||
private TileHyperNodeCreator mw;
|
||||
|
||||
|
||||
@@ -22,7 +24,7 @@ public class GUIHyperNodeCreator extends GuiContainer {
|
||||
}
|
||||
|
||||
public void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("thaumicadditions", "textures/gui/guihypernodecreator.png"));
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE);
|
||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIInfuser extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation("thaumicadditions", "textures/gui/guiinfuser.png");
|
||||
|
||||
private TileInfuser mw;
|
||||
|
||||
|
||||
@@ -21,7 +23,7 @@ public class GUIInfuser extends GuiContainer {
|
||||
}
|
||||
|
||||
public void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("thaumicadditions", "textures/gui/guiinfuser.png"));
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE);
|
||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
|
||||
if(this.mw.cookTime > 0) {
|
||||
int i = this.mw.getCookProgressScaled(47);
|
||||
|
||||
@@ -14,6 +14,8 @@ import net.minecraft.world.World;
|
||||
|
||||
public class GUISealGlobe extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation("thaumicadditions", "textures/gui/guicrystalball.png");
|
||||
|
||||
private World world;
|
||||
private int x;
|
||||
private int y;
|
||||
@@ -35,7 +37,7 @@ public class GUISealGlobe extends GuiContainer {
|
||||
}
|
||||
|
||||
public void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("thaumicadditions", "textures/gui/guicrystalball.png"));
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE);
|
||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
|
||||
if(this.dir == EnumRise.UP) {
|
||||
this.color += 4.210651F;
|
||||
|
||||
@@ -10,6 +10,8 @@ import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIThaumicCrystallizer extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation("thaumicadditions", "textures/gui/guicrystalizer.png");
|
||||
|
||||
private TileThaumCrystallizer mw;
|
||||
|
||||
|
||||
@@ -21,7 +23,7 @@ public class GUIThaumicCrystallizer extends GuiContainer {
|
||||
}
|
||||
|
||||
public void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("thaumicadditions", "textures/gui/guicrystalizer.png"));
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE);
|
||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
|
||||
int i = this.mw.getCookProgressScaled(47);
|
||||
this.drawTexturedModalRect(this.guiLeft + 160, this.guiTop + 105 + 47 - i, 176, 47 - i, 9, i);
|
||||
|
||||
@@ -10,6 +10,8 @@ import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIThaumicGenerator extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation("thaumicadditions", "textures/gui/guigenerator.png");
|
||||
|
||||
private TileThaumicGenerator mw;
|
||||
|
||||
|
||||
@@ -21,7 +23,7 @@ public class GUIThaumicGenerator extends GuiContainer {
|
||||
}
|
||||
|
||||
public void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("thaumicadditions", "textures/gui/guigenerator.png"));
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE);
|
||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
|
||||
int i = this.mw.amount * 47 / this.mw.maxAmount;
|
||||
this.drawTexturedModalRect(this.guiLeft + 47, this.guiTop + 22 + 47 - i, 102, 47 - i, 9, i);
|
||||
|
||||
@@ -11,6 +11,8 @@ import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIThaumicRestorer extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation("thaumicadditions", "textures/gui/guirepairer.png");
|
||||
|
||||
private TileThaumicRestorer res;
|
||||
|
||||
|
||||
@@ -22,7 +24,7 @@ public class GUIThaumicRestorer extends GuiContainer {
|
||||
}
|
||||
|
||||
public void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("thaumicadditions", "textures/gui/guirepairer.png"));
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE);
|
||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
|
||||
int i = this.res.tick * 31 / 5;
|
||||
this.drawTexturedModalRect(this.guiLeft + 135, this.guiTop + 16 + 31 - i, 176, 31 - i, 7, i);
|
||||
|
||||
@@ -9,6 +9,8 @@ import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIVoidChest extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation("thaumicadditions", "textures/gui/guivoidchest.png");
|
||||
|
||||
private TileVoidChest mw;
|
||||
|
||||
|
||||
@@ -20,7 +22,7 @@ public class GUIVoidChest extends GuiContainer {
|
||||
}
|
||||
|
||||
public void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("thaumicadditions", "textures/gui/guivoidchest.png"));
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE);
|
||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
|
||||
@@ -58,8 +58,9 @@ public class TileVisTube extends TileThaumcraft implements IMultiBlockPart, ITub
|
||||
x = this.xCoord + ForgeDirectionHelper.getForgeDirectionXApplyed(fd);
|
||||
y = this.yCoord + ForgeDirectionHelper.getForgeDirectionYApplyed(fd);
|
||||
z = this.zCoord + ForgeDirectionHelper.getForgeDirectionZApplyed(fd);
|
||||
if(this.worldObj.getTileEntity(x, y, z) instanceof ITubeConnectable) {
|
||||
ITubeConnectable tube = (ITubeConnectable)this.worldObj.getTileEntity(x, y, z);
|
||||
TileEntity neighbour = this.worldObj.getTileEntity(x, y, z); // read once per side
|
||||
if(neighbour instanceof ITubeConnectable) {
|
||||
ITubeConnectable tube = (ITubeConnectable)neighbour;
|
||||
this.connectivity.put(fd, Boolean.valueOf(tube.canConnect(fd.getOpposite())));
|
||||
if(((Boolean)this.connectivity.get(fd)).booleanValue()) {
|
||||
this.connectivityExtended.put(fd, Boolean.valueOf(tube.shouldExtendRenderingForTubes(fd.getOpposite())));
|
||||
@@ -71,8 +72,8 @@ public class TileVisTube extends TileThaumcraft implements IMultiBlockPart, ITub
|
||||
this.connectivityExtended.put(fd, Boolean.valueOf(false));
|
||||
}
|
||||
|
||||
if(this.worldObj.getTileEntity(x, y, z) instanceof ITubable) {
|
||||
ITubable var12 = (ITubable)this.worldObj.getTileEntity(x, y, z);
|
||||
if(neighbour instanceof ITubable) {
|
||||
ITubable var12 = (ITubable)neighbour;
|
||||
if(var12.canConnect(fd.getOpposite()) && !(var12 instanceof TileVisTube)) {
|
||||
if(var12.canAccept(fd.getOpposite(), MagicType.VIS) && this.ejectVis(MagicType.VIS, var12.acceptVis(MagicType.VIS, this.grid.vis, fd.getOpposite()), fd) > 0) {
|
||||
;
|
||||
@@ -95,7 +96,8 @@ public class TileVisTube extends TileThaumcraft implements IMultiBlockPart, ITub
|
||||
x = this.xCoord + ForgeDirectionHelper.getForgeDirectionXApplyed(fd);
|
||||
y = this.yCoord + ForgeDirectionHelper.getForgeDirectionYApplyed(fd);
|
||||
z = this.zCoord + ForgeDirectionHelper.getForgeDirectionZApplyed(fd);
|
||||
TileVisTube var13 = this.world().getTileEntity(x, y, z) instanceof TileVisTube?(TileVisTube)this.world().getTileEntity(x, y, z):null;
|
||||
TileEntity neighbour = this.world().getTileEntity(x, y, z);
|
||||
TileVisTube var13 = neighbour instanceof TileVisTube?(TileVisTube)neighbour:null;
|
||||
if(var13 != null && var13.canConnect(fd.getOpposite())) {
|
||||
VisGrid grid0 = this.grid;
|
||||
VisGrid grid1 = var13.grid;
|
||||
|
||||
+5
-14
@@ -14,20 +14,11 @@ public class TileOldReinforcedTank extends TileTankBasic {
|
||||
}
|
||||
|
||||
public void updateEntity() {
|
||||
if(!(this.worldObj.getBlock(this.xCoord, this.yCoord + 1, this.zCoord) instanceof BlockTankBasic) && !(this.worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) instanceof BlockTankBasic) && this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord) != 0) {
|
||||
Util.setBlockMetadata(this.worldObj, this.xCoord, this.yCoord, this.zCoord, 0);
|
||||
}
|
||||
|
||||
if(!(this.worldObj.getBlock(this.xCoord, this.yCoord + 1, this.zCoord) instanceof BlockTankBasic) && this.worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) instanceof BlockTankBasic && this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord) != 1) {
|
||||
Util.setBlockMetadata(this.worldObj, this.xCoord, this.yCoord, this.zCoord, 1);
|
||||
}
|
||||
|
||||
if(this.worldObj.getBlock(this.xCoord, this.yCoord + 1, this.zCoord) instanceof BlockTankBasic && !(this.worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) instanceof BlockTankBasic) && this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord) != 2) {
|
||||
Util.setBlockMetadata(this.worldObj, this.xCoord, this.yCoord, this.zCoord, 2);
|
||||
}
|
||||
|
||||
if(this.worldObj.getBlock(this.xCoord, this.yCoord + 1, this.zCoord) instanceof BlockTankBasic && this.worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) instanceof BlockTankBasic && this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord) != 3) {
|
||||
Util.setBlockMetadata(this.worldObj, this.xCoord, this.yCoord, this.zCoord, 3);
|
||||
boolean above = this.worldObj.getBlock(this.xCoord, this.yCoord + 1, this.zCoord) instanceof BlockTankBasic;
|
||||
boolean below = this.worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) instanceof BlockTankBasic;
|
||||
int wantedMeta = TileTankBasic.connectionMeta(above, below);
|
||||
if(this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord) != wantedMeta) {
|
||||
Util.setBlockMetadata(this.worldObj, this.xCoord, this.yCoord, this.zCoord, wantedMeta);
|
||||
}
|
||||
|
||||
boolean ext = this.worldObj.getTileEntity(this.xCoord, this.yCoord + 1, this.zCoord) instanceof TileOldReinforcedTank && this.vis + this.taint < this.capacity;
|
||||
|
||||
+54
-46
@@ -2,7 +2,6 @@ package com.pengu.thaumcraft.additions.playnet.packtetmng;
|
||||
|
||||
import com.pengu.api.thaumicadditions.enums.EnumAT;
|
||||
import com.pengu.thaumcraft.additions.utils.hud.HUD;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
@@ -16,59 +15,68 @@ public class PacketAuraVis implements IMessage, IMessageHandler<PacketAuraVis, I
|
||||
|
||||
|
||||
public void setData(EnumAT[] aspects, int[] amounts) {
|
||||
this.aspects = aspects;
|
||||
this.amts = amounts;
|
||||
this.aspects = aspects;
|
||||
this.amts = amounts;
|
||||
}
|
||||
|
||||
public IMessage onMessage(PacketAuraVis message, MessageContext ctx) {
|
||||
try {
|
||||
FMLLog.info("Received!", new Object[0]);
|
||||
|
||||
for(int i = 0; i < Math.min(message.aspects.length, message.amts.length); ++i) {
|
||||
HUD.currentAspects.aspects.put(Aspect.getAspect(message.aspects[i].getAspect()), Integer.valueOf(message.amts[i]));
|
||||
}
|
||||
} catch (Throwable var4) {
|
||||
;
|
||||
}
|
||||
|
||||
return null;
|
||||
try {
|
||||
for(int i = 0; i < Math.min(message.aspects.length, message.amts.length); ++i) {
|
||||
HUD.currentAspects.aspects.put(Aspect.getAspect(message.aspects[i].getAspect()), Integer.valueOf(message.amts[i]));
|
||||
}
|
||||
} catch (Throwable var4) {
|
||||
;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
this.amts = new int[buf.readInt()];
|
||||
|
||||
int i;
|
||||
for(i = 0; i < this.amts.length; ++i) {
|
||||
this.amts[i] = buf.readInt();
|
||||
}
|
||||
|
||||
this.aspects = new EnumAT[buf.readInt()];
|
||||
|
||||
for(i = 0; i < this.aspects.length; ++i) {
|
||||
this.aspects[i] = EnumAT.getFrom(buf.readInt());
|
||||
}
|
||||
|
||||
this.amts = new int[checkedLength(buf)];
|
||||
|
||||
int i;
|
||||
for(i = 0; i < this.amts.length; ++i) {
|
||||
this.amts[i] = buf.readInt();
|
||||
}
|
||||
|
||||
this.aspects = new EnumAT[checkedLength(buf)];
|
||||
|
||||
for(i = 0; i < this.aspects.length; ++i) {
|
||||
this.aspects[i] = EnumAT.getFrom(buf.readInt());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Each element is one int: a count larger than what is left in the packet is malformed
|
||||
// (it used to size the array straight from the wire).
|
||||
private static int checkedLength(ByteBuf buf) {
|
||||
int n = buf.readInt();
|
||||
if(n < 0 || n > buf.readableBytes() / 4) {
|
||||
throw new IllegalArgumentException("bad aura packet length " + n);
|
||||
}
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
public void toBytes(ByteBuf buf) {
|
||||
buf.writeInt(this.amts.length);
|
||||
int[] var2 = this.amts;
|
||||
int var3 = var2.length;
|
||||
|
||||
int var4;
|
||||
for(var4 = 0; var4 < var3; ++var4) {
|
||||
int a = var2[var4];
|
||||
buf.writeInt(a);
|
||||
}
|
||||
|
||||
buf.writeInt(this.aspects.length);
|
||||
EnumAT[] var6 = this.aspects;
|
||||
var3 = var6.length;
|
||||
|
||||
for(var4 = 0; var4 < var3; ++var4) {
|
||||
EnumAT var7 = var6[var4];
|
||||
buf.writeInt(var7.id);
|
||||
}
|
||||
|
||||
buf.writeInt(this.amts.length);
|
||||
int[] var2 = this.amts;
|
||||
int var3 = var2.length;
|
||||
|
||||
int var4;
|
||||
for(var4 = 0; var4 < var3; ++var4) {
|
||||
int a = var2[var4];
|
||||
buf.writeInt(a);
|
||||
}
|
||||
|
||||
buf.writeInt(this.aspects.length);
|
||||
EnumAT[] var6 = this.aspects;
|
||||
var3 = var6.length;
|
||||
|
||||
for(var4 = 0; var4 < var3; ++var4) {
|
||||
EnumAT var7 = var6[var4];
|
||||
buf.writeInt(var7.id);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -10,16 +10,19 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RendererDarkGen extends TileEntitySpecialRenderer {
|
||||
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation("thaumicadditions", "textures/models/DarkGen.png");
|
||||
private final ModelDarkGen modelDarkGen = new ModelDarkGen(); // one instance (each new one also compiled fresh display lists)
|
||||
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float par1float) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||
ResourceLocation textures = new ResourceLocation("thaumicadditions", "textures/models/DarkGen.png");
|
||||
ResourceLocation textures = TEXTURE;
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(textures);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F);
|
||||
(new ModelDarkGen()).render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F, false);
|
||||
this.modelDarkGen.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F, false);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -11,16 +11,20 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RendererHyperNodeCreator extends TileEntitySpecialRenderer {
|
||||
|
||||
private static final ResourceLocation TEXTURE_PRIMALS = new ResourceLocation("thaumicadditions", "textures/models/HyperNodeCreator_primals.png");
|
||||
private static final ResourceLocation TEXTURE_ALL = new ResourceLocation("thaumicadditions", "textures/models/HyperNodeCreator_all.png");
|
||||
private final ModelHyperNodeCreator modelHyperNodeCreator = new ModelHyperNodeCreator(); // one instance (each new one also compiled fresh display lists)
|
||||
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float par1float) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||
ResourceLocation textures = new ResourceLocation("thaumicadditions", "textures/models/HyperNodeCreator_" + (((TileHyperNodeCreator)te).primalsOnly?"primals":"all") + ".png");
|
||||
ResourceLocation textures = ((TileHyperNodeCreator)te).primalsOnly ? TEXTURE_PRIMALS : TEXTURE_ALL;
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(textures);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F);
|
||||
(new ModelHyperNodeCreator()).render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F, ((TileHyperNodeCreator)te).node);
|
||||
this.modelHyperNodeCreator.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F, ((TileHyperNodeCreator)te).node);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -13,15 +13,21 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RendererInfuser extends TileEntitySpecialRenderer {
|
||||
|
||||
private static final ResourceLocation TOP = new ResourceLocation("thaumicadditions", "textures/models/InfuserTop.png");
|
||||
private static final ResourceLocation TOP_DARK = new ResourceLocation("thaumicadditions", "textures/models/InfuserTopDark.png");
|
||||
private static final ResourceLocation SYMBOL = new ResourceLocation("thaumicadditions", "textures/models/infusersymbol.png");
|
||||
private static final ResourceLocation SYMBOL_DARK = new ResourceLocation("thaumicadditions", "textures/models/darkinfusersymbol.png");
|
||||
private final ModelTileInfuser modelTileInfuser = new ModelTileInfuser(); // one instance (each new one also compiled fresh display lists)
|
||||
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float par1float) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("thaumicadditions", "textures/models/InfuserTop" + (te instanceof TileDarkInfuser?"Dark":"") + ".png"));
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture((te instanceof TileDarkInfuser ? TOP_DARK : TOP));
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F);
|
||||
(new ModelTileInfuser()).render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F, false);
|
||||
this.modelTileInfuser.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F, false);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
@@ -33,7 +39,7 @@ public class RendererInfuser extends TileEntitySpecialRenderer {
|
||||
GL11.glTranslatef((float)x, (float)y + 0.5F - 0.2185F, (float)z);
|
||||
}
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("thaumicadditions", "textures/models/infusersymbol.png"));
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(SYMBOL);
|
||||
if(inf.cookTime > 0) {
|
||||
GL11.glTranslatef((float)x + 0.5F, (float)y + 0.5F - 0.2185F, (float)z + 0.5F);
|
||||
GL11.glRotatef((float)Minecraft.getSystemTime() % 3600.0F / 10.0F, 0.0F, 1.0F, 0.0F);
|
||||
@@ -50,7 +56,7 @@ public class RendererInfuser extends TileEntitySpecialRenderer {
|
||||
GL11.glTranslatef((float)x, (float)y + 0.5F - 0.2185F, (float)z);
|
||||
}
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("thaumicadditions", "textures/models/darkinfusersymbol.png"));
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(SYMBOL_DARK);
|
||||
if(inf1.cookTime + inf1.cookTimeTaint > 0) {
|
||||
GL11.glTranslatef((float)x + 0.5F, (float)y + 0.5F - 0.2185F, (float)z + 0.5F);
|
||||
GL11.glRotatef((float)Minecraft.getSystemTime() % 3600.0F / 10.0F, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
@@ -13,10 +13,14 @@ import thaumcraft.client.renderers.item.ItemWandRenderer;
|
||||
|
||||
public class RendererInfuserActivator extends TileEntitySpecialRenderer {
|
||||
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation("thaumicadditions", "textures/models/InfuserActivator.png");
|
||||
private final ModelInfuserActivator modelInfuserActivator = new ModelInfuserActivator(); // one instance (each new one also compiled fresh display lists)
|
||||
private final ItemWandRenderer wandRenderer = new ItemWandRenderer();
|
||||
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float par1float) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||
ResourceLocation textures = new ResourceLocation("thaumicadditions", "textures/models/InfuserActivator.png");
|
||||
ResourceLocation textures = TEXTURE;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glPushMatrix();
|
||||
@@ -28,13 +32,13 @@ public class RendererInfuserActivator extends TileEntitySpecialRenderer {
|
||||
float rot = te instanceof TileInfuserActivator?(float)((TileInfuserActivator)te).beforeclick:0.0F;
|
||||
rot = -rot;
|
||||
GL11.glTranslatef(0.0F, 1.4F + rot / 360.0F, 0.0F);
|
||||
(new ItemWandRenderer()).renderItem(ItemRenderType.ENTITY, ((TileInfuserActivator)te).wandstack, new Object[0]);
|
||||
this.wandRenderer.renderItem(ItemRenderType.ENTITY, ((TileInfuserActivator)te).wandstack, new Object[0]);
|
||||
GL11.glColor3f(1.0F, 1.0F, 1.0F);
|
||||
GL11.glEnable(2896);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(textures);
|
||||
(new ModelInfuserActivator()).render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
|
||||
this.modelInfuserActivator.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -12,6 +12,10 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RendererSeal extends TileEntitySpecialRenderer {
|
||||
|
||||
private static final ResourceLocation SEAL = new ResourceLocation("thaumicadditions", "textures/models/seal.png");
|
||||
private static final ResourceLocation SEAL_OVER = new ResourceLocation("thaumicadditions", "textures/models/seal_over.png");
|
||||
private final ModelSeal modelSeal = new ModelSeal(); // one instance (each new one also compiled fresh display lists)
|
||||
|
||||
ResourceLocation f0 = new ResourceLocation("thaumicadditions", "textures/blocks/seal_/s_0.png");
|
||||
ResourceLocation f1 = new ResourceLocation("thaumicadditions", "textures/blocks/seal_/s_1.png");
|
||||
ResourceLocation f2 = new ResourceLocation("thaumicadditions", "textures/blocks/seal_/s_2.png");
|
||||
@@ -38,14 +42,14 @@ public class RendererSeal extends TileEntitySpecialRenderer {
|
||||
GL11.glTranslatef(1.0F / (ori == 5?256.0F:-256.0F), 2.32F, 0.0F);
|
||||
}
|
||||
|
||||
this.bindTexture(new ResourceLocation("thaumicadditions", "textures/models/seal.png"));
|
||||
(new ModelSeal()).render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F, te.getBlockMetadata() < 6?ForgeDirection.OPPOSITES[te.getBlockMetadata()]:0);
|
||||
this.bindTexture(new ResourceLocation("thaumicadditions", "textures/models/seal_over.png"));
|
||||
this.bindTexture(SEAL);
|
||||
this.modelSeal.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F, te.getBlockMetadata() < 6?ForgeDirection.OPPOSITES[te.getBlockMetadata()]:0);
|
||||
this.bindTexture(SEAL_OVER);
|
||||
float r0 = (float)(((TileSeal)te).color >> 16 & 255) / 255.0F;
|
||||
float g0 = (float)(((TileSeal)te).color >> 8 & 255) / 255.0F;
|
||||
float b0 = (float)(((TileSeal)te).color & 255) / 255.0F;
|
||||
GL11.glColor3f(r0, g0, b0);
|
||||
(new ModelSeal()).render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F, te.getBlockMetadata() < 6?ForgeDirection.OPPOSITES[te.getBlockMetadata()]:0);
|
||||
this.modelSeal.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F, te.getBlockMetadata() < 6?ForgeDirection.OPPOSITES[te.getBlockMetadata()]:0);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
float r1;
|
||||
@@ -58,7 +62,7 @@ public class RendererSeal extends TileEntitySpecialRenderer {
|
||||
b1 = (float)(((TileSeal)te).f.getType().getColor() & 255) / 255.0F;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glColor3f(r1, g1, b1);
|
||||
(new ModelSeal()).render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F, te.getBlockMetadata() < 6?ForgeDirection.OPPOSITES[te.getBlockMetadata()]:0);
|
||||
this.modelSeal.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F, te.getBlockMetadata() < 6?ForgeDirection.OPPOSITES[te.getBlockMetadata()]:0);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@@ -69,7 +73,7 @@ public class RendererSeal extends TileEntitySpecialRenderer {
|
||||
b1 = (float)(((TileSeal)te).s.getType().getColor() & 255) / 255.0F;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glColor3f(r1, g1, b1);
|
||||
(new ModelSeal()).render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F, te.getBlockMetadata() < 6?ForgeDirection.OPPOSITES[te.getBlockMetadata()]:0);
|
||||
this.modelSeal.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F, te.getBlockMetadata() < 6?ForgeDirection.OPPOSITES[te.getBlockMetadata()]:0);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@@ -80,7 +84,7 @@ public class RendererSeal extends TileEntitySpecialRenderer {
|
||||
b1 = (float)(((TileSeal)te).t.getType().getColor() & 255) / 255.0F;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glColor3f(r1, g1, b1);
|
||||
(new ModelSeal()).render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F, te.getBlockMetadata() < 6?ForgeDirection.OPPOSITES[te.getBlockMetadata()]:0);
|
||||
this.modelSeal.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F, te.getBlockMetadata() < 6?ForgeDirection.OPPOSITES[te.getBlockMetadata()]:0);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
@@ -11,16 +11,19 @@ import thaumcraft.common.tiles.TileJarFillable;
|
||||
|
||||
public class RendererSymboller extends TileEntitySpecialRenderer {
|
||||
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation("thaumicadditions", "textures/models/TileSealSymboller.png");
|
||||
private final ModelTileSealSymboller modelTileSealSymboller = new ModelTileSealSymboller(); // one instance (each new one also compiled fresh display lists)
|
||||
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float floatt) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||
ResourceLocation textures = new ResourceLocation("thaumicadditions", "textures/models/TileSealSymboller.png");
|
||||
ResourceLocation textures = TEXTURE;
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(textures);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F);
|
||||
(new ModelTileSealSymboller()).render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F, te.getWorldObj().getTileEntity(te.xCoord, te.yCoord + 1, te.zCoord) != null && te.getWorldObj().getTileEntity(te.xCoord, te.yCoord + 1, te.zCoord) instanceof TileJarFillable);
|
||||
this.modelTileSealSymboller.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F, te.getWorldObj().getTileEntity(te.xCoord, te.yCoord + 1, te.zCoord) instanceof TileJarFillable);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -14,10 +14,18 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RendererTankBasic extends TileEntitySpecialRenderer {
|
||||
|
||||
private static final ResourceLocation[] LIQUID_FRAMES = new ResourceLocation[16];
|
||||
static {
|
||||
for(int i = 0; i < LIQUID_FRAMES.length; ++i) {
|
||||
LIQUID_FRAMES[i] = new ResourceLocation("thaumicadditions", "textures/models/TankLiquid/" + i + ".png");
|
||||
}
|
||||
}
|
||||
private final ModelTankFill modelTankFill = new ModelTankFill(); // one instance (each new one also compiled fresh display lists)
|
||||
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float floatt) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5D, y + 0.001D, z + 0.5D);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("thaumicadditions", "textures/models/TankLiquid/" + (int)(Minecraft.getSystemTime() % 1600L / 100L) + ".png"));
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(LIQUID_FRAMES[(int)(Minecraft.getSystemTime() % 1600L / 100L)]);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glPushMatrix();
|
||||
@@ -29,7 +37,7 @@ public class RendererTankBasic extends TileEntitySpecialRenderer {
|
||||
Color mesh = ColorUtil.blend(new Color(VisGrid.visColor), new Color(VisGrid.taintColor));
|
||||
GL11.glColor3f((float)mesh.getRed() / 255.0F, (float)mesh.getGreen() / 255.0F, (float)mesh.getBlue() / 255.0F);
|
||||
if(storedTot > 0.0F) {
|
||||
(new ModelTankFill()).render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
|
||||
this.modelTankFill.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -2,7 +2,6 @@ package com.pengu.thaumcraft.additions.renderer;
|
||||
|
||||
import com.pengu.thaumcraft.additions.init.All;
|
||||
import com.pengu.thaumcraft.additions.tileentity.TileThaumCrystallizer;
|
||||
import java.awt.Color;
|
||||
import java.util.Random;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
@@ -18,6 +17,8 @@ import thaumcraft.common.config.ConfigItems;
|
||||
|
||||
public class RendererThaumicCrystallizer extends TileEntitySpecialRenderer {
|
||||
|
||||
private final ModelCrystal crystal = new ModelCrystal(); // one instance (each new one also compiled a fresh display list)
|
||||
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float par1float) {
|
||||
if(te instanceof TileThaumCrystallizer) {
|
||||
TileThaumCrystallizer t = (TileThaumCrystallizer)te;
|
||||
@@ -200,10 +201,9 @@ public class RendererThaumicCrystallizer extends TileEntitySpecialRenderer {
|
||||
private void drawCrystal(int ori, float x, float y, float z, float a1, float a2, Random rand, int color, float id) {
|
||||
EntityClientPlayerMP p = Minecraft.getMinecraft().thePlayer;
|
||||
float shade = MathHelper.sin((float)p.ticksExisted % (9.0E16F + id * 16.0F)) * 0.025F + 0.825F;
|
||||
Color c = new Color(color);
|
||||
float r = (float)c.getRed() / 220.0F;
|
||||
float g = (float)c.getGreen() / 220.0F;
|
||||
float b = (float)c.getBlue() / 220.0F;
|
||||
float r = (float)(color >> 16 & 255) / 220.0F;
|
||||
float g = (float)(color >> 8 & 255) / 220.0F;
|
||||
float b = (float)(color & 255) / 220.0F;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(2977);
|
||||
GL11.glEnable(3042);
|
||||
@@ -218,7 +218,7 @@ public class RendererThaumicCrystallizer extends TileEntitySpecialRenderer {
|
||||
int var21 = var19 / 65536;
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var20 / 1.0F, (float)var21 / 1.0F);
|
||||
GL11.glColor4f(r, g, b, 1.0F);
|
||||
(new ModelCrystal()).render();
|
||||
this.crystal.render();
|
||||
GL11.glScalef(1.0F, 1.0F, 1.0F);
|
||||
GL11.glDisable('\u803a');
|
||||
GL11.glDisable(3042);
|
||||
|
||||
@@ -11,16 +11,19 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RendererThaumicGenerator extends TileEntitySpecialRenderer {
|
||||
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation("thaumicadditions", "textures/models/ThaumicGenerator.png");
|
||||
private final ModelThaumicGenerator modelThaumicGenerator = new ModelThaumicGenerator(); // one instance (each new one also compiled fresh display lists)
|
||||
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float par1float) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||
ResourceLocation textures = new ResourceLocation("thaumicadditions", "textures/models/ThaumicGenerator.png");
|
||||
ResourceLocation textures = TEXTURE;
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(textures);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F);
|
||||
(new ModelThaumicGenerator()).render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F, ((TileThaumicGenerator)te).emitPowerFromSidesListedHere);
|
||||
this.modelThaumicGenerator.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F, ((TileThaumicGenerator)te).emitPowerFromSidesListedHere);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -10,16 +10,19 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RendererThaumicRestorer extends TileEntitySpecialRenderer {
|
||||
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation("thaumicadditions", "textures/models/ThaumicRestorer.png");
|
||||
private final ModelThaumicRestorer modelThaumicRestorer = new ModelThaumicRestorer(); // one instance (each new one also compiled fresh display lists)
|
||||
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float par1float) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("thaumicadditions", "textures/models/ThaumicRestorer.png"));
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glDisable(2896);
|
||||
(new ModelThaumicRestorer()).render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
|
||||
this.modelThaumicRestorer.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
|
||||
GL11.glEnable(2896);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -35,6 +35,7 @@ public class TileCreativeNode extends TileVisNode implements INode, IWandable {
|
||||
public Color targetColor = new Color(16777215);
|
||||
public Color color = new Color(16777215);
|
||||
public boolean hasUpdatedOnce;
|
||||
private boolean locationRegistered;
|
||||
|
||||
|
||||
public void updateEntity() {
|
||||
@@ -44,12 +45,30 @@ public class TileCreativeNode extends TileVisNode implements INode, IWandable {
|
||||
|
||||
if(!this.hasUpdatedOnce) {
|
||||
this.hasUpdatedOnce = !this.hasUpdatedOnce;
|
||||
} else {
|
||||
} else if(!this.locationRegistered) {
|
||||
this.generateId();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void invalidate() {
|
||||
this.unregisterLocation();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
public void onChunkUnload() {
|
||||
this.unregisterLocation();
|
||||
super.onChunkUnload();
|
||||
}
|
||||
|
||||
private void unregisterLocation() {
|
||||
if(this.id != null && TileNode.locations != null) {
|
||||
TileNode.locations.remove(this.id);
|
||||
}
|
||||
|
||||
this.locationRegistered = false;
|
||||
}
|
||||
|
||||
public AspectList getAspects() {
|
||||
return (new AspectList()).add(Aspect.AIR, 134217).add(Aspect.WATER, 134217).add(Aspect.FIRE, 134217).add(Aspect.ORDER, 134217).add(Aspect.ENTROPY, 134217).add(Aspect.EARTH, 134217);
|
||||
}
|
||||
@@ -232,6 +251,7 @@ public class TileCreativeNode extends TileVisNode implements INode, IWandable {
|
||||
t.add(Integer.valueOf(this.yCoord));
|
||||
t.add(Integer.valueOf(this.zCoord));
|
||||
TileNode.locations.put(this.id, t);
|
||||
this.locationRegistered = true;
|
||||
}
|
||||
|
||||
return this.id;
|
||||
|
||||
@@ -35,25 +35,17 @@ public class TileHyperNodeCreator extends TileThaumcraft implements IInventory,
|
||||
}
|
||||
}
|
||||
|
||||
TileNode var5 = this.worldObj.getTileEntity(this.xCoord, this.yCoord + 1, this.zCoord) != null && this.worldObj.getTileEntity(this.xCoord, this.yCoord + 1, this.zCoord) instanceof TileNode?(TileNode)this.worldObj.getTileEntity(this.xCoord, this.yCoord + 1, this.zCoord):null;
|
||||
net.minecraft.tileentity.TileEntity above = this.worldObj.getTileEntity(this.xCoord, this.yCoord + 1, this.zCoord);
|
||||
TileNode var5 = above instanceof TileNode?(TileNode)above:null;
|
||||
this.node = var5 != null;
|
||||
if(this.node) {
|
||||
AspectList list = new AspectList();
|
||||
|
||||
int corner;
|
||||
for(corner = 0; corner < Aspect.getPrimalAspects().size(); ++corner) {
|
||||
list.add((Aspect)Aspect.getPrimalAspects().get(corner), totalItems);
|
||||
// the node is only rewritten when it no longer holds the wanted amounts (drained, or the stock changed)
|
||||
if(!holdsExactly(var5.getAspects(), totalItems, this.primalsOnly)) {
|
||||
var5.setAspects(wantedAspects(totalItems, this.primalsOnly));
|
||||
}
|
||||
|
||||
if(!this.primalsOnly) {
|
||||
for(corner = 0; corner < Aspect.getCompoundAspects().size(); ++corner) {
|
||||
list.add((Aspect)Aspect.getCompoundAspects().get(corner), totalItems);
|
||||
}
|
||||
}
|
||||
|
||||
var5.setAspects(list);
|
||||
if(this.worldObj.rand.nextBoolean()) {
|
||||
corner = this.worldObj.rand.nextInt(8);
|
||||
int corner = this.worldObj.rand.nextInt(8);
|
||||
if(corner == 0) {
|
||||
Thaumcraft.proxy.nodeBolt(this.worldObj, (float)this.xCoord, (float)this.yCoord + 2.0F, (float)this.zCoord, (float)this.xCoord + 0.5F, (float)this.yCoord + 1.5F, (float)this.zCoord + 0.5F);
|
||||
}
|
||||
@@ -90,6 +82,52 @@ public class TileHyperNodeCreator extends TileThaumcraft implements IInventory,
|
||||
|
||||
}
|
||||
|
||||
/** The aspect list a node above gets: every primal (and unless primalsOnly every compound) at {@code total}. */
|
||||
public static AspectList wantedAspects(int total, boolean primalsOnly) {
|
||||
AspectList list = new AspectList();
|
||||
|
||||
int i;
|
||||
for(i = 0; i < Aspect.getPrimalAspects().size(); ++i) {
|
||||
list.add((Aspect)Aspect.getPrimalAspects().get(i), total);
|
||||
}
|
||||
|
||||
if(!primalsOnly) {
|
||||
for(i = 0; i < Aspect.getCompoundAspects().size(); ++i) {
|
||||
list.add((Aspect)Aspect.getCompoundAspects().get(i), total);
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/** Whether {@code current} already equals {@link #wantedAspects(int, boolean)} without building it. */
|
||||
public static boolean holdsExactly(AspectList current, int total, boolean primalsOnly) {
|
||||
if(current == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int expected = Aspect.getPrimalAspects().size() + (primalsOnly?0:Aspect.getCompoundAspects().size());
|
||||
return current.size() == expected && allAmounts(current, total, primalsOnly);
|
||||
}
|
||||
|
||||
private static boolean allAmounts(AspectList current, int total, boolean primalsOnly) {
|
||||
for(int i = 0; i < Aspect.getPrimalAspects().size(); ++i) {
|
||||
if(current.getAmount((Aspect)Aspect.getPrimalAspects().get(i)) != total) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(!primalsOnly) {
|
||||
for(int i = 0; i < Aspect.getCompoundAspects().size(); ++i) {
|
||||
if(current.getAmount((Aspect)Aspect.getCompoundAspects().get(i)) != total) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean areItemStacksEqual(ItemStack s1, ItemStack s2) {
|
||||
return s1 == null && s2 == null?true:s1 != null && s2 != null && s1.getItem() == s2.getItem() && s1.getItemDamage() == s2.getItemDamage();
|
||||
}
|
||||
|
||||
+9
-4
@@ -1,7 +1,6 @@
|
||||
package com.pengu.thaumcraft.additions.tileentity;
|
||||
|
||||
import com.pengu.thaumcraft.additions.tileentity.TileCreativeNode;
|
||||
import java.util.Calendar;
|
||||
import java.util.Random;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
@@ -14,13 +13,19 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class TileRendererCreativeNode extends TileEntitySpecialRenderer {
|
||||
|
||||
private static final ResourceLocation[] AURA = new ResourceLocation[]{new ResourceLocation("thaumicadditions", "textures/models/aura_1.png"), new ResourceLocation("thaumicadditions", "textures/models/aura_2.png")};
|
||||
// Re-seeded per node each frame: setSeed gives the same sequence as new Random(seed)
|
||||
private final Random rnd = new Random();
|
||||
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float floay) {
|
||||
boolean wearsRevealer = false;
|
||||
ItemStack helmet = Minecraft.getMinecraft().thePlayer.inventory.armorItemInSlot(0);
|
||||
if(te instanceof TileCreativeNode) {
|
||||
TileCreativeNode tcn = (TileCreativeNode)te;
|
||||
Random rnd = new Random((long)(tcn.getId() + "" + tcn.yCoord).hashCode() ^ 256L);
|
||||
float rot = (float)(Calendar.getInstance().get(14) + rnd.nextInt(1000)) % 1000.0F;
|
||||
Random rnd = this.rnd;
|
||||
rnd.setSeed((long)(tcn.getId() + "" + tcn.yCoord).hashCode() ^ 256L);
|
||||
// millisecond of the current second, as Calendar.getInstance().get(MILLISECOND) gave
|
||||
float rot = (float)((int)(System.currentTimeMillis() % 1000L) + rnd.nextInt(1000)) % 1000.0F;
|
||||
boolean prevBlend = GL11.glIsEnabled(3042);
|
||||
if(!prevBlend) {
|
||||
GL11.glEnable(3042);
|
||||
@@ -31,7 +36,7 @@ public class TileRendererCreativeNode extends TileEntitySpecialRenderer {
|
||||
GL11.glTranslated(x + 0.5D, y + 0.15000000596046448D, z + 0.5D);
|
||||
GL11.glEnable('\u803a');
|
||||
GL11.glScalef(1.5F, 1.5F, 1.5F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("thaumicadditions", "textures/models/aura_" + (rnd.nextInt(2) + 1) + ".png"));
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(AURA[rnd.nextInt(2)]);
|
||||
Tessellator p_77026_1_ = Tessellator.instance;
|
||||
float f = 0.0F;
|
||||
float f1 = 1.0F;
|
||||
|
||||
@@ -2,11 +2,8 @@ package com.pengu.thaumcraft.additions.tileentity;
|
||||
|
||||
import com.pengu.thaumcraft.additions.init.All;
|
||||
import com.pengu.thaumcraft.additions.utils.Util;
|
||||
import java.lang.reflect.Method;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import thaumcraft.api.TileThaumcraft;
|
||||
@@ -17,24 +14,29 @@ public class TileTaintedCrops extends TileThaumcraft {
|
||||
public int tick = 0;
|
||||
|
||||
|
||||
/** Ticks of growth needed per stage; the taint biome grows faster. */
|
||||
public static int growthThreshold(boolean taintBiome) {
|
||||
return 4000 - (taintBiome?450:0);
|
||||
}
|
||||
|
||||
/** Growth only counts while the crop is not yet fully grown. */
|
||||
public static boolean countsGrowth(int meta) {
|
||||
return meta < 4;
|
||||
}
|
||||
|
||||
public void updateEntity() {
|
||||
if(!this.worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord).canSustainPlant(this.worldObj, this.xCoord, this.yCoord - 1, this.zCoord, ForgeDirection.UP, (IPlantable)All.B_taint_crops) && this.worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) != Blocks.grass && this.worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) != Blocks.dirt) {
|
||||
net.minecraft.block.Block soil = this.worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord);
|
||||
if(!soil.canSustainPlant(this.worldObj, this.xCoord, this.yCoord - 1, this.zCoord, ForgeDirection.UP, (IPlantable)All.B_taint_crops) && soil != Blocks.grass && soil != Blocks.dirt) {
|
||||
// the crop block is gone after this, so there is nothing left to drop
|
||||
this.worldObj.setBlockToAir(this.xCoord, this.yCoord, this.zCoord);
|
||||
|
||||
try {
|
||||
Method m = this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord).getClass().getDeclaredMethod("dropBlockAsItem", new Class[]{World.class, Integer.class, Integer.class, Integer.class, ItemStack.class});
|
||||
m.setAccessible(true);
|
||||
m.invoke(this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord), new Object[]{this.worldObj, Integer.valueOf(this.xCoord), Integer.valueOf(this.yCoord), Integer.valueOf(this.zCoord), null});
|
||||
} catch (Throwable var2) {
|
||||
;
|
||||
}
|
||||
|
||||
} else {
|
||||
if(this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord) < 4) {
|
||||
int meta = this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord);
|
||||
if(countsGrowth(meta)) {
|
||||
++this.tick;
|
||||
}
|
||||
|
||||
if(this.tick >= 4000 - (this.worldObj.getBiomeGenForCoords(this.xCoord, this.zCoord).biomeID == Config.biomeTaintID?450:0)) {
|
||||
// the lowest possible threshold is 3550, so the biome is only looked up once it matters
|
||||
if(this.tick >= growthThreshold(true) && this.tick >= growthThreshold(this.worldObj.getBiomeGenForCoords(this.xCoord, this.zCoord).biomeID == Config.biomeTaintID)) {
|
||||
Util.setBlockMetadata(this.worldObj, this.xCoord, this.yCoord, this.zCoord, this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord) + 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,21 +23,17 @@ public class TileTankBasic extends TileThaumcraft implements ITubable {
|
||||
this.capacity = 1005;
|
||||
}
|
||||
|
||||
/** Block metadata for a tank by which neighbours are tanks: 0 none, 1 only below, 2 only above, 3 both. */
|
||||
public static int connectionMeta(boolean above, boolean below) {
|
||||
return (above?2:0) | (below?1:0);
|
||||
}
|
||||
|
||||
public void updateEntity() {
|
||||
if(!(this.worldObj.getBlock(this.xCoord, this.yCoord + 1, this.zCoord) instanceof BlockTankBasic) && !(this.worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) instanceof BlockTankBasic) && this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord) != 0) {
|
||||
Util.setBlockMetadata(this.worldObj, this.xCoord, this.yCoord, this.zCoord, 0);
|
||||
}
|
||||
|
||||
if(!(this.worldObj.getBlock(this.xCoord, this.yCoord + 1, this.zCoord) instanceof BlockTankBasic) && this.worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) instanceof BlockTankBasic && this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord) != 1) {
|
||||
Util.setBlockMetadata(this.worldObj, this.xCoord, this.yCoord, this.zCoord, 1);
|
||||
}
|
||||
|
||||
if(this.worldObj.getBlock(this.xCoord, this.yCoord + 1, this.zCoord) instanceof BlockTankBasic && !(this.worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) instanceof BlockTankBasic) && this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord) != 2) {
|
||||
Util.setBlockMetadata(this.worldObj, this.xCoord, this.yCoord, this.zCoord, 2);
|
||||
}
|
||||
|
||||
if(this.worldObj.getBlock(this.xCoord, this.yCoord + 1, this.zCoord) instanceof BlockTankBasic && this.worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) instanceof BlockTankBasic && this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord) != 3) {
|
||||
Util.setBlockMetadata(this.worldObj, this.xCoord, this.yCoord, this.zCoord, 3);
|
||||
boolean above = this.worldObj.getBlock(this.xCoord, this.yCoord + 1, this.zCoord) instanceof BlockTankBasic;
|
||||
boolean below = this.worldObj.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) instanceof BlockTankBasic;
|
||||
int wantedMeta = TileTankBasic.connectionMeta(above, below);
|
||||
if(this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord) != wantedMeta) {
|
||||
Util.setBlockMetadata(this.worldObj, this.xCoord, this.yCoord, this.zCoord, wantedMeta);
|
||||
}
|
||||
|
||||
if(!this.worldObj.isRemote) {
|
||||
|
||||
@@ -10,11 +10,26 @@ import com.pengu.util.ForgeDirectionHelper;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import java.util.ArrayList;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import thaumcraft.api.TileThaumcraft;
|
||||
|
||||
public class TileThaumicGenerator extends TileThaumcraft implements ITubable {
|
||||
|
||||
private static final ForgeDirection[] DIRS = new ForgeDirection[]{ForgeDirection.UP, ForgeDirection.DOWN, ForgeDirection.EAST, ForgeDirection.WEST, ForgeDirection.SOUTH, ForgeDirection.NORTH};
|
||||
private static final boolean BOTANIA_LOADED = Loader.isModLoaded("Botania");
|
||||
private static Botania botania;
|
||||
|
||||
// Botania bridge is stateless: one instance, created only when Botania is loaded
|
||||
private static Botania botania() {
|
||||
if(botania == null) {
|
||||
botania = new Botania();
|
||||
}
|
||||
|
||||
return botania;
|
||||
}
|
||||
|
||||
|
||||
public int amount = 0;
|
||||
public int maxAmount = 640;
|
||||
public DirectionCombo emitPowerFromSidesListedHere;
|
||||
@@ -25,7 +40,7 @@ public class TileThaumicGenerator extends TileThaumcraft implements ITubable {
|
||||
}
|
||||
|
||||
public void updateEntity() {
|
||||
ForgeDirection[] dirs = new ForgeDirection[]{ForgeDirection.UP, ForgeDirection.DOWN, ForgeDirection.EAST, ForgeDirection.WEST, ForgeDirection.SOUTH, ForgeDirection.NORTH};
|
||||
ForgeDirection[] dirs = DIRS;
|
||||
this.maxAmount = 640;
|
||||
ArrayList fd = new ArrayList();
|
||||
int i;
|
||||
@@ -59,31 +74,31 @@ public class TileThaumicGenerator extends TileThaumcraft implements ITubable {
|
||||
|
||||
if(this.amount > 1) {
|
||||
for(i = 0; i < dirs.length; ++i) {
|
||||
if(this.worldObj.getTileEntity(this.xCoord + ForgeDirectionHelper.getForgeDirectionXApplyed(dirs[i]), this.yCoord + ForgeDirectionHelper.getForgeDirectionYApplyed(dirs[i]), this.zCoord + ForgeDirectionHelper.getForgeDirectionZApplyed(dirs[i])) != null) {
|
||||
if(this.worldObj.getTileEntity(this.xCoord + ForgeDirectionHelper.getForgeDirectionXApplyed(dirs[i]), this.yCoord + ForgeDirectionHelper.getForgeDirectionYApplyed(dirs[i]), this.zCoord + ForgeDirectionHelper.getForgeDirectionZApplyed(dirs[i])) instanceof IRJReceiver) {
|
||||
// one tile lookup per side (it was read up to nine times)
|
||||
TileEntity te = this.worldObj.getTileEntity(this.xCoord + ForgeDirectionHelper.getForgeDirectionXApplyed(dirs[i]), this.yCoord + ForgeDirectionHelper.getForgeDirectionYApplyed(dirs[i]), this.zCoord + ForgeDirectionHelper.getForgeDirectionZApplyed(dirs[i]));
|
||||
if(te != null) {
|
||||
if(te instanceof IRJReceiver) {
|
||||
fd.add(dirs[i]);
|
||||
}
|
||||
|
||||
if(this.worldObj.getTileEntity(this.xCoord + ForgeDirectionHelper.getForgeDirectionXApplyed(dirs[i]), this.yCoord + ForgeDirectionHelper.getForgeDirectionYApplyed(dirs[i]), this.zCoord + ForgeDirectionHelper.getForgeDirectionZApplyed(dirs[i])) instanceof IEnergyReceiver) {
|
||||
if(te instanceof IEnergyReceiver) {
|
||||
fd.add(dirs[i]);
|
||||
}
|
||||
|
||||
if(Loader.isModLoaded("Botania") && (new Botania()).canConnect(this.worldObj, this.xCoord, this.yCoord, this.zCoord, dirs[i])) {
|
||||
if(BOTANIA_LOADED && botania().canConnect(this.worldObj, this.xCoord, this.yCoord, this.zCoord, dirs[i])) {
|
||||
fd.add(dirs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if(this.worldObj.getTileEntity(this.xCoord + ForgeDirectionHelper.getForgeDirectionXApplyed(dirs[i]), this.yCoord + ForgeDirectionHelper.getForgeDirectionYApplyed(dirs[i]), this.zCoord + ForgeDirectionHelper.getForgeDirectionZApplyed(dirs[i])) != null) {
|
||||
if(this.worldObj.getTileEntity(this.xCoord + ForgeDirectionHelper.getForgeDirectionXApplyed(dirs[i]), this.yCoord + ForgeDirectionHelper.getForgeDirectionYApplyed(dirs[i]), this.zCoord + ForgeDirectionHelper.getForgeDirectionZApplyed(dirs[i])) instanceof IRJReceiver) {
|
||||
this.amount -= ((IRJReceiver)this.worldObj.getTileEntity(this.xCoord + ForgeDirectionHelper.getForgeDirectionXApplyed(dirs[i]), this.yCoord + ForgeDirectionHelper.getForgeDirectionYApplyed(dirs[i]), this.zCoord + ForgeDirectionHelper.getForgeDirectionZApplyed(dirs[i]))).receiveRJ(dirs[i], 2000, false) / 1000;
|
||||
if(te instanceof IRJReceiver) {
|
||||
this.amount -= ((IRJReceiver)te).receiveRJ(dirs[i], 2000, false) / 1000;
|
||||
}
|
||||
|
||||
if(this.worldObj.getTileEntity(this.xCoord + ForgeDirectionHelper.getForgeDirectionXApplyed(dirs[i]), this.yCoord + ForgeDirectionHelper.getForgeDirectionYApplyed(dirs[i]), this.zCoord + ForgeDirectionHelper.getForgeDirectionZApplyed(dirs[i])) instanceof IEnergyReceiver) {
|
||||
this.amount -= ((IEnergyReceiver)this.worldObj.getTileEntity(this.xCoord + ForgeDirectionHelper.getForgeDirectionXApplyed(dirs[i]), this.yCoord + ForgeDirectionHelper.getForgeDirectionYApplyed(dirs[i]), this.zCoord + ForgeDirectionHelper.getForgeDirectionZApplyed(dirs[i]))).receiveEnergy(dirs[i], 2000, false) / 1000;
|
||||
if(te instanceof IEnergyReceiver) {
|
||||
this.amount -= ((IEnergyReceiver)te).receiveEnergy(dirs[i], 2000, false) / 1000;
|
||||
}
|
||||
|
||||
if(Loader.isModLoaded("Botania")) {
|
||||
this.amount -= (new Botania()).handleManaGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, dirs[i], 2000) / 100;
|
||||
if(BOTANIA_LOADED) {
|
||||
this.amount -= botania().handleManaGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, dirs[i], 2000) / 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@ public class TileTileBooster extends TileThaumcraft {
|
||||
int x = this.xCoord + ForgeDirectionHelper.getForgeDirectionXApplyed(fd);
|
||||
int y = this.yCoord + ForgeDirectionHelper.getForgeDirectionYApplyed(fd);
|
||||
int z = this.zCoord + ForgeDirectionHelper.getForgeDirectionZApplyed(fd);
|
||||
TileEntity te = this.worldObj.getTileEntity(x, y, z) != null && !(this.worldObj.getTileEntity(x, y, z) instanceof TileTileBooster)?this.worldObj.getTileEntity(x, y, z):null;
|
||||
if(te != null && te.canUpdate()) {
|
||||
TileEntity te = this.worldObj.getTileEntity(x, y, z); // read once (was up to three times)
|
||||
if(te != null && !(te instanceof TileTileBooster) && te.canUpdate()) {
|
||||
for(int i = 0; i < this.speed; ++i) {
|
||||
te.updateEntity();
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.pengu.thaumcraft.additions.utils.hud;
|
||||
import com.google.common.base.Stopwatch;
|
||||
import com.pengu.api.thaumicadditions.items.IHUDRenderable;
|
||||
import com.pengu.thaumcraft.additions.init.All;
|
||||
import com.pengu.thaumcraft.additions.utils.Util;
|
||||
import com.pengu.thaumcraft.additions.utils.hud.TipMessage;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
@@ -98,14 +97,7 @@ public class HUD {
|
||||
GL11.glTranslated(-0.0D, -(using?50.0D:0.0D), -0.0D);
|
||||
}
|
||||
|
||||
if(player.getItemInUse() != null) {
|
||||
ItemStack using1 = player.getItemInUse();
|
||||
maxDuration = using1.getItem().getMaxItemUseDuration(using1);
|
||||
duration = player.getItemInUseDuration();
|
||||
drawTexturedModalRect(HudLocation, Minecraft.getMinecraft().displayWidth / 8 - 32, 0, 0, 33, 65, 17);
|
||||
i = duration * 65 / Math.max(1, Util.applyModule(maxDuration));
|
||||
drawTexturedModalRect(HudLocation, Minecraft.getMinecraft().displayWidth / 8 - 31, 0, 1, 50, i, 17);
|
||||
}
|
||||
// 物品使用进度条已删除:displayWidth / 8 不考虑界面缩放,条会偏到屏幕左上角,Ethyn 决定不画。
|
||||
|
||||
if(this.currentMessage != null) {
|
||||
this.currentMessage.render();
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
package com.pengu.thaumcraft.additions.entity;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldProviderSurface;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import thaumcraft.common.CommonProxy;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
|
||||
/** TDLM/thaumicadditions#21: a grounded singularity queries its pull box once per tick, not 256 times. */
|
||||
public class EntitySingularityQueryTest {
|
||||
|
||||
private CommonProxy originalProxy;
|
||||
private QueryWorld world;
|
||||
private EntitySingularity singularity;
|
||||
private Entity bystander;
|
||||
private Mob mob;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private static <T> T allocate(Class<T> type) throws Exception {
|
||||
Constructor<?> ctor = sun.reflect.ReflectionFactory.getReflectionFactory()
|
||||
.newConstructorForSerialization(type, Object.class.getDeclaredConstructor());
|
||||
return (T) ctor.newInstance();
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
this.originalProxy = Thaumcraft.proxy;
|
||||
Thaumcraft.proxy = new CommonProxy();
|
||||
this.world = allocate(QueryWorld.class);
|
||||
this.world.rand = new Random(3);
|
||||
this.world.all = new ArrayList<Entity>();
|
||||
this.world.living = new ArrayList<Entity>();
|
||||
Field provider = World.class.getDeclaredField("provider");
|
||||
provider.setAccessible(true);
|
||||
provider.set(this.world, new WorldProviderSurface());
|
||||
|
||||
this.singularity = allocate(EntitySingularity.class);
|
||||
this.singularity.worldObj = this.world;
|
||||
this.singularity.posX = 8;
|
||||
this.singularity.posY = 64;
|
||||
this.singularity.posZ = 8;
|
||||
this.singularity.radius = 10;
|
||||
Field ground = net.minecraft.entity.projectile.EntityThrowable.class.getDeclaredField("inGround");
|
||||
ground.setAccessible(true);
|
||||
ground.setBoolean(this.singularity, true);
|
||||
|
||||
this.bystander = allocate(Plain.class);
|
||||
this.bystander.posX = 12;
|
||||
this.bystander.posY = 66;
|
||||
this.bystander.posZ = 5;
|
||||
this.mob = allocate(Mob.class);
|
||||
this.mob.posX = 4;
|
||||
this.mob.posY = 63;
|
||||
this.mob.posZ = 11;
|
||||
this.world.all.add(this.bystander);
|
||||
this.world.all.add(this.mob);
|
||||
this.world.living.add(this.mob);
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
Thaumcraft.proxy = this.originalProxy;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void thePullBoxIsQueriedOncePerTickAndEntitiesAreStillPulled() {
|
||||
this.singularity.onUpdate();
|
||||
|
||||
assertEquals("entity queries over the pull box", 2, this.world.pullQueries);
|
||||
double lift = 1 / 400.0F * 4.0F;
|
||||
assertEquals((8 - 12) / 10.0D, this.bystander.motionX, 1e-9);
|
||||
assertEquals((64 - 66 + lift) / 10.0D, this.bystander.motionY, 1e-9);
|
||||
assertEquals((8 - 5) / 10.0D, this.bystander.motionZ, 1e-9);
|
||||
assertEquals((8 - 4) / 10.0D, this.mob.motionX, 1e-9);
|
||||
assertEquals((64 - 63 + lift) / 10.0D, this.mob.motionY, 1e-9);
|
||||
assertEquals((8 - 11) / 10.0D, this.mob.motionZ, 1e-9);
|
||||
}
|
||||
|
||||
public static class Plain extends Entity {
|
||||
|
||||
public Plain() {
|
||||
super(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit() {}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(net.minecraft.nbt.NBTTagCompound nbt) {}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(net.minecraft.nbt.NBTTagCompound nbt) {}
|
||||
}
|
||||
|
||||
public static class Mob extends EntityLivingBase {
|
||||
|
||||
public Mob() {
|
||||
super(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getHeldItem() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getEquipmentInSlot(int slot) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCurrentItemOrArmor(int slot, ItemStack stack) {}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getLastActiveItems() {
|
||||
return new ItemStack[0];
|
||||
}
|
||||
}
|
||||
|
||||
public static class QueryWorld extends WorldServer {
|
||||
|
||||
List<Entity> all;
|
||||
List<Entity> living;
|
||||
int pullQueries;
|
||||
|
||||
QueryWorld() {
|
||||
super(null, null, "singularity", 0, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getEntitiesWithinAABB(Class type, AxisAlignedBB box) {
|
||||
if (box.maxX - box.minX < 3.0D) {
|
||||
return new ArrayList();
|
||||
}
|
||||
this.pullQueries++;
|
||||
return new ArrayList(type == EntityLivingBase.class ? this.living : this.all);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block getBlock(int x, int y, int z) {
|
||||
return null; // equals Blocks.air, which is unset without a Minecraft bootstrap
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.pengu.thaumcraft.additions.tileentity;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertSame;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldProviderSurface;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import thaumcraft.common.tiles.TileNode;
|
||||
|
||||
/** TDLM/thaumicadditions#17: a creative node registers its location once, not every tick, and unregisters on removal. */
|
||||
public class CreativeNodeRegistryTest {
|
||||
|
||||
private TileCreativeNode node;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private static <T> T allocate(Class<T> type) throws Exception {
|
||||
Constructor<?> ctor = sun.reflect.ReflectionFactory.getReflectionFactory()
|
||||
.newConstructorForSerialization(type, Object.class.getDeclaredConstructor());
|
||||
return (T) ctor.newInstance();
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
if (TileNode.locations == null) {
|
||||
Field f = TileNode.class.getDeclaredField("locations");
|
||||
f.setAccessible(true);
|
||||
f.set(null, new HashMap<String, ArrayList>());
|
||||
}
|
||||
TileNode.locations.clear();
|
||||
World world = allocate(FixtureWorld.class);
|
||||
Field provider = World.class.getDeclaredField("provider");
|
||||
provider.setAccessible(true);
|
||||
provider.set(world, new WorldProviderSurface());
|
||||
this.node = allocate(TileCreativeNode.class);
|
||||
this.node.setWorldObj(world);
|
||||
this.node.xCoord = 3;
|
||||
this.node.yCoord = 70;
|
||||
this.node.zCoord = 5;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void locationIsPutOnceAcrossManyTicks() {
|
||||
this.node.updateEntity(); // first tick only marks the node as updated
|
||||
this.node.updateEntity();
|
||||
ArrayList first = TileNode.locations.get("0:3:70:5");
|
||||
assertNotNull(first);
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
this.node.updateEntity();
|
||||
}
|
||||
assertSame("no re-registration on later ticks", first, TileNode.locations.get("0:3:70:5"));
|
||||
assertEquals(1, TileNode.locations.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void unloadingRemovesTheLocationSoItCanBeRegisteredAgain() {
|
||||
this.node.updateEntity();
|
||||
this.node.updateEntity();
|
||||
assertNotNull(TileNode.locations.get("0:3:70:5"));
|
||||
this.node.onChunkUnload();
|
||||
assertNull(TileNode.locations.get("0:3:70:5"));
|
||||
this.node.updateEntity();
|
||||
assertNotNull(TileNode.locations.get("0:3:70:5"));
|
||||
}
|
||||
|
||||
public static class FixtureWorld extends WorldServer {
|
||||
|
||||
FixtureWorld() {
|
||||
super(null, null, "node", 0, null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package com.pengu.thaumcraft.additions.tileentity;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.Test;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
|
||||
/** TDLM/thaumicadditions#16: the node is only rewritten when it no longer holds what the creator wants. */
|
||||
public class HyperNodeCreatorAspectsTest {
|
||||
|
||||
@Test
|
||||
public void aFreshlyBuiltListIsRecognisedAsCurrent() {
|
||||
for (boolean primalsOnly : new boolean[] { false, true }) {
|
||||
for (int total : new int[] { 0, 1, 64, 5000 }) {
|
||||
AspectList list = TileHyperNodeCreator.wantedAspects(total, primalsOnly);
|
||||
assertTrue("total " + total + " primalsOnly " + primalsOnly,
|
||||
TileHyperNodeCreator.holdsExactly(list, total, primalsOnly));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void wantedListHasTheSameShapeAsBefore() {
|
||||
AspectList all = TileHyperNodeCreator.wantedAspects(7, false);
|
||||
assertEquals(Aspect.getPrimalAspects().size() + Aspect.getCompoundAspects().size(), all.size());
|
||||
assertEquals(7, all.getAmount(Aspect.getPrimalAspects().get(0)));
|
||||
assertEquals(Aspect.getPrimalAspects().size(), TileHyperNodeCreator.wantedAspects(7, true).size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aDrainedOrChangedNodeIsRewritten() {
|
||||
AspectList list = TileHyperNodeCreator.wantedAspects(10, false);
|
||||
list.reduce(Aspect.getPrimalAspects().get(0), 3);
|
||||
assertFalse(TileHyperNodeCreator.holdsExactly(list, 10, false));
|
||||
assertFalse(TileHyperNodeCreator.holdsExactly(TileHyperNodeCreator.wantedAspects(10, false), 11, false));
|
||||
assertFalse(TileHyperNodeCreator.holdsExactly(TileHyperNodeCreator.wantedAspects(10, true), 10, false));
|
||||
assertFalse(TileHyperNodeCreator.holdsExactly(null, 10, false));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void primalsOnlyDoesNotMatchAnUnrelatedFullList() {
|
||||
assertFalse(TileHyperNodeCreator.holdsExactly(TileHyperNodeCreator.wantedAspects(10, false), 10, true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.pengu.thaumcraft.additions.tileentity;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
/** TDLM/thaumicadditions#20 and #22: the lookups were hoisted without changing what the tiles decide. */
|
||||
public class TankAndCropLogicTest {
|
||||
|
||||
@Test
|
||||
public void tankMetadataMatchesTheOriginalFourBranches() {
|
||||
assertEquals(0, TileTankBasic.connectionMeta(false, false));
|
||||
assertEquals(1, TileTankBasic.connectionMeta(false, true));
|
||||
assertEquals(2, TileTankBasic.connectionMeta(true, false));
|
||||
assertEquals(3, TileTankBasic.connectionMeta(true, true));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void cropThresholdIsLowerInTheTaintBiome() {
|
||||
assertEquals(4000, TileTaintedCrops.growthThreshold(false));
|
||||
assertEquals(3550, TileTaintedCrops.growthThreshold(true));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void cropOnlyCountsGrowthBelowStageFour() {
|
||||
assertTrue(TileTaintedCrops.countsGrowth(0));
|
||||
assertTrue(TileTaintedCrops.countsGrowth(3));
|
||||
assertFalse(TileTaintedCrops.countsGrowth(4));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user