Changes

44 bytes removed ,  22:26, 20 December 2020
m
Text replacement - "{{Colored box|title=Important|content=" to "{{Tip/Important|"
Line 49: Line 49:  
|}
 
|}
   −
{{Colored box|title=Important|content=Returning <code><nowiki>ActionResultType.CONSUME</nowiki></code> from this method on the client will prevent it being called on the server. It is common practice to just check <code><nowiki>worldIn.isRemote</nowiki></code> and return <code><nowiki>ActionResultType.SUCCESS</nowiki></code>, and otherwise go on to normal activation logic. Vanilla has many examples of this, such as the chest.}}
+
{{Tip/Important|Returning <code><nowiki>ActionResultType.CONSUME</nowiki></code> from this method on the client will prevent it being called on the server. It is common practice to just check <code><nowiki>worldIn.isRemote</nowiki></code> and return <code><nowiki>ActionResultType.SUCCESS</nowiki></code>, and otherwise go on to normal activation logic. Vanilla has many examples of this, such as the chest.}}
      Line 64: Line 64:  
Another common use for activation is, well, activation. This can be something like "turning on" a block, or triggering it to perform some action. For instance, a block could light up when activated. A vanilla example would be buttons or levers.
 
Another common use for activation is, well, activation. This can be something like "turning on" a block, or triggering it to perform some action. For instance, a block could light up when activated. A vanilla example would be buttons or levers.
   −
{{Colored box|title=Important|content=<code><nowiki>onBlockActivated</nowiki></code> is called on both the client and the server, so be sure to keep the [[Sides|sidedness]] of your code in mind. Many things, like opening GUIs and modifying the world, should only be done on the server-side.}}
+
{{Tip/Important|<code><nowiki>onBlockActivated</nowiki></code> is called on both the client and the server, so be sure to keep the [[Sides|sidedness]] of your code in mind. Many things, like opening GUIs and modifying the world, should only be done on the server-side.}}
     
297

edits