add a BlockRegister class to let rev not shoot himself trying to register blocks
This commit is contained in:
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
73
.idea/workspace.xml
generated
73
.idea/workspace.xml
generated
@@ -1,9 +1,58 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
|
<component name="ChangeListManager">
|
||||||
|
<list default="true" id="21afa9bb-6936-4dba-b025-44007f88dd40" name="Changes" comment="">
|
||||||
|
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
|
||||||
|
<change afterPath="$PROJECT_DIR$/src/net/minecraft/src/mml/BlockLoader.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/net/minecraft/src/Block.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/minecraft/src/Block.java" afterDir="false" />
|
||||||
|
</list>
|
||||||
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
|
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||||
|
</component>
|
||||||
|
<component name="FileTemplateManagerImpl">
|
||||||
|
<option name="RECENT_TEMPLATES">
|
||||||
|
<list>
|
||||||
|
<option value="Class" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="Git.Settings">
|
||||||
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectColorInfo"><![CDATA[{
|
||||||
|
"associatedIndex": 0,
|
||||||
|
"fromUser": false
|
||||||
|
}]]></component>
|
||||||
|
<component name="ProjectId" id="3FGqJZOP14ZXSxLwGOGtfFJIcz0" />
|
||||||
|
<component name="ProjectViewState">
|
||||||
|
<option name="hideEmptyMiddlePackages" value="true" />
|
||||||
|
<option name="showLibraryContents" value="true" />
|
||||||
|
</component>
|
||||||
|
<component name="PropertiesComponent"><![CDATA[{
|
||||||
|
"keyToString": {
|
||||||
|
"Application.Minecraft Client.executor": "Run",
|
||||||
|
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
||||||
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
|
"RunOnceActivity.git.unshallow": "true",
|
||||||
|
"RunOnceActivity.typescript.service.memoryLimit.init": "true",
|
||||||
|
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||||
|
"codeWithMe.voiceChat.enabledByDefault": "false",
|
||||||
|
"git-widget-placeholder": "main",
|
||||||
|
"kotlin-language-version-configured": "true",
|
||||||
|
"last_opened_file_path": "C:/idea/MML",
|
||||||
|
"project.structure.last.edited": "Libraries",
|
||||||
|
"project.structure.proportion": "0.0",
|
||||||
|
"project.structure.side.proportion": "0.0",
|
||||||
|
"vue.rearranger.settings.migration": "true"
|
||||||
|
}
|
||||||
|
}]]></component>
|
||||||
<component name="RunManager">
|
<component name="RunManager">
|
||||||
<configuration name="Minecraft Client" type="Application" factoryName="Application">
|
<configuration name="Minecraft Client" type="Application" factoryName="Application">
|
||||||
<option name="MAIN_CLASS_NAME" value="org.mcphackers.launchwrapper.Launch" />
|
<option name="MAIN_CLASS_NAME" value="org.mcphackers.launchwrapper.Launch" />
|
||||||
<module name="minecraft_client" />
|
<module name="minecraft" />
|
||||||
<option name="PROGRAM_PARAMETERS" value="--username Player --uuid - --session - --version 1.5.2 --gameDir . --assetsDir .\assets --assetIndex 1.4 --accessToken - --userProperties {} --userType legacy --versionType snapshot --skinProxy pre-1.8" />
|
<option name="PROGRAM_PARAMETERS" value="--username Player --uuid - --session - --version 1.5.2 --gameDir . --assetsDir .\assets --assetIndex 1.4 --accessToken - --userProperties {} --userType legacy --versionType snapshot --skinProxy pre-1.8" />
|
||||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/game" />
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/game" />
|
||||||
<method v="2">
|
<method v="2">
|
||||||
@@ -11,4 +60,26 @@
|
|||||||
</method>
|
</method>
|
||||||
</configuration>
|
</configuration>
|
||||||
</component>
|
</component>
|
||||||
|
<component name="SharedIndexes">
|
||||||
|
<attachedChunks>
|
||||||
|
<set>
|
||||||
|
<option value="bundled-jdk-30f59d01ecdd-37e91769500f-intellij.indexing.shared.core-IU-261.24374.151" />
|
||||||
|
<option value="bundled-js-predefined-d6986cc7102b-31caf2ab9e3c-JavaScript-IU-261.24374.151" />
|
||||||
|
</set>
|
||||||
|
</attachedChunks>
|
||||||
|
</component>
|
||||||
|
<component name="TaskManager">
|
||||||
|
<task active="true" id="Default" summary="Default task">
|
||||||
|
<changelist id="21afa9bb-6936-4dba-b025-44007f88dd40" name="Changes" comment="" />
|
||||||
|
<created>1781711682567</created>
|
||||||
|
<option name="number" value="Default" />
|
||||||
|
<option name="presentableId" value="Default" />
|
||||||
|
<updated>1781711682567</updated>
|
||||||
|
<workItem from="1781711683576" duration="1113000" />
|
||||||
|
</task>
|
||||||
|
<servers />
|
||||||
|
</component>
|
||||||
|
<component name="TypeScriptGeneratedFilesManager">
|
||||||
|
<option name="version" value="3" />
|
||||||
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@@ -2,6 +2,7 @@ package net.minecraft.src;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
import net.minecraft.src.mml.BlockLoader;
|
||||||
|
|
||||||
public class Block {
|
public class Block {
|
||||||
private CreativeTabs displayOnCreativeTab;
|
private CreativeTabs displayOnCreativeTab;
|
||||||
@@ -181,6 +182,10 @@ public class Block {
|
|||||||
public static final Block stairsNetherQuartz = (new BlockStairs(156, blockNetherQuartz, 0)).setUnlocalizedName("stairsQuartz");
|
public static final Block stairsNetherQuartz = (new BlockStairs(156, blockNetherQuartz, 0)).setUnlocalizedName("stairsQuartz");
|
||||||
public static final Block railActivator = (new BlockRailPowered(157)).setHardness(0.7F).setStepSound(soundMetalFootstep).setUnlocalizedName("activatorRail");
|
public static final Block railActivator = (new BlockRailPowered(157)).setHardness(0.7F).setStepSound(soundMetalFootstep).setUnlocalizedName("activatorRail");
|
||||||
public static final Block dropper = (new BlockDropper(158)).setHardness(3.5F).setStepSound(soundStoneFootstep).setUnlocalizedName("dropper");
|
public static final Block dropper = (new BlockDropper(158)).setHardness(3.5F).setStepSound(soundStoneFootstep).setUnlocalizedName("dropper");
|
||||||
|
|
||||||
|
public static BlockLoader Loader = new BlockLoader();
|
||||||
|
|
||||||
|
|
||||||
public final int blockID;
|
public final int blockID;
|
||||||
protected float blockHardness;
|
protected float blockHardness;
|
||||||
protected float blockResistance;
|
protected float blockResistance;
|
||||||
@@ -201,7 +206,7 @@ public class Block {
|
|||||||
private String unlocalizedName;
|
private String unlocalizedName;
|
||||||
protected Icon blockIcon;
|
protected Icon blockIcon;
|
||||||
|
|
||||||
protected Block(int var1, Material var2) {
|
public Block(int var1, Material var2) {
|
||||||
if(blocksList[var1] != null) {
|
if(blocksList[var1] != null) {
|
||||||
throw new IllegalArgumentException("Slot " + var1 + " is already occupied by " + blocksList[var1] + " when adding " + this);
|
throw new IllegalArgumentException("Slot " + var1 + " is already occupied by " + blocksList[var1] + " when adding " + this);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
15
src/net/minecraft/src/mml/BlockLoader.java
Normal file
15
src/net/minecraft/src/mml/BlockLoader.java
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
package net.minecraft.src.mml;
|
||||||
|
|
||||||
|
import net.minecraft.src.Block;
|
||||||
|
import net.minecraft.src.CreativeTabs;
|
||||||
|
import net.minecraft.src.Material;
|
||||||
|
|
||||||
|
public class BlockLoader {
|
||||||
|
public Block registerBlock(int BlockID, Material material, String unlocalizedName) {
|
||||||
|
Block InternalBlock = (new Block(BlockID, material));
|
||||||
|
InternalBlock.setCreativeTab(CreativeTabs.tabBlock);
|
||||||
|
InternalBlock.setUnlocalizedName(unlocalizedName);
|
||||||
|
return InternalBlock;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user