Skip to content

Commit ebd29f7

Browse files
committed
GeminiのRV対応
1 parent b7e3d40 commit ebd29f7

13 files changed

Lines changed: 55 additions & 38 deletions

File tree

src/main/java/com/github/gtexpert/gtbm/integration/forestry/ForestryConfigHolder.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ public class ForestryConfigHolder {
1717
public static String gameMode = "NORMAL";
1818

1919
@Config.Comment({ "If true, each will be uncraftable.", "default: true" })
20-
public static boolean Still = true,
21-
Fabricator = true,
22-
Centrifuge = true,
23-
Bottler = true,
24-
Fermenter = true,
25-
Rainmaker = true,
26-
Carpenter = true,
27-
Moistener = true,
28-
Raintank = true,
29-
Squeezer = true,
30-
FarmBlock = true;
20+
public static boolean still = true,
21+
fabricator = true,
22+
centrifuge = true,
23+
bottler = true,
24+
fermenter = true,
25+
rainmaker = true,
26+
carpenter = true,
27+
moistener = true,
28+
raintank = true,
29+
squeezer = true,
30+
farmBlock = true;
3131
}

src/main/java/com/github/gtexpert/gtbm/integration/forestry/recipes/FFMBlockRecipe.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public static void blockCharcoal() {
7070
}
7171

7272
public static void farm() {
73-
if (!ForestryConfigHolder.FarmBlock) return;
73+
if (!ForestryConfigHolder.farmBlock) return;
7474

7575
BlockRegistryFarming blocks = getBlocks();
7676

src/main/java/com/github/gtexpert/gtbm/integration/forestry/recipes/FFMCraftingRecipe.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ public static void init() {
2323

2424
public static void recipeRemoval() {
2525
Map<Supplier<Boolean>, String> recipes = new HashMap<>();
26-
recipes.put(() -> ForestryConfigHolder.Still, "still");
27-
recipes.put(() -> ForestryConfigHolder.Fabricator, "fabricator");
28-
recipes.put(() -> ForestryConfigHolder.Centrifuge, "centrifuge");
29-
recipes.put(() -> ForestryConfigHolder.Bottler, "bottler");
30-
recipes.put(() -> ForestryConfigHolder.Fermenter, "fermenter");
31-
recipes.put(() -> ForestryConfigHolder.Rainmaker, "Rainmaker");
32-
recipes.put(() -> ForestryConfigHolder.Carpenter, "carpenter");
33-
recipes.put(() -> ForestryConfigHolder.Moistener, "moistener");
34-
recipes.put(() -> ForestryConfigHolder.Raintank, "raintank");
35-
recipes.put(() -> ForestryConfigHolder.Squeezer, "squeezer");
36-
recipes.put(() -> ForestryConfigHolder.Fermenter, "fermenter");
26+
recipes.put(() -> ForestryConfigHolder.still, "still");
27+
recipes.put(() -> ForestryConfigHolder.fabricator, "fabricator");
28+
recipes.put(() -> ForestryConfigHolder.centrifuge, "centrifuge");
29+
recipes.put(() -> ForestryConfigHolder.bottler, "bottler");
30+
recipes.put(() -> ForestryConfigHolder.fermenter, "fermenter");
31+
recipes.put(() -> ForestryConfigHolder.rainmaker, "Rainmaker");
32+
recipes.put(() -> ForestryConfigHolder.carpenter, "carpenter");
33+
recipes.put(() -> ForestryConfigHolder.moistener, "moistener");
34+
recipes.put(() -> ForestryConfigHolder.raintank, "raintank");
35+
recipes.put(() -> ForestryConfigHolder.squeezer, "squeezer");
36+
recipes.put(() -> ForestryConfigHolder.fermenter, "fermenter");
3737

3838
recipes.forEach((config, name) -> {
3939
if (config.get()) {

src/main/java/com/github/gtexpert/gtbm/integration/forestry/util/ApiaryModifierBridge.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
*/
1515
public class ApiaryModifierBridge extends DefaultBeeModifier {
1616

17+
private static final float MAX_TERRITORY = 5;
18+
1719
protected final ApiaryModifiers modifiers;
1820

1921
public ApiaryModifierBridge(ApiaryModifiers modifiers) {
@@ -22,7 +24,7 @@ public ApiaryModifierBridge(ApiaryModifiers modifiers) {
2224

2325
@Override
2426
public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
25-
return Math.min(modifiers.territory, 5);
27+
return Math.min(modifiers.territory, MAX_TERRITORY);
2628
}
2729

2830
@Override

src/main/java/com/github/gtexpert/gtbm/integration/forestry/util/BeeClimateHelper.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ public Biome getEffectiveBiome(@Nullable World world, BlockPos pos) {
3030
}
3131

3232
public Biome getBiome(World world, BlockPos pos) {
33-
Biome biome = getEffectiveBiome(world, pos);
34-
return biome != null ? biome : world.getBiome(pos);
33+
if (modifiers.biomeOverride != null) {
34+
return modifiers.biomeOverride;
35+
}
36+
return world.getBiome(pos);
3537
}
3638

3739
public EnumTemperature getTemperature(@Nullable World world, BlockPos pos) {

src/main/java/com/github/gtexpert/gtbm/integration/forestry/util/BeeHousingInfoProvider.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
*/
2323
public class BeeHousingInfoProvider implements IProbeInfoProvider {
2424

25+
private static final int HEALTH_THRESHOLD_DIVISOR = 4;
26+
private static final int HEALTH_COLOR_HIGH = 0xFF00D4CE;
27+
private static final int HEALTH_COLOR_LOW = 0xFFBB1C28;
28+
2529
@Override
2630
public String getID() {
2731
return ModValues.MODID + ":bee_housing_provider";
@@ -49,7 +53,7 @@ public void addProbeInfo(@NotNull ProbeMode mode, @NotNull IProbeInfo probeInfo,
4953
if (bee != null && bee.getMaxHealth() > 0) {
5054
int health = bee.getHealth();
5155
int maxHealth = bee.getMaxHealth();
52-
int color = health > maxHealth / 4 ? 0xFF00D4CE : 0xFFBB1C28;
56+
int color = health > maxHealth / HEALTH_THRESHOLD_DIVISOR ? HEALTH_COLOR_HIGH : HEALTH_COLOR_LOW;
5357
probeInfo.progress(health, maxHealth, probeInfo.defaultProgressStyle()
5458
.suffix(" / " + maxHealth + " HP")
5559
.filledColor(color)

src/main/java/com/github/gtexpert/gtbm/integration/forestry/util/WidgetBeeStatus.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,21 @@ private List<String> buildTooltipLines() {
117117
}
118118

119119
// Upgrade note (check if any modifier is non-default)
120-
if (modifiers.energy != 1 || modifiers.lifespan != 1 || modifiers.production != 1 ||
121-
modifiers.mutation != 1 || modifiers.territory != 1 || modifiers.flowering != 1 ||
122-
modifiers.geneticDecay != 1 || modifiers.humidity != 0 || modifiers.temperature != 0 ||
123-
modifiers.isSealed || modifiers.isSelfLighted || modifiers.isSunlightSimulated ||
124-
modifiers.isAutomated || modifiers.isCollectingPollen || modifiers.biomeOverride != null) {
120+
if (hasActiveUpgrades(modifiers)) {
125121
addLine(lines, "gtbm.bee.label.upgrade_note", "");
126122
}
127123

128124
return lines;
129125
}
130126

127+
private static boolean hasActiveUpgrades(ApiaryModifiers mods) {
128+
return mods.energy != 1 || mods.lifespan != 1 || mods.production != 1 ||
129+
mods.mutation != 1 || mods.territory != 1 || mods.flowering != 1 ||
130+
mods.geneticDecay != 1 || mods.humidity != 0 || mods.temperature != 0 ||
131+
mods.isSealed || mods.isSelfLighted || mods.isSunlightSimulated ||
132+
mods.isAutomated || mods.isCollectingPollen || mods.biomeOverride != null;
133+
}
134+
131135
private void addBeeStats(List<String> lines, IBee bee, IBeeHousingInventory inv) {
132136
EnumBeeType type = beeRoot.getType(inv.getQueen());
133137

@@ -147,6 +151,8 @@ private void addBeeStats(List<String> lines, IBee bee, IBeeHousingInventory inv)
147151
addLine(lines, "gtbm.bee.label.territory", String.format("%.0f x %.0f x %.0f",
148152
t.getX() * modifiers.territory, t.getY() * modifiers.territory,
149153
t.getZ() * modifiers.territory));
154+
} else {
155+
addLine(lines, "gtbm.bee.label.not_analyzed", "");
150156
}
151157
}
152158

src/main/java/com/github/gtexpert/gtbm/integration/gendustry/GendustryConfigHolder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
public class GendustryConfigHolder {
1313

1414
@Config.Comment({ "If true, each will be uncraftable.", "default: true" })
15-
public static boolean IndustrialApiary = true;
15+
public static boolean industrialApiary = true;
1616
}

src/main/java/com/github/gtexpert/gtbm/integration/gendustry/metatileentities/IndustrialApiaryLogic.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
public class IndustrialApiaryLogic extends RecipeLogicEnergy {
2424

2525
private static final int BASE_EU_PER_TICK = 80;
26+
private static final int PROGRESS_SYNC_TICKS = 20;
27+
private static final int BREEDING_TIME_TICKS = 100;
2628
private IBeeRoot beeRoot;
2729
private IBeekeepingLogic beekeepingLogic;
2830
private boolean needsMovePrincess;
@@ -192,7 +194,7 @@ private void updateProgress(boolean isWorking, MetaTileEntityIndustrialApiary ap
192194
// Periodic resync with actual health (every 20 ticks)
193195
// Forestry's aging is probabilistic, so progress can drift
194196
progressSyncCounter++;
195-
if (progressSyncCounter >= 20 && maxProgressTime > 0) {
197+
if (progressSyncCounter >= PROGRESS_SYNC_TICKS && maxProgressTime > 0) {
196198
progressSyncCounter = 0;
197199
resyncIfHealthChanged(apiary);
198200
}
@@ -223,7 +225,7 @@ private void syncProgressFromBee(MetaTileEntityIndustrialApiary apiary) {
223225
lastSyncedHealth = bee.getHealth();
224226
}
225227
} else if (type == EnumBeeType.PRINCESS) {
226-
maxProgressTime = 100;
228+
maxProgressTime = BREEDING_TIME_TICKS;
227229
progressTime = beekeepingLogic.getBeeProgressPercent();
228230
lastSyncedHealth = -1;
229231
}

src/main/java/com/github/gtexpert/gtbm/integration/gendustry/metatileentities/MetaTileEntityIndustrialApiary.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import net.minecraft.world.World;
1818
import net.minecraft.world.biome.Biome;
1919
import net.minecraftforge.items.IItemHandlerModifiable;
20-
import net.minecraftforge.items.ItemStackHandler;
2120

2221
import com.mojang.authlib.GameProfile;
2322

@@ -132,7 +131,7 @@ private int getUpgradeSlotCount() {
132131
@Override
133132
protected void initializeInventory() {
134133
super.initializeInventory();
135-
this.upgradeInventory = new ItemStackHandler(getUpgradeSlotCount()) {
134+
this.upgradeInventory = new NotifiableItemStackHandler(this, getUpgradeSlotCount(), this, false) {
136135

137136
@Override
138137
public boolean isItemValid(int slot, @org.jetbrains.annotations.NotNull ItemStack stack) {

0 commit comments

Comments
 (0)