Skip to content

Commit a7701bd

Browse files
committed
gen patches
1 parent bdcd619 commit a7701bd

114 files changed

Lines changed: 29825 additions & 34900 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

patches.txt

Lines changed: 0 additions & 34884 deletions
This file was deleted.

src/main/java/mods/Hileb/optirefine/core/OptiRefineBlackboard.java

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,36 @@
22

33
import com.google.common.collect.Sets;
44
import com.google.gson.*;
5-
import it.unimi.dsi.fastutil.Arrays;
6-
import it.unimi.dsi.fastutil.objects.Object2BooleanArrayMap;
75
import it.unimi.dsi.fastutil.objects.Object2BooleanMap;
86
import it.unimi.dsi.fastutil.objects.Object2BooleanOpenHashMap;
97
import mods.Hileb.optirefine.library.common.utils.Lazy;
108
import net.minecraft.launchwrapper.Launch;
11-
import net.minecraftforge.common.IPlantable;
12-
import net.optifine.util.ArrayUtils;
9+
import org.apache.hc.client5.http.classic.methods.HttpGet;
10+
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
11+
import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
12+
import org.apache.hc.client5.http.impl.classic.HttpClients;
13+
import org.apache.hc.core5.http.io.entity.EntityUtils;
14+
import org.objectweb.asm.ClassReader;
15+
import org.objectweb.asm.ClassWriter;
16+
import org.objectweb.asm.Opcodes;
17+
import org.objectweb.asm.tree.*;
1318

1419
import java.io.BufferedReader;
1520
import java.io.BufferedWriter;
1621
import java.io.File;
1722
import java.io.IOException;
23+
import java.net.MalformedURLException;
24+
import java.net.URI;
25+
import java.net.URISyntaxException;
26+
import java.net.URL;
1827
import java.nio.charset.StandardCharsets;
1928
import java.nio.file.Files;
20-
import java.util.Comparator;
21-
import java.util.HashSet;
22-
import java.util.Map;
23-
import java.util.ServiceLoader;
29+
import java.util.*;
2430

2531
public class OptiRefineBlackboard {
32+
33+
34+
2635
public static final HashSet<String> CLASSES = Sets.newHashSet(
2736
"net.minecraft.block.material.MapColor", // Optifine -> make ‘colorValue’ not final -> accessTransformer
2837
"net.minecraft.block.state.BlockStateBase", // Optifine -> add new field and methods -> mixin
@@ -215,11 +224,20 @@ public class OptiRefineBlackboard {
215224
"net.minecraft.world.chunk.BlockStateContainer",
216225
"net.minecraft.world.chunk.storage.ExtendedBlockStorage"
217226
);
227+
private String getTitleFromHitokoto() {
228+
CloseableHttpResponse.create();
229+
CloseableHttpClient.class.getDeclaredMethods();
230+
try {
231+
String response = EntityUtils.toString(HttpClients.createDefault().execute(new HttpGet("https://v1.hitokoto.cn/")).getEntity());
232+
} catch (Throwable var9) {
233+
}
234+
}
235+
218236

219237
public static final Lazy<Object2BooleanMap<String>> REPATCH_CONFIG = Lazy.of(()->{
220238
// ServiceLoader.load(IPlantable.class).stream()
221239
// .map(ServiceLoader.Provider::get)
222-
.
240+
//.
223241
String[] str = CLASSES.toArray(String[]::new);
224242
boolean[] ab = new boolean[str.length];
225243
java.util.Arrays.fill(ab, true);

src/main/java/mods/Hileb/optirefine/core/OptiRefineCore.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ public List<String> getMixins() {
214214

215215
@Override
216216
public void preApply(String s, ClassNode classNode, String s1, IMixinInfo iMixinInfo) {
217-
218217
}
219218

220219
@Override

src/main/java/mods/Hileb/optirefine/mixin/defaults/minecraft/block/MixinBlockAir.java

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,61 @@ private static void restoreLightOpacity(Block block) {
4040
setLightOpacity(block, opacity);
4141
}
4242
}
43+
/*
44+
45+
+++ net/minecraft/block/BlockAir.java Tue Aug 19 14:59:58 2025
46+
@@ -1,20 +1,24 @@
47+
package net.minecraft.block;
48+
49+
+import java.util.IdentityHashMap;
50+
+import java.util.Map;
51+
import javax.annotation.Nullable;
52+
import net.minecraft.block.material.Material;
53+
import net.minecraft.block.state.BlockFaceShape;
54+
import net.minecraft.block.state.IBlockState;
55+
import net.minecraft.util.EnumBlockRenderType;
56+
import net.minecraft.util.EnumFacing;
57+
import net.minecraft.util.math.AxisAlignedBB;
58+
import net.minecraft.util.math.BlockPos;
59+
import net.minecraft.world.IBlockAccess;
60+
import net.minecraft.world.World;
61+
62+
public class BlockAir extends Block {
63+
+ private static Map mapOriginalOpacity = new IdentityHashMap();
64+
+
65+
protected BlockAir() {
66+
super(Material.AIR);
67+
}
68+
69+
public EnumBlockRenderType getRenderType(IBlockState var1) {
70+
return EnumBlockRenderType.INVISIBLE;
71+
@@ -39,12 +43,27 @@
72+
public boolean isReplaceable(IBlockAccess var1, BlockPos var2) {
73+
return true;
74+
}
75+
76+
public boolean isFullCube(IBlockState var1) {
77+
return false;
78+
+ }
79+
+
80+
+ public static void setLightOpacity(Block var0, int var1) {
81+
+ if (!mapOriginalOpacity.containsKey(var0)) {
82+
+ mapOriginalOpacity.put(var0, var0.lightOpacity);
83+
+ }
84+
+
85+
+ var0.lightOpacity = var1;
86+
+ }
87+
+
88+
+ public static void restoreLightOpacity(Block var0) {
89+
+ if (mapOriginalOpacity.containsKey(var0)) {
90+
+ int var1 = (Integer)mapOriginalOpacity.get(var0);
91+
+ setLightOpacity(var0, var1);
92+
+ }
93+
}
94+
95+
public BlockFaceShape getBlockFaceShape(IBlockAccess var1, IBlockState var2, BlockPos var3, EnumFacing var4) {
96+
return BlockFaceShape.UNDEFINED;
97+
}
98+
}
99+
100+
*/

src/main/java/mods/Hileb/optirefine/mixin/defaults/minecraft/block/material/MixinMapColor.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,22 @@ public abstract class MixinMapColor {
1414
public int access_colorValue;
1515

1616
}
17+
/*
18+
+++ net/minecraft/block/material/MapColor.java Tue Aug 19 14:59:58 2025
19+
@@ -54,13 +54,13 @@
20+
public static final MapColor PURPLE_STAINED_HARDENED_CLAY = new MapColor(46, 8014168);
21+
public static final MapColor BLUE_STAINED_HARDENED_CLAY = new MapColor(47, 4996700);
22+
public static final MapColor BROWN_STAINED_HARDENED_CLAY = new MapColor(48, 4993571);
23+
public static final MapColor GREEN_STAINED_HARDENED_CLAY = new MapColor(49, 5001770);
24+
public static final MapColor RED_STAINED_HARDENED_CLAY = new MapColor(50, 9321518);
25+
public static final MapColor BLACK_STAINED_HARDENED_CLAY = new MapColor(51, 2430480);
26+
- public final int colorValue;
27+
+ public int colorValue;
28+
public final int colorIndex;
29+
30+
private MapColor(int var1, int var2) {
31+
if (var1 >= 0 && var1 <= 63) {
32+
this.colorIndex = var1;
33+
this.colorValue = var2;
34+
35+
*/

src/main/java/mods/Hileb/optirefine/mixin/defaults/minecraft/block/state/MixinBlockStateBase.java

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,83 @@ public ResourceLocation getBlockLocation() {
7575
return this.blockLocation;
7676
}
7777
}
78+
/*
79+
+++ net/minecraft/block/state/BlockStateBase.java Tue Aug 19 14:59:58 2025
80+
@@ -1,17 +1,19 @@
81+
package net.minecraft.block.state;
82+
83+
import com.google.common.base.Function;
84+
import com.google.common.base.Joiner;
85+
+import com.google.common.collect.ImmutableTable;
86+
import com.google.common.collect.Iterables;
87+
import java.util.Collection;
88+
import java.util.Iterator;
89+
import java.util.Map.Entry;
90+
import javax.annotation.Nullable;
91+
import net.minecraft.block.Block;
92+
import net.minecraft.block.properties.IProperty;
93+
+import net.minecraft.util.ResourceLocation;
94+
95+
public abstract class BlockStateBase implements IBlockState {
96+
private static final Joiner COMMA_JOINER = Joiner.on(',');
97+
private static final Function<Entry<IProperty<?>, Comparable<?>>, String> MAP_ENTRY_TO_STRING = new Function<Entry<IProperty<?>, Comparable<?>>, String>() {
98+
@Nullable
99+
public String apply(@Nullable Entry<IProperty<?>, Comparable<?>> var1) {
100+
@@ -21,15 +23,55 @@
101+
IProperty var2 = (IProperty)var1.getKey();
102+
return var2.getName() + "=" + this.getPropertyName(var2, (Comparable<?>)var1.getValue());
103+
}
104+
}
105+
106+
private <T extends Comparable<T>> String getPropertyName(IProperty<T> var1, Comparable<?> var2) {
107+
- return var1.getName((T)var2);
108+
+ return var1.getName(var2);
109+
}
110+
};
111+
+ private int blockId = -1;
112+
+ private int blockStateId = -1;
113+
+ private int metadata = -1;
114+
+ private ResourceLocation blockLocation = null;
115+
+
116+
+ public int getBlockId() {
117+
+ if (this.blockId < 0) {
118+
+ this.blockId = Block.getIdFromBlock(this.getBlock());
119+
+ }
120+
+
121+
+ return this.blockId;
122+
+ }
123+
+
124+
+ public int getBlockStateId() {
125+
+ if (this.blockStateId < 0) {
126+
+ this.blockStateId = Block.getStateId(this);
127+
+ }
128+
+
129+
+ return this.blockStateId;
130+
+ }
131+
+
132+
+ public int getMetadata() {
133+
+ if (this.metadata < 0) {
134+
+ this.metadata = this.getBlock().getMetaFromState(this);
135+
+ }
136+
+
137+
+ return this.metadata;
138+
+ }
139+
+
140+
+ public ResourceLocation getBlockLocation() {
141+
+ if (this.blockLocation == null) {
142+
+ this.blockLocation = (ResourceLocation)Block.REGISTRY.getNameForObject(this.getBlock());
143+
+ }
144+
+
145+
+ return this.blockLocation;
146+
+ }
147+
+
148+
+ public ImmutableTable<IProperty<?>, Comparable<?>, IBlockState> getPropertyValueTable() {
149+
+ return null;
150+
+ }
151+
152+
public <T extends Comparable<T>> IBlockState cycleProperty(IProperty<T> var1) {
153+
return this.withProperty(var1, cyclePropertyValue(var1.getAllowedValues(), this.getValue(var1)));
154+
}
155+
156+
protected static <T> T cyclePropertyValue(Collection<T> var0, T var1) {
157+
*/

0 commit comments

Comments
 (0)